-
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
Changes from 4 commits
42dfb5e
7a17317
e4bfc15
7427547
2e9443d
805b776
7423e9a
3797541
f67b30f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| {{- 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: $understack/components/nautobot/nautobot_config.py | ||
| 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: | ||
| taskQueues: {{ . | quote }} | ||
| {{- end }} | ||
| repoURL: https://nautobot.github.io/helm-charts/ | ||
| targetRevision: 2.5.6 | ||
|
|
||
| - path: components/nautobot-worker | ||
|
haseebsyed12 marked this conversation as resolved.
|
||
| 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 }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
|
haseebsyed12 marked this conversation as resolved.
|
||
| kind: Kustomization | ||
|
|
||
| configMapGenerator: | ||
| - name: cluster-data | ||
| literals: | ||
| - UNDERSTACK_PARTITION="" | ||
| options: | ||
| disableNameSuffixHash: true | ||
| 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 |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as @cardoe found out - this introduces 3rd place or 3rd copy of the
Can we standardise on using just one way of delivering that config?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. global application-nautobot.yaml and the site application-nautobot-worker.yaml reference the same single It is hardcoded to shall I address issue of default container path(/opt/nautobot/nautobot_config.py)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed both the issues and updated the docs with relevant details on root cause and fix |

Uh oh!
There was an error while loading. Please reload this page.