Skip to content

Commit 50885d0

Browse files
committed
feat: add tolerations to helm chart
1 parent a5fec66 commit 50885d0

6 files changed

Lines changed: 100 additions & 0 deletions

File tree

chart/crds/overcommit.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,44 @@ spec:
6060
overcommitLabel:
6161
minLength: 1
6262
type: string
63+
tolerations:
64+
items:
65+
description: |-
66+
The pod this Toleration is attached to tolerates any taint that matches
67+
the triple <key,value,effect> using the matching operator <operator>.
68+
properties:
69+
effect:
70+
description: |-
71+
Effect indicates the taint effect to match. Empty means match all taint effects.
72+
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
73+
type: string
74+
key:
75+
description: |-
76+
Key is the taint key that the toleration applies to. Empty means match all taint keys.
77+
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
78+
type: string
79+
operator:
80+
description: |-
81+
Operator represents a key's relationship to the value.
82+
Valid operators are Exists and Equal. Defaults to Equal.
83+
Exists is equivalent to wildcard for value, so that a pod can
84+
tolerate all taints of a particular category.
85+
type: string
86+
tolerationSeconds:
87+
description: |-
88+
TolerationSeconds represents the period of time the toleration (which must be
89+
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
90+
it is not set, which means tolerate the taint forever (do not evict). Zero and
91+
negative values will be treated as 0 (evict immediately) by the system.
92+
format: int64
93+
type: integer
94+
value:
95+
description: |-
96+
Value is the taint value the toleration matches to.
97+
If the operator is Exists, the value should be empty, otherwise just a regular string.
98+
type: string
99+
type: object
100+
type: array
63101
required:
64102
- overcommitLabel
65103
type: object

chart/crds/overcommitClass.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,44 @@ spec:
8181
maximum: 1
8282
minimum: 0.0001
8383
type: number
84+
tolerations:
85+
items:
86+
description: |-
87+
The pod this Toleration is attached to tolerates any taint that matches
88+
the triple <key,value,effect> using the matching operator <operator>.
89+
properties:
90+
effect:
91+
description: |-
92+
Effect indicates the taint effect to match. Empty means match all taint effects.
93+
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
94+
type: string
95+
key:
96+
description: |-
97+
Key is the taint key that the toleration applies to. Empty means match all taint keys.
98+
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
99+
type: string
100+
operator:
101+
description: |-
102+
Operator represents a key's relationship to the value.
103+
Valid operators are Exists and Equal. Defaults to Equal.
104+
Exists is equivalent to wildcard for value, so that a pod can
105+
tolerate all taints of a particular category.
106+
type: string
107+
tolerationSeconds:
108+
description: |-
109+
TolerationSeconds represents the period of time the toleration (which must be
110+
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
111+
it is not set, which means tolerate the taint forever (do not evict). Zero and
112+
negative values will be treated as 0 (evict immediately) by the system.
113+
format: int64
114+
type: integer
115+
value:
116+
description: |-
117+
Value is the taint value the toleration matches to.
118+
If the operator is Exists, the value should be empty, otherwise just a regular string.
119+
type: string
120+
type: object
121+
type: array
84122
required:
85123
- cpuOvercommit
86124
- excludedNamespaces

chart/templates/02-overcommit.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ spec:
1414
example.com/label: "true"
1515
annotations:
1616
example.com/annotation: "true"
17+
{{- if .Values.overcommit.tolerations }}
18+
tolerations:
19+
{{- toYaml .Values.overcommit.tolerations | nindent 4 }}
20+
{{- end }}
1721
{{ end }}

chart/templates/03-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ spec:
6060
limits:
6161
memory: {{ $.Values.deployment.resources.limits.memory }}
6262
cpu: {{ $.Values.deployment.resources.limits.cpu }}
63+
{{- if .Values.deployment.tolerations }}
64+
tolerations:
65+
{{- toYaml .Values.deployment.tolerations | nindent 8 }}
66+
{{- end }}

chart/templates/04-overcommitClass.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ spec:
1818
example.com/label: "true"
1919
annotations:
2020
example.com/annotation: "true"
21+
{{- if .Values.overcommit.tolerations }}
22+
tolerations:
23+
{{- toYaml .Values.overcommit.tolerations | nindent 4 }}
24+
{{- end }}
2125
---
2226
apiVersion: overcommit.inditex.dev/v1alphav1
2327
kind: OvercommitClass
@@ -32,4 +36,8 @@ spec:
3236
example.com/label: "true"
3337
annotations:
3438
example.com/annotation: "true"
39+
{{- if .Values.overcommit.tolerations }}
40+
tolerations:
41+
{{- toYaml .Values.overcommit.tolerations | nindent 4 }}
42+
{{- end }}
3543
{{- end }}

chart/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ namespace: k8s-overcommit
1010
createNamespace: true
1111
createOvercommit: false
1212
createClasses: false
13+
14+
# -- Configuration for the Overcommit controllers
1315
overcommit:
1416
# -- Label of the overcommit class
1517
overcommitClassLabel: inditex.com/overcommit-class
1618
excludedNamespaces: ".*(^(openshift|k8s-overcommit|kube).*).*"
19+
# -- Tolerations for the deployments created by the overcommit operator
20+
tolerations: []
1721

22+
# -- Controller deployment configuration
1823
deployment:
1924
# -- Number of replicas for the deployment
2025
replicas: 1
@@ -41,5 +46,8 @@ deployment:
4146
example-annotation: example-value
4247
podLabels:
4348
example-label: example-value
49+
# -- Tolerations for the deployment pods
50+
tolerations: []
51+
4452
serviceAccount:
4553
name: overcommit-sa

0 commit comments

Comments
 (0)