mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-31 04:04:51 +00:00
kustomize: add standard-combined overlay
Replicates nfd-daemonset-combined.yaml.template. In addition to the overlay we need to add a separate set of patches under components/common in order to handle the double-container pod.
This commit is contained in:
parent
b38cf997d5
commit
1f8a6d7819
8 changed files with 157 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
namespace: node-feature-discovery
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- master-worker-daemonset.yaml
|
|
@ -0,0 +1,29 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nfd
|
||||||
|
name: nfd
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nfd
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nfd
|
||||||
|
spec:
|
||||||
|
serviceAccount: nfd-master
|
||||||
|
tolerations: []
|
||||||
|
containers:
|
||||||
|
- name: nfd-master
|
||||||
|
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command:
|
||||||
|
- "nfd-master"
|
||||||
|
- name: nfd-worker
|
||||||
|
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command:
|
||||||
|
- "nfd-worker"
|
||||||
|
args: []
|
14
deployment/components/common/env-combined.yaml
Normal file
14
deployment/components/common/env-combined.yaml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
- op: add
|
||||||
|
path: "/spec/template/spec/containers/0/env"
|
||||||
|
value:
|
||||||
|
- name: NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
- op: add
|
||||||
|
path: "/spec/template/spec/containers/1/env"
|
||||||
|
value:
|
||||||
|
- name: NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
|
@ -18,3 +18,20 @@ patches:
|
||||||
target:
|
target:
|
||||||
labelSelector: app=nfd
|
labelSelector: app=nfd
|
||||||
name: nfd-worker
|
name: nfd-worker
|
||||||
|
# We need separate patches for the "combined" daemonset with two containers in the pod :/
|
||||||
|
- path: env-combined.yaml
|
||||||
|
target:
|
||||||
|
labelSelector: app=nfd
|
||||||
|
name: nfd
|
||||||
|
- path: securitycontext-combined.yaml
|
||||||
|
target:
|
||||||
|
labelSelector: app=nfd
|
||||||
|
name: nfd
|
||||||
|
- path: master-affinity.yaml
|
||||||
|
target:
|
||||||
|
labelSelector: app=nfd
|
||||||
|
name: nfd
|
||||||
|
- path: worker-mounts-combined.yaml
|
||||||
|
target:
|
||||||
|
labelSelector: app=nfd
|
||||||
|
name: nfd
|
||||||
|
|
16
deployment/components/common/securitycontext-combined.yaml
Normal file
16
deployment/components/common/securitycontext-combined.yaml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
- op: add
|
||||||
|
path: "/spec/template/spec/containers/0/securityContext"
|
||||||
|
value:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop: ["ALL"]
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
runAsNonRoot: true
|
||||||
|
- op: add
|
||||||
|
path: "/spec/template/spec/containers/1/securityContext"
|
||||||
|
value:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop: ["ALL"]
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
runAsNonRoot: true
|
55
deployment/components/common/worker-mounts-combined.yaml
Normal file
55
deployment/components/common/worker-mounts-combined.yaml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
- op: add
|
||||||
|
path: /spec/template/spec/volumes
|
||||||
|
value:
|
||||||
|
- name: host-boot
|
||||||
|
hostPath:
|
||||||
|
path: "/boot"
|
||||||
|
- name: host-os-release
|
||||||
|
hostPath:
|
||||||
|
path: "/etc/os-release"
|
||||||
|
- name: host-sys
|
||||||
|
hostPath:
|
||||||
|
path: "/sys"
|
||||||
|
- name: host-usr-lib
|
||||||
|
hostPath:
|
||||||
|
path: "/usr/lib"
|
||||||
|
- name: host-usr-src
|
||||||
|
hostPath:
|
||||||
|
path: "/usr/src"
|
||||||
|
- name: source-d
|
||||||
|
hostPath:
|
||||||
|
path: "/etc/kubernetes/node-feature-discovery/source.d/"
|
||||||
|
- name: features-d
|
||||||
|
hostPath:
|
||||||
|
path: "/etc/kubernetes/node-feature-discovery/features.d/"
|
||||||
|
- name: nfd-worker-conf
|
||||||
|
configMap:
|
||||||
|
name: nfd-worker-conf
|
||||||
|
|
||||||
|
- op: add
|
||||||
|
path: /spec/template/spec/containers/1/volumeMounts
|
||||||
|
value:
|
||||||
|
- name: host-boot
|
||||||
|
mountPath: "/host-boot"
|
||||||
|
readOnly: true
|
||||||
|
- name: host-os-release
|
||||||
|
mountPath: "/host-etc/os-release"
|
||||||
|
readOnly: true
|
||||||
|
- name: host-sys
|
||||||
|
mountPath: "/host-sys"
|
||||||
|
readOnly: true
|
||||||
|
- name: host-usr-lib
|
||||||
|
mountPath: "/host-usr/lib"
|
||||||
|
readOnly: true
|
||||||
|
- name: host-usr-src
|
||||||
|
mountPath: "/host-usr/src"
|
||||||
|
readOnly: true
|
||||||
|
- name: source-d
|
||||||
|
mountPath: "/etc/kubernetes/node-feature-discovery/source.d/"
|
||||||
|
readOnly: true
|
||||||
|
- name: features-d
|
||||||
|
mountPath: "/etc/kubernetes/node-feature-discovery/features.d/"
|
||||||
|
readOnly: true
|
||||||
|
- name: nfd-worker-conf
|
||||||
|
mountPath: "/etc/kubernetes/node-feature-discovery"
|
||||||
|
readOnly: true
|
15
deployment/overlays/default-combined/kustomization.yaml
Normal file
15
deployment/overlays/default-combined/kustomization.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
namespace: node-feature-discovery
|
||||||
|
|
||||||
|
bases:
|
||||||
|
- ../../base/rbac
|
||||||
|
- ../../base/master-worker-combined
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
|
||||||
|
components:
|
||||||
|
- ../../components/worker-config
|
||||||
|
- ../../components/common
|
4
deployment/overlays/default-combined/namespace.yaml
Normal file
4
deployment/overlays/default-combined/namespace.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: node-feature-discovery
|
Loading…
Add table
Reference in a new issue