generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable automated Prune via CRD NodeFeatureDiscoveries
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
- Loading branch information
1 parent
e736b48
commit 00b2e3c
Showing
11 changed files
with
317 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: nfd-prune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: nfd-prune | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- list | ||
- list | ||
- apiGroups: | ||
- nfd.k8s-sigs.io | ||
resources: | ||
- nodefeatures | ||
- nodefeaturerules | ||
verbs: | ||
- get | ||
- list | ||
- watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: nfd-prune | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: nfd-master | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nfd-master | ||
namespace: node-feature-discovery-operator | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
labels: | ||
app: nfd | ||
name: nfd-prune | ||
spec: | ||
completions: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: nfd-prune | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- preference: | ||
matchExpressions: | ||
- key: node-role.kubernetes.io/master | ||
operator: In | ||
values: | ||
- "" | ||
weight: 1 | ||
- preference: | ||
matchExpressions: | ||
- key: node-role.kubernetes.io/control-plane | ||
operator: In | ||
values: | ||
- "" | ||
weight: 1 | ||
containers: | ||
- args: | ||
- -prune | ||
command: | ||
- nfd-master | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
image: $(NODE_FEATURE_DISCOVERY_IMAGE) | ||
imagePullPolicy: Always | ||
name: nfd-master | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
restartPolicy: Never | ||
serviceAccount: nfd-master | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Equal | ||
value: "" | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/control-plane | ||
operator: Equal | ||
value: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.