Skip to content

Commit fb27e29

Browse files
authored
Merge pull request #237 from chr15p/master-taints-fix2
add enableTaints option to enable taint support in the crd
2 parents 3788dca + b05bade commit fb27e29

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed

api/v1/nodefeaturediscovery_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ type NodeFeatureDiscoverySpec struct {
7070
// as annotations, extended resources and taints) from the cluster nodes.
7171
// +optional
7272
PruneOnDelete bool `json:"prunerOnDelete"`
73+
74+
// EnableTaints enables the enable the experimental tainting feature
75+
// This allows keeping nodes with specialized hardware away from running general workload i
76+
// and instead leave them for workloads that need the specialized hardware.
77+
// +optional
78+
EnableTaints bool `json:"enableTaints"`
7379
}
7480

7581
// OperandSpec describes configuration options for the operand

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ spec:
3636
spec:
3737
description: NodeFeatureDiscoverySpec defines the desired state of NodeFeatureDiscovery
3838
properties:
39+
enableTaints:
40+
description: EnableTaints enables the enable the experimental tainting
41+
feature This allows keeping nodes with specialized hardware away
42+
from running general workload i and instead leave them for workloads
43+
that need the specialized hardware.
44+
type: boolean
3945
extraLabelNs:
4046
description: ExtraLabelNs defines the list of of allowed extra label
4147
namespaces By default, only allow labels in the default `feature.node.kubernetes.io`

config/samples/nfd.kubernetes.io_v1_nodefeaturediscovery.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ metadata:
55
namespace: node-feature-discovery-operator
66
spec:
77
instance: "" # instance is empty by default
8+
## NOTE: Taints support is experimental.
9+
#enableTaints: true
810
#labelWhiteList: ""
911
#extraLabelNs:
1012
# - "example.com"

deploy/helm/nfd-operator/crds/nfd-api-crds.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ spec:
3737
spec:
3838
description: NodeFeatureDiscoverySpec defines the desired state of NodeFeatureDiscovery
3939
properties:
40+
enableTaints:
41+
description: EnableTaints enables the enable the experimental tainting
42+
feature This allows keeping nodes with specialized hardware away
43+
from running general workload i and instead leave them for workloads
44+
that need the specialized hardware.
45+
type: boolean
4046
extraLabelNs:
4147
description: ExtraLabelNs defines the list of of allowed extra label
4248
namespaces By default, only allow labels in the default `feature.node.kubernetes.io`
@@ -691,4 +697,4 @@ spec:
691697
- spec
692698
type: object
693699
served: true
694-
storage: true
700+
storage: true

internal/deployment/deployment.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ func getArgs(nfdInstance *nfdv1.NodeFeatureDiscovery) []string {
224224
args = append(args, fmt.Sprintf("--label-whitelist=%s", nfdInstance.Spec.LabelWhiteList))
225225
}
226226

227+
if nfdInstance.Spec.EnableTaints {
228+
args = append(args, "--enable-taints")
229+
}
230+
227231
return args
228232
}
229233

0 commit comments

Comments
 (0)