Skip to content

Commit

Permalink
Add toleration support
Browse files Browse the repository at this point in the history
  • Loading branch information
NEwa-05 authored Jun 19, 2023
1 parent 0af41ab commit 502ee88
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 1 deletion.
2 changes: 1 addition & 1 deletion traefikee/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: traefikee
version: 1.13.0
version: 1.14.0
appVersion: v2.10.1
# Because of https://github.com/helm/helm/issues/3810 the pre-release version suffix has to be define.
# This allows the installation on Kubernetes cluster with a pre-release version (e.g. v1.19.9-gke.1900)
Expand Down
4 changes: 4 additions & 0 deletions traefikee/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ spec:
affinity:
{{- tpl (toYaml .Values.proxy.affinity) . | nindent 8 }}
{{- end }}
{{- if .Values.proxy.tolerations }}
tolerations:
{{- tpl (toYaml .Values.proxy.tolerations) . | nindent 8 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Expand Down
8 changes: 8 additions & 0 deletions traefikee/templates/stateful-sets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
affinity:
{{- tpl (toYaml .Values.registry.affinity) . | nindent 8 }}
{{- end }}
{{- if .Values.registry.tolerations }}
tolerations:
{{- tpl (toYaml .Values.registry.tolerations) . | nindent 8 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Expand Down Expand Up @@ -203,6 +207,10 @@ spec:
affinity:
{{- tpl (toYaml .Values.controller.affinity) . | nindent 8 }}
{{- end }}
{{- if .Values.controller.tolerations }}
tolerations:
{{- tpl (toYaml .Values.controller.tolerations) . | nindent 8 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Expand Down
52 changes: 52 additions & 0 deletions traefikee/tests/controller_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,55 @@ tests:
cpu: "300m"
memory: "150Mi"
documentIndex: 2
- it: should not set tolerations by default
asserts:
- isNull:
path: spec.template.spec.tolerations
- it: should be possible to set tolerations for controller
set:
controller:
tolerations:
- key: "testkey"
operator: "Equal"
value: "testvalue"
effect: "NoSchedule"
- key: "RSA"
operator: "Destructor"
documentIndex: 2
asserts:
- contains:
path: spec.template.spec.tolerations
content:
key: "testkey"
operator: "Equal"
value: "testvalue"
effect: "NoSchedule"
- contains:
path: spec.template.spec.tolerations
content:
key: "RSA"
operator: "Destructor"
- it: should be possible to set tolerations for registry
set:
registry:
tolerations:
- key: "testkey"
operator: "Equal"
value: "testvalue"
effect: "NoSchedule"
- key: "RSA"
operator: "Destructor"
documentIndex: 1
asserts:
- contains:
path: spec.template.spec.tolerations
content:
key: "testkey"
operator: "Equal"
value: "testvalue"
effect: "NoSchedule"
- contains:
path: spec.template.spec.tolerations
content:
key: "RSA"
operator: "Destructor"
27 changes: 27 additions & 0 deletions traefikee/tests/proxy_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,33 @@ tests:
maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
- it: should not set tolerations by default
asserts:
- isNull:
path: spec.template.spec.tolerations
- it: should be possible to set tolerations
set:
proxy:
tolerations:
- key: "testkey"
operator: "Equal"
value: "testvalue"
effect: "NoSchedule"
- key: "RSA"
operator: "Destructor"
asserts:
- contains:
path: spec.template.spec.tolerations
content:
key: "testkey"
operator: "Equal"
value: "testvalue"
effect: "NoSchedule"
- contains:
path: spec.template.spec.tolerations
content:
key: "RSA"
operator: "Destructor"
---
suite: proxy service test
templates:
Expand Down
6 changes: 6 additions & 0 deletions traefikee/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ registry:
# namespace: othernamespace
## Set the registry token directly in Values
# tokenSecret: "NJ00yx60K+Wm1yufuBM6fLq3fVKcv44RvBsVGiH40+U="
## Tolerations allow the scheduler to schedule pods with matching taints.
tolerations: []


controller:
Expand Down Expand Up @@ -118,6 +120,8 @@ controller:
# secretKeyRef:
# name: foo
# key: BAR
## Tolerations allow the scheduler to schedule pods with matching taints.
tolerations: []

proxy:
replicas: 2
Expand Down Expand Up @@ -200,6 +204,8 @@ proxy:
# maxSkew: 1
# topologyKey: kubernetes.io/hostname
# whenUnsatisfiable: DoNotSchedule
## Tolerations allow the scheduler to schedule pods with matching taints.
tolerations: []

# priorityClassName will be set on all pods.
priorityClassName: ""
Expand Down

0 comments on commit 502ee88

Please sign in to comment.