diff --git a/README.md b/README.md index 7abd82418..cd4789b13 100644 --- a/README.md +++ b/README.md @@ -460,8 +460,17 @@ If you want to use the latest development version (master branch) you need to #### nfd-master -Nfd-master runs as a DaemonSet, by default in the master node(s) -only. You can use the template spec provided to deploy nfd-master, or +Nfd-master runs as a deployment (with a replica count of 1), by default +it prefers running on the cluster's master nodes but will run on worker +nodes if no master nodes are found. + +For High Availability, you should simply increase the replica count of +the deployment object. You should also look into adding [inter-pod](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) +affinity to prevent masters from running on the same node. +However note that inter-pod affinity is costly and is not recommended +in bigger clusters. + +You can use the template spec provided to deploy nfd-master, or use `nfd-master.yaml` generated by `Makefile`. The latter includes `image:` and `namespace:` definitions that match the latest built image. Example: diff --git a/nfd-master.yaml.template b/nfd-master.yaml.template index 3d3968bf3..59ef65252 100644 --- a/nfd-master.yaml.template +++ b/nfd-master.yaml.template @@ -37,13 +37,14 @@ subjects: namespace: node-feature-discovery --- apiVersion: apps/v1 -kind: DaemonSet +kind: Deployment metadata: labels: app: nfd-master name: nfd-master namespace: node-feature-discovery spec: + replicas: 1 selector: matchLabels: app: nfd-master @@ -53,8 +54,15 @@ spec: app: nfd-master spec: serviceAccount: nfd-master - nodeSelector: - node-role.kubernetes.io/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"