Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ignore:
- components/etcdbackup/templates/
- charts/argocd-understack/templates/
- charts/nautobot-api-tokens/templates/
- charts/nautobot-job-queues/templates/
- charts/site-workflows/templates/
- charts/undersync/templates/

Expand Down
1 change: 0 additions & 1 deletion ansible/nautobot-post-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

roles:
- role: nautobot_permissions
- role: jobs
- role: secrets
- role: git_repos
- role: nautobot_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
argocd.argoproj.io/sync-wave: "1"
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
spec:
destination:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if eq (include "understack.isEnabled" (list $.Values.global "nautobot_job_queues")) "true" }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ printf "%s-%s" $.Release.Name "nautobot-job-queues" }}
finalizers:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
argocd.argoproj.io/sync-wave: "2"
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
spec:
destination:
namespace: nautobot
server: {{ $.Values.cluster_server }}
project: understack
sources:
- repoURL: {{ include "understack.understack_url" $ }}
targetRevision: {{ include "understack.understack_ref" $ }}
path: charts/nautobot-job-queues
helm:
ignoreMissingValueFiles: true
valueFiles:
- $deploy/{{ include "understack.deploy_path" $ }}/nautobot-job-queues/values.yaml
- path: {{ include "understack.deploy_path" $ }}/nautobot-job-queues
ref: deploy
repoURL: {{ include "understack.deploy_url" $ }}
targetRevision: {{ include "understack.deploy_ref" $ }}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
- RespectIgnoreDifferences=true
- ApplyOutOfSyncOnly=true
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
argocd.argoproj.io/sync-wave: "0"
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
spec:
destination:
Expand Down
6 changes: 6 additions & 0 deletions charts/argocd-understack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ global:
# @default -- false
enabled: false

# -- Nautobot Celery JobQueue bootstrap jobs
nautobot_job_queues:
# -- Enable/disable deploying
# @default -- false
enabled: false

# -- Nautobot Operator for Kubernetes
nautobotop:
# -- Enable/disable deploying Nautobot Operator
Expand Down
12 changes: 12 additions & 0 deletions charts/nautobot-job-queues/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: nautobot-job-queues
description: Ensure Nautobot Celery JobQueue records from Helm values

type: application

version: 0.1.0
# renovate: datasource=docker depName=networktocode/nautobot versioning=semver
appVersion: "3.0.7"

maintainers:
- name: rackerlabs
22 changes: 22 additions & 0 deletions charts/nautobot-job-queues/ci/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
queues:
- site-dc

jobs:
enable:
groupings:
- Rackspace
names:
- Backup Configurations
- Deploy Config Plan (Job Button Receiver)
- Deploy Config Plans
- Generate Intended Configurations
- Perform Configuration Compliance
queueAssignments:
- names:
- Backup Configurations
- Deploy Config Plan (Job Button Receiver)
- Deploy Config Plans
- Generate Intended Configurations
- Perform Configuration Compliance
queues:
- site-dc
49 changes: 49 additions & 0 deletions charts/nautobot-job-queues/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{/* Expand the name of the chart. */}}
{{- define "nautobot-job-queues.name" -}}
{{- .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/* Create a default fully qualified app name. */}}
{{- define "nautobot-job-queues.fullname" -}}
{{- if contains .Chart.Name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/* Chart label value. */}}
{{- define "nautobot-job-queues.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/* Common labels. */}}
{{- define "nautobot-job-queues.labels" -}}
helm.sh/chart: {{ include "nautobot-job-queues.chart" . }}
{{ include "nautobot-job-queues.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/* Selector labels. */}}
{{- define "nautobot-job-queues.selectorLabels" -}}
app.kubernetes.io/name: {{ include "nautobot-job-queues.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/* Script config map name. */}}
{{- define "nautobot-job-queues.scriptConfigMapName" -}}
{{- printf "%s-script" (include "nautobot-job-queues.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}

{{/* Desired JobQueue config map name. */}}
{{- define "nautobot-job-queues.desiredConfigMapName" -}}
{{- printf "%s-desired" (include "nautobot-job-queues.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}

{{/* Ensure job name. */}}
{{- define "nautobot-job-queues.jobName" -}}
{{- printf "%s-ensure" (include "nautobot-job-queues.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}
11 changes: 11 additions & 0 deletions charts/nautobot-job-queues/templates/configmap-desired-queues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "nautobot-job-queues.desiredConfigMapName" . }}
labels:
{{- include "nautobot-job-queues.labels" . | nindent 4 }}
data:
job-queues.json: |
{{ .Values.queues | toJson }}
jobs.json: |
{{ .Values.jobs | toJson }}
Loading
Loading