Skip to content

Commit

Permalink
Add Pod Disruption Budget and configurable deployment name
Browse files Browse the repository at this point in the history
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
  • Loading branch information
omerap12 committed Jul 7, 2024
1 parent b86f12c commit a943df0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: efs-csi-controller
name: {{ .Values.controller.name }}
labels:
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
{{- with .Values.controller.additionalLabels }}
Expand All @@ -13,7 +13,7 @@ spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: efs-csi-controller
app: {{ .Values.controller.name }}
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.controller.updateStrategy }}
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
labels:
app: efs-csi-controller
app: {{ .Values.controller.name }}
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.controller.podLabels }}
Expand Down
19 changes: 19 additions & 0 deletions charts/aws-efs-csi-driver/templates/controller-pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.controller.pdb }}
{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ .Values.controller.name }}
labels:
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
spec:
selector:
matchLabels:
app: {{ .Values.controller.name }}
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ toYaml .Values.controller.pdb | indent 2 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/aws-efs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ imagePullSecrets: []
controller:
# Specifies whether a deployment should be created
create: true
# name of the controller deployment
name: efs-csi-controller
# Number for the log level verbosity
logLevel: 2
# If set, add pv/pvc metadata to plugin create requests as parameters.
Expand Down Expand Up @@ -101,6 +103,8 @@ controller:
# eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/efs-csi-role
healthPort: 9909
regionalStsEndpoints: false
# Pod Disruption Budget
pdb: {}
# securityContext on the controller pod
securityContext:
runAsNonRoot: false
Expand Down

0 comments on commit a943df0

Please sign in to comment.