Skip to content

Commit fc0bf18

Browse files
authored
Merge pull request #2148 from jcpunk/pdb
helm: Add optional PodDisruptionBudget
2 parents e289f4c + fe4a83f commit fc0bf18

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if .Values.master.enable }}
2+
{{- if .Values.master.podDisruptionBudget.enable -}}
3+
apiVersion: policy/v1
4+
kind: PodDisruptionBudget
5+
metadata:
6+
name: {{ include "node-feature-discovery.fullname" . }}-master
7+
namespace: {{ include "node-feature-discovery.namespace" . }}
8+
labels:
9+
{{- include "node-feature-discovery.labels" . | nindent 4 }}
10+
spec:
11+
selector:
12+
matchLabels:
13+
{{- include "node-feature-discovery.selectorLabels" . | nindent 6 }}
14+
role: master
15+
{{- toYaml (omit .Values.master.podDisruptionBudget "enable") | indent 2 }}
16+
{{- end }}
17+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if .Values.gc.enable }}
2+
{{- if .Values.gc.podDisruptionBudget.enable -}}
3+
apiVersion: policy/v1
4+
kind: PodDisruptionBudget
5+
metadata:
6+
name: {{ include "node-feature-discovery.fullname" . }}-gc
7+
namespace: {{ include "node-feature-discovery.namespace" . }}
8+
labels:
9+
{{- include "node-feature-discovery.labels" . | nindent 4 }}
10+
spec:
11+
selector:
12+
matchLabels:
13+
{{- include "node-feature-discovery.selectorLabels" . | nindent 6 }}
14+
role: gc
15+
{{- toYaml (omit .Values.gc.podDisruptionBudget "enable") | indent 2 }}
16+
{{- end }}
17+
{{- end }}

deployment/helm/node-feature-discovery/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ master:
126126
value: ""
127127
effect: "NoSchedule"
128128

129+
podDisruptionBudget:
130+
enable: false
131+
minAvailable: 1
132+
unhealthyPodEvictionPolicy: AlwaysAllow
133+
129134
annotations: {}
130135

131136
affinity:
@@ -568,6 +573,11 @@ gc:
568573
deploymentAnnotations: {}
569574
affinity: {}
570575

576+
podDisruptionBudget:
577+
enable: false
578+
minAvailable: 1
579+
unhealthyPodEvictionPolicy: Always
580+
571581
# specify how many old ReplicaSets for the Deployment to retain.
572582
revisionHistoryLimit:
573583

docs/deployment/helm.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ API's you need to install the prometheus operator in your cluster.
191191
| `master.rbac.create` | bool | true | Specifies whether to create [RBAC][rbac] configuration for nfd-master |
192192
| `master.resources.limits` | dict | {memory: 4Gi} | NFD master pod [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
193193
| `master.resources.requests` | dict | {cpu: 100m, memory: 128Mi} | NFD master pod [resources requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits). See `[0]` for more info |
194+
| `master.podDisruptionBudget.enable` | bool | false | Specifies whether to create a podDisruptionBudget configuration for nfd-master |
195+
| `master.podDisruptionBudget.minAvailable` | integer | 1 | Specifies minAvailable for the podDisruptionBudget configuration for nfd-master |
196+
| `master.podDisruptionBudget.maxUnavailable` | integer | NULL | Specifies maxUnavailable for the podDisruptionBudget configuration for nfd-master |
197+
| `master.podDisruptionBudget.unhealthyPodEvictionPolicy` | string | AlwaysAllow | Specifies unhealthyPodEvictionPolicy for the podDisruptionBudget configuration for nfd-master |
194198
| `master.tolerations` | dict | _Schedule to control-plane node_ | NFD master pod [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
195199
| `master.annotations` | dict | {} | NFD master pod [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
196200
| `master.affinity` | dict | | NFD master pod required [node affinity](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |
@@ -321,6 +325,10 @@ API's you need to install the prometheus operator in your cluster.
321325
| `gc.podSecurityContext` | dict | {} | [PodSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) holds pod-level security attributes and common container settings |
322326
| `gc.resources.limits` | dict | {memory: 1Gi} | NFD Garbage Collector pod [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
323327
| `gc.resources.requests` | dict | {cpu: 10m, memory: 128Mi} | NFD Garbage Collector pod [resources requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
328+
| `gc.podDisruptionBudget.enable` | bool | false | Specifies whether to create a podDisruptionBudget configuration for nfd-gc |
329+
| `gc.podDisruptionBudget.minAvailable` | integer | 1 | Specifies minAvailable for the podDisruptionBudget configuration for nfd-gc |
330+
| `gc.podDisruptionBudget.maxUnavailable` | integer | NULL | Specifies maxUnavailable for the podDisruptionBudget configuration for nfd-gc |
331+
| `gc.podDisruptionBudget.unhealthyPodEvictionPolicy` | string | AlwaysAllow | Specifies unhealthyPodEvictionPolicy for the podDisruptionBudget configuration for nfd-gc |
324332
| `gc.metricsPort` | integer | 8081 | Port on which to serve Prometheus metrics. **DEPRECATED**: will be replaced by `gc.port` in NFD v0.18. |
325333
| `gc.nodeSelector` | dict | {} | Garbage collector pod [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) |
326334
| `gc.tolerations` | dict | {} | Garbage collector pod [node tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |

0 commit comments

Comments
 (0)