Skip to content

Commit

Permalink
Remove job stanza, bringing nodeSelector and tolerations up by one in…
Browse files Browse the repository at this point in the history
…dent level
  • Loading branch information
Thomas Eckert committed Oct 14, 2022
1 parent 4f9b49c commit e5a5a6f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 33 deletions.
8 changes: 4 additions & 4 deletions charts/consul/templates/server-acl-init-cleanup-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ spec:
limits:
memory: "50Mi"
cpu: "50m"
{{- if .Values.global.acls.job.tolerations }}
{{- if .Values.global.acls.tolerations }}
tolerations:
{{ tpl .Values.global.acls.job.tolerations . | indent 12 | trim }}
{{ tpl .Values.global.acls.tolerations . | indent 12 | trim }}
{{- end }}
{{- if .Values.global.acls.job.nodeSelector }}
{{- if .Values.global.acls.nodeSelector }}
nodeSelector:
{{ tpl .Values.global.acls.job.nodeSelector . | indent 12 | trim }}
{{ tpl .Values.global.acls.nodeSelector . | indent 12 | trim }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/consul/templates/server-acl-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ spec:
limits:
memory: "50Mi"
cpu: "50m"
{{- if .Values.global.acls.job.tolerations }}
{{- if .Values.global.acls.tolerations }}
tolerations:
{{ tpl .Values.global.acls.job.tolerations . | indent 12 | trim }}
{{ tpl .Values.global.acls.tolerations . | indent 12 | trim }}
{{- end }}
{{- if .Values.global.acls.job.nodeSelector }}
{{- if .Values.global.acls.nodeSelector }}
nodeSelector:
{{ tpl .Values.global.acls.job.nodeSelector . | indent 12 | trim }}
{{ tpl .Values.global.acls.nodeSelector . | indent 12 | trim }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/consul/test/unit/server-acl-init-cleanup-job.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ load _helpers
}

#--------------------------------------------------------------------
# global.acls.job
# global.acls.tolerations and global.acls.nodeSelector

@test "serverACLInitCleanup/Job: tolerations not set by default" {
cd `chart_dir`
Expand All @@ -89,7 +89,7 @@ load _helpers
local actual=$(helm template \
-s templates/server-acl-init-job.yaml \
--set 'global.acls.manageSystemACLs=true' \
--set 'global.acls.job.tolerations=- key: value' \
--set 'global.acls.tolerations=- key: value' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.tolerations[0].key' | tee /dev/stderr)
[ "${actual}" = "value" ]
Expand All @@ -110,7 +110,7 @@ load _helpers
local actual=$(helm template \
-s templates/server-acl-init-job.yaml \
--set 'global.acls.manageSystemACLs=true' \
--set 'global.acls.job.nodeSelector=- key: value' \
--set 'global.acls.nodeSelector=- key: value' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.nodeSelector[0].key' | tee /dev/stderr)
[ "${actual}" = "value" ]
Expand Down
6 changes: 3 additions & 3 deletions charts/consul/test/unit/server-acl-init-job.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ load _helpers
}

#--------------------------------------------------------------------
# global.acls.job
# global.acls.tolerations and global.acls.nodeSelector

@test "serverACLInit/Job: tolerations not set by default" {
cd `chart_dir`
Expand All @@ -1578,7 +1578,7 @@ load _helpers
local actual=$(helm template \
-s templates/server-acl-init-job.yaml \
--set 'global.acls.manageSystemACLs=true' \
--set 'global.acls.job.tolerations=- key: value' \
--set 'global.acls.tolerations=- key: value' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.tolerations[0].key' | tee /dev/stderr)
[ "${actual}" = "value" ]
Expand All @@ -1599,7 +1599,7 @@ load _helpers
local actual=$(helm template \
-s templates/server-acl-init-job.yaml \
--set 'global.acls.manageSystemACLs=true' \
--set 'global.acls.job.nodeSelector=- key: value' \
--set 'global.acls.nodeSelector=- key: value' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.nodeSelector[0].key' | tee /dev/stderr)
[ "${actual}" = "value" ]
Expand Down
36 changes: 17 additions & 19 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -515,25 +515,23 @@ global:
# @type: string
secretKey: null

# job configures settings for the server-acl-init and server-acl-cleanup jobs
job:
# tolerations configures the taints and tolerations for the server-acl-init
# and server-acl-cleanup jobs. This should be a multi-line string matching the
# Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec.
tolerations: ""

# This value defines `nodeSelector` (https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector)
# labels for the server-acl-init and server-acl-cleanup jobs pod assignment, formatted as a multi-line string.
#
# Example:
#
# ```yaml
# nodeSelector: |
# beta.kubernetes.io/arch: amd64
# ```
#
# @type: string
nodeSelector: null
# tolerations configures the taints and tolerations for the server-acl-init
# and server-acl-cleanup jobs. This should be a multi-line string matching the
# Tolerations (https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) array in a Pod spec.
tolerations: ""

# This value defines `nodeSelector` (https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector)
# labels for the server-acl-init and server-acl-cleanup jobs pod assignment, formatted as a multi-line string.
#
# Example:
#
# ```yaml
# nodeSelector: |
# beta.kubernetes.io/arch: amd64
# ```
#
# @type: string
nodeSelector: null

# [Enterprise Only] This value refers to a Kubernetes or Vault secret that you have created
# that contains your enterprise license. It is required if you are using an
Expand Down

0 comments on commit e5a5a6f

Please sign in to comment.