mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
ee261b8288
cert-manager can be used to automate TLS certificate management for nfd-master and the nfd-worker pod(s). Add a template to deploy cert-manager CA Issuer and Certificates and document steps how to use them. Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
126 lines
3.3 KiB
Text
126 lines
3.3 KiB
Text
# All changes in this template should be applied to Helm chart too.
|
|
#
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: node-feature-discovery # NFD namespace
|
|
---
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: nfd-master
|
|
namespace: node-feature-discovery
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: nfd-master
|
|
rules:
|
|
- apiGroups:
|
|
- ""
|
|
resources:
|
|
- nodes
|
|
# when using command line flag --resource-labels to create extended resources
|
|
# you will need to uncomment "- nodes/status"
|
|
# - nodes/status
|
|
verbs:
|
|
- get
|
|
- patch
|
|
- update
|
|
# List only needed for --prune
|
|
- list
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: nfd-master
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: nfd-master
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: nfd-master
|
|
namespace: node-feature-discovery
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: nfd-master
|
|
name: nfd-master
|
|
namespace: node-feature-discovery
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: nfd-master
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: nfd-master
|
|
spec:
|
|
serviceAccount: nfd-master
|
|
affinity:
|
|
nodeAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 1
|
|
preference:
|
|
matchExpressions:
|
|
- key: "node-role.kubernetes.io/master"
|
|
operator: In
|
|
values: [""]
|
|
tolerations:
|
|
- key: "node-role.kubernetes.io/master"
|
|
operator: "Equal"
|
|
value: ""
|
|
effect: "NoSchedule"
|
|
containers:
|
|
- env:
|
|
- name: NODE_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
|
|
imagePullPolicy: Always
|
|
name: nfd-master
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop: ["ALL"]
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
command:
|
|
- "nfd-master"
|
|
## Enable TLS authentication
|
|
## The example below assumes having a Secret named nfd-master-cert with
|
|
## the TLS authentication credentials and a root certificate named ca.crt created.
|
|
## cert-manager can be used to automate the Secret creation and updates.
|
|
## Additional hardening can be enabled by specifying --verify-node-name in
|
|
## args, in which case every nfd-worker requires a individual node-specific
|
|
## TLS certificate.
|
|
# args:
|
|
# - "--ca-file=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
|
|
# - "--key-file=/etc/kubernetes/node-feature-discovery/certs/tls.key"
|
|
# - "--cert-file=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
|
|
# volumeMounts:
|
|
# - name: nfd-master-cert
|
|
# mountPath: "/etc/kubernetes/node-feature-discovery/certs"
|
|
# readOnly: true
|
|
# volumes:
|
|
# - name: nfd-master-cert
|
|
# secret:
|
|
# secretName: nfd-master-cert
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: nfd-master
|
|
namespace: node-feature-discovery
|
|
spec:
|
|
selector:
|
|
app: nfd-master
|
|
ports:
|
|
- protocol: TCP
|
|
port: 8080
|
|
type: ClusterIP
|