-
Notifications
You must be signed in to change notification settings - Fork 9
feat: enable site clusters to run Nautobot Celery workers on site clusters #1908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
42dfb5e
feat: enable site clusters to run Nautobot Celery workers with mTLS
syedhaseebahmed 7a17317
set appLabels `UNDERSTACK_PARTITION`, to site job queues
syedhaseebahmed e4bfc15
refactoring
syedhaseebahmed 7427547
issue client certificates on the global cluster and transfer only the…
syedhaseebahmed 2e9443d
site specific non default queues
syedhaseebahmed 805b776
NAUTOBOT_EXTRA_PLUGINS and NAUTOBOT_EXTRA_PLUGINS_CONFIG
syedhaseebahmed 7423e9a
authenticate CNPG with certs
syedhaseebahmed 3797541
allow alternative nautobot config to be supplied
syedhaseebahmed f67b30f
docs improvement
syedhaseebahmed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
charts/argocd-understack/templates/application-nautobot-worker.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| {{- if eq (include "understack.isEnabled" (list $.Values.site "nautobot_worker")) "true" }} | ||
| --- | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| kind: Application | ||
| metadata: | ||
| name: {{ printf "%s-%s" $.Release.Name "nautobot-worker" }} | ||
| finalizers: | ||
| - resources-finalizer.argocd.argoproj.io | ||
| annotations: | ||
| argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true | ||
| {{- include "understack.appLabelsBlock" $ | nindent 2 }} | ||
| spec: | ||
| destination: | ||
| namespace: nautobot | ||
| server: {{ $.Values.cluster_server }} | ||
| project: understack | ||
| sources: | ||
| - chart: nautobot | ||
| helm: | ||
| fileParameters: | ||
| - name: nautobot.config | ||
| path: {{ $.Values.site.nautobot_worker.nautobot_config }} | ||
| ignoreMissingValueFiles: true | ||
| releaseName: nautobot-worker | ||
| valueFiles: | ||
| - $understack/components/nautobot-worker/values.yaml | ||
| - $deploy/{{ include "understack.deploy_path" $ }}/nautobot-worker/values.yaml | ||
| {{- with index $.Values.appLabels "understack.rackspace.com/partition" }} | ||
| values: | | ||
| workers: | ||
| default: | ||
| enabled: false | ||
| {{ . }}: | ||
| enabled: true | ||
| taskQueues: {{ . | quote }} | ||
| {{- end }} | ||
| repoURL: https://nautobot.github.io/helm-charts/ | ||
| targetRevision: 2.5.6 | ||
|
|
||
| - path: components/nautobot-worker | ||
| ref: understack | ||
| repoURL: {{ include "understack.understack_url" $ }} | ||
| targetRevision: {{ include "understack.understack_ref" $ }} | ||
| kustomize: | ||
| patches: | ||
| - patch: | | ||
| - op: replace | ||
| path: /data/UNDERSTACK_PARTITION | ||
| value: "{{ index $.Values.appLabels "understack.rackspace.com/partition" | default "" }}" | ||
| target: | ||
| kind: ConfigMap | ||
| name: cluster-data | ||
| - path: {{ include "understack.deploy_path" $ }}/nautobot-worker | ||
| ref: deploy | ||
| repoURL: {{ include "understack.deploy_url" $ }} | ||
| targetRevision: {{ include "understack.deploy_ref" $ }} | ||
| syncPolicy: | ||
| automated: | ||
| prune: true | ||
| selfHeal: true | ||
| managedNamespaceMetadata: | ||
| annotations: | ||
| argocd.argoproj.io/sync-options: Delete=false | ||
| syncOptions: | ||
| - CreateNamespace=true | ||
| - ServerSideApply=true | ||
| - RespectIgnoreDifferences=true | ||
| - ApplyOutOfSyncOnly=true | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
|
|
||
| configMapGenerator: | ||
| - name: cluster-data | ||
| literals: | ||
| - UNDERSTACK_PARTITION="" | ||
| options: | ||
| disableNameSuffixHash: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Nautobot Worker (site-level) | ||
| # | ||
| # Deploys only Celery workers that connect back to the global Nautobot | ||
| # database and Redis. The web server is disabled because it lives on | ||
| # the global cluster. Redis and PostgreSQL are disabled because the | ||
| # workers reach the global instances over the network. | ||
| --- | ||
|
|
||
| # Disable the Nautobot web server — workers only | ||
| nautobot: | ||
| enabled: false | ||
| replicaCount: 0 | ||
|
|
||
| db: | ||
| engine: "django.db.backends.postgresql" | ||
| # Override in deploy repo values to point at the global CNPG service | ||
| host: "" | ||
| port: 5432 | ||
| name: "app" | ||
| user: "app" | ||
| existingSecret: "nautobot-db" | ||
| existingSecretPasswordKey: "password" | ||
|
|
||
| django: | ||
| existingSecret: nautobot-django | ||
|
|
||
| superUser: | ||
| enabled: false | ||
|
|
||
| redis: | ||
| # Override in deploy repo values to point at the global Redis service | ||
| host: "" | ||
| port: 6379 | ||
| ssl: false | ||
| username: "" | ||
|
|
||
| celery: | ||
| enabled: true | ||
| concurrency: 2 | ||
| replicaCount: 1 | ||
| extraEnvVarsCM: | ||
| - cluster-data | ||
| extraEnvVarsSecret: | ||
| - nautobot-django | ||
| livenessProbe: | ||
| initialDelaySeconds: 60 | ||
| periodSeconds: 120 | ||
| timeoutSeconds: 60 | ||
| readinessProbe: | ||
| initialDelaySeconds: 60 | ||
| periodSeconds: 120 | ||
| timeoutSeconds: 60 | ||
|
|
||
| # Disable celery beat — scheduling runs on the global cluster only | ||
| workers: | ||
| beat: | ||
| enabled: false | ||
|
|
||
| # Do not deploy local Redis — use the global instance | ||
| redis: | ||
| enabled: false | ||
|
|
||
| # Do not deploy local PostgreSQL — use the global CNPG instance | ||
| postgresql: | ||
| enabled: false | ||
|
|
||
| ingress: | ||
| enabled: false |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.