Skip to content

Commit

Permalink
[TT-13934] Add tolerations, affinity and node selector to tyk-bootstr…
Browse files Browse the repository at this point in the history
…ap and tyk-operator (#381)

* Add to values.yaml

* fix spacing

* add to bootstrap

* Add to cp chart

---------

Co-authored-by: Mladen Kolavcic <[email protected]>
  • Loading branch information
zalbiraw and kolavcic authored Feb 27, 2025
1 parent 847e684 commit 0fca9b5
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/tyk-bootstrap/templates/bootstrap-post-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ default "k8s-bootstrap-role" .Values.bootstrap.serviceAccountName | quote }}
{{- if .Values.bootstrap.nodeSelector }}
nodeSelector:
{{ toYaml .Values.bootstrap.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.bootstrap.tolerations }}
tolerations:
{{ toYaml .Values.bootstrap.tolerations | indent 8 }}
{{- end }}
{{- if .Values.bootstrap.affinity }}
affinity:
{{ toYaml .Values.bootstrap.affinity | indent 8 }}
{{- end }}
containers:
- name: bootstrap-tyk-post-install
image: {{ .Values.global.imageRegistry }}{{ .Values.bootstrap.jobs.postInstall.image.repository }}:{{ .Values.bootstrap.jobs.postInstall.image.tag }}
Expand Down
12 changes: 12 additions & 0 deletions components/tyk-bootstrap/templates/bootstrap-pre-delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ default "k8s-bootstrap-role" .Values.bootstrap.serviceAccountName | quote }}
{{- if .Values.bootstrap.nodeSelector }}
nodeSelector:
{{ toYaml .Values.bootstrap.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.bootstrap.tolerations }}
tolerations:
{{ toYaml .Values.bootstrap.tolerations | indent 8 }}
{{- end }}
{{- if .Values.bootstrap.affinity }}
affinity:
{{ toYaml .Values.bootstrap.affinity | indent 8 }}
{{- end }}
containers:
- name: bootstrap-tyk-pre-delete
image: {{ .Values.global.imageRegistry }}{{ .Values.bootstrap.jobs.preDelete.image.repository }}:{{ .Values.bootstrap.jobs.preDelete.image.tag }}
Expand Down
12 changes: 12 additions & 0 deletions components/tyk-bootstrap/templates/bootstrap-pre-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ default "k8s-bootstrap-role" .Values.bootstrap.serviceAccountName | quote }}
{{- if .Values.bootstrap.nodeSelector }}
nodeSelector:
{{ toYaml .Values.bootstrap.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.bootstrap.tolerations }}
tolerations:
{{ toYaml .Values.bootstrap.tolerations | indent 8 }}
{{- end }}
{{- if .Values.bootstrap.affinity }}
affinity:
{{ toYaml .Values.bootstrap.affinity | indent 8 }}
{{- end }}
containers:
- name: bootstrap-tyk-pre-install
image: {{ .Values.global.imageRegistry }}{{ .Values.bootstrap.jobs.preInstall.image.repository }}:{{ .Values.bootstrap.jobs.preInstall.image.tag }}
Expand Down
9 changes: 9 additions & 0 deletions components/tyk-bootstrap/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ bootstrap:
# preDeletePodLabels specifies labels to be added to Tyk Bootstrap pre-delete hook's job pods.
preDeletePodLabels: {}

# node labels for bootstrap pods assignment
nodeSelector: {}

# tolerations for bootstrap pods assignment
tolerations: {}

# affinity for bootstrap pods assignment
affinity: {}

# containerSecurityContext values for bootstrap containers
containerSecurityContext:
runAsNonRoot: true
Expand Down
14 changes: 14 additions & 0 deletions tyk-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,11 @@ tyk-operator:
allowPrivilegeEscalation: false
resources: {}
nodeSelector: {}
# tolerations for tyk-operator-manager pod assignment
tolerations: {}

# affinity for tyk-operator-manager pod assignment
affinity: {}
hostNetwork: false

# rbac specifies necessary resources for kube-rbac-proxy.
Expand Down Expand Up @@ -1092,6 +1097,15 @@ tyk-bootstrap:
# preDeletePodLabels specifies labels to be added to Tyk Bootstrap pre-delete hook's job pods.
preDeletePodLabels: {}

# node labels for bootstrap pods assignment
nodeSelector: {}

# tolerations for bootstrap pods assignment
tolerations: {}

# affinity for bootstrap pods assignment
affinity: {}

# extraVolumes is a list of volumes to be added to the pod
# extraVolumes:
# - name: ca-certs
Expand Down
5 changes: 5 additions & 0 deletions tyk-oss/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ tyk-operator:
allowPrivilegeEscalation: false
resources: {}
nodeSelector: {}
# tolerations for tyk-operator-manager pod assignment
tolerations: {}

# affinity for tyk-operator-manager pod assignment
affinity: {}
hostNetwork: false

# rbac specifies necessary resources for kube-rbac-proxy.
Expand Down
14 changes: 14 additions & 0 deletions tyk-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,11 @@ tyk-operator:
allowPrivilegeEscalation: false
resources: {}
nodeSelector: {}
# tolerations for tyk-operator-manager pod assignment
tolerations: {}

# affinity for tyk-operator-manager pod assignment
affinity: {}
hostNetwork: false

# rbac specifies necessary resources for kube-rbac-proxy.
Expand Down Expand Up @@ -1105,6 +1110,15 @@ tyk-bootstrap:
# preDeletePodLabels specifies labels to be added to Tyk Bootstrap pre-delete hook's job pods.
preDeletePodLabels: {}

# node labels for bootstrap pods assignment
nodeSelector: {}

# tolerations for bootstrap pods assignment
tolerations: {}

# affinity for bootstrap pods assignment
affinity: {}

# extraVolumes is a list of volumes to be added to the pod
# extraVolumes:
# - name: ca-certs
Expand Down

0 comments on commit 0fca9b5

Please sign in to comment.