Skip to content

Commit a2ae7a5

Browse files
Adding Tolerations fields to the NFD CRD
Currently, while deploying operand only, user can specify tolerations for both master depoyment and worker daemonsets. We want to add this functionlity to operator deployment also, using dedicated fields in the CRD
1 parent 943c7e4 commit a2ae7a5

File tree

3 files changed

+106
-1
lines changed

3 files changed

+106
-1
lines changed

api/v1/nodefeaturediscovery_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ type OperandSpec struct {
9595
// listens for incoming requests.
9696
// +kubebuilder:validation:Optional
9797
ServicePort int `json:"servicePort"`
98+
99+
// WorkerTolerations defines tolerations to be applied to the worker Daemonset
100+
WorkerTolerations []corev1.Toleration `json:"workerTolerations,omitempty"`
101+
102+
// MasterTolerations defines tolerations to be applied to the master deployment
103+
MasterTolerations []corev1.Toleration `json:"masterTolerations,omitempty"`
98104
}
99105

100106
// ConfigMap describes configuration options for the NFD worker

api/v1/zz_generated.deepcopy.go

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/nfd.kubernetes.io_nodefeaturediscoveries.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,94 @@ spec:
7272
description: ImagePullPolicy defines Image pull policy for the
7373
NFD operand image [defaults to Always]
7474
type: string
75+
masterTolerations:
76+
description: MasterTolerations defines tolerations to be applied
77+
to the master deployment
78+
items:
79+
description: The pod this Toleration is attached to tolerates
80+
any taint that matches the triple <key,value,effect> using
81+
the matching operator <operator>.
82+
properties:
83+
effect:
84+
description: Effect indicates the taint effect to match.
85+
Empty means match all taint effects. When specified, allowed
86+
values are NoSchedule, PreferNoSchedule and NoExecute.
87+
type: string
88+
key:
89+
description: Key is the taint key that the toleration applies
90+
to. Empty means match all taint keys. If the key is empty,
91+
operator must be Exists; this combination means to match
92+
all values and all keys.
93+
type: string
94+
operator:
95+
description: Operator represents a key's relationship to
96+
the value. Valid operators are Exists and Equal. Defaults
97+
to Equal. Exists is equivalent to wildcard for value,
98+
so that a pod can tolerate all taints of a particular
99+
category.
100+
type: string
101+
tolerationSeconds:
102+
description: TolerationSeconds represents the period of
103+
time the toleration (which must be of effect NoExecute,
104+
otherwise this field is ignored) tolerates the taint.
105+
By default, it is not set, which means tolerate the taint
106+
forever (do not evict). Zero and negative values will
107+
be treated as 0 (evict immediately) by the system.
108+
format: int64
109+
type: integer
110+
value:
111+
description: Value is the taint value the toleration matches
112+
to. If the operator is Exists, the value should be empty,
113+
otherwise just a regular string.
114+
type: string
115+
type: object
116+
type: array
75117
servicePort:
76118
description: ServicePort specifies the TCP port that nfd-master
77119
listens for incoming requests.
78120
type: integer
121+
workerTolerations:
122+
description: WorkerTolerations defines tolerations to be applied
123+
to the worker Daemonset
124+
items:
125+
description: The pod this Toleration is attached to tolerates
126+
any taint that matches the triple <key,value,effect> using
127+
the matching operator <operator>.
128+
properties:
129+
effect:
130+
description: Effect indicates the taint effect to match.
131+
Empty means match all taint effects. When specified, allowed
132+
values are NoSchedule, PreferNoSchedule and NoExecute.
133+
type: string
134+
key:
135+
description: Key is the taint key that the toleration applies
136+
to. Empty means match all taint keys. If the key is empty,
137+
operator must be Exists; this combination means to match
138+
all values and all keys.
139+
type: string
140+
operator:
141+
description: Operator represents a key's relationship to
142+
the value. Valid operators are Exists and Equal. Defaults
143+
to Equal. Exists is equivalent to wildcard for value,
144+
so that a pod can tolerate all taints of a particular
145+
category.
146+
type: string
147+
tolerationSeconds:
148+
description: TolerationSeconds represents the period of
149+
time the toleration (which must be of effect NoExecute,
150+
otherwise this field is ignored) tolerates the taint.
151+
By default, it is not set, which means tolerate the taint
152+
forever (do not evict). Zero and negative values will
153+
be treated as 0 (evict immediately) by the system.
154+
format: int64
155+
type: integer
156+
value:
157+
description: Value is the taint value the toleration matches
158+
to. If the operator is Exists, the value should be empty,
159+
otherwise just a regular string.
160+
type: string
161+
type: object
162+
type: array
79163
type: object
80164
prunerOnDelete:
81165
description: PruneOnDelete defines whether the NFD-master prune should

0 commit comments

Comments
 (0)