Skip to content

Commit

Permalink
Merge pull request #237 from chr15p/master-taints-fix2
Browse files Browse the repository at this point in the history
add enableTaints option to enable taint support in the crd
  • Loading branch information
k8s-ci-robot authored Jun 6, 2024
2 parents 3788dca + b05bade commit fb27e29
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api/v1/nodefeaturediscovery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ type NodeFeatureDiscoverySpec struct {
// as annotations, extended resources and taints) from the cluster nodes.
// +optional
PruneOnDelete bool `json:"prunerOnDelete"`

// EnableTaints enables the enable the experimental tainting feature
// This allows keeping nodes with specialized hardware away from running general workload i
// and instead leave them for workloads that need the specialized hardware.
// +optional
EnableTaints bool `json:"enableTaints"`
}

// OperandSpec describes configuration options for the operand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ spec:
spec:
description: NodeFeatureDiscoverySpec defines the desired state of NodeFeatureDiscovery
properties:
enableTaints:
description: EnableTaints enables the enable the experimental tainting
feature This allows keeping nodes with specialized hardware away
from running general workload i and instead leave them for workloads
that need the specialized hardware.
type: boolean
extraLabelNs:
description: ExtraLabelNs defines the list of of allowed extra label
namespaces By default, only allow labels in the default `feature.node.kubernetes.io`
Expand Down
2 changes: 2 additions & 0 deletions config/samples/nfd.kubernetes.io_v1_nodefeaturediscovery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
namespace: node-feature-discovery-operator
spec:
instance: "" # instance is empty by default
## NOTE: Taints support is experimental.
#enableTaints: true
#labelWhiteList: ""
#extraLabelNs:
# - "example.com"
Expand Down
8 changes: 7 additions & 1 deletion deploy/helm/nfd-operator/crds/nfd-api-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ spec:
spec:
description: NodeFeatureDiscoverySpec defines the desired state of NodeFeatureDiscovery
properties:
enableTaints:
description: EnableTaints enables the enable the experimental tainting
feature This allows keeping nodes with specialized hardware away
from running general workload i and instead leave them for workloads
that need the specialized hardware.
type: boolean
extraLabelNs:
description: ExtraLabelNs defines the list of of allowed extra label
namespaces By default, only allow labels in the default `feature.node.kubernetes.io`
Expand Down Expand Up @@ -691,4 +697,4 @@ spec:
- spec
type: object
served: true
storage: true
storage: true
4 changes: 4 additions & 0 deletions internal/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ func getArgs(nfdInstance *nfdv1.NodeFeatureDiscovery) []string {
args = append(args, fmt.Sprintf("--label-whitelist=%s", nfdInstance.Spec.LabelWhiteList))
}

if nfdInstance.Spec.EnableTaints {
args = append(args, "--enable-taints")
}

return args
}

Expand Down

0 comments on commit fb27e29

Please sign in to comment.