From 3e6dc1da1bc252775accc5128c5caef695fbaf19 Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Thu, 16 Nov 2023 14:51:52 +0000 Subject: [PATCH] fix: Add parameters for tuning revisionHistory and securityContext Signed-off-by: Matt Dainty --- charts/cni-metrics-helper/README.md | 3 +++ charts/cni-metrics-helper/templates/deployment.yaml | 7 +++++++ charts/cni-metrics-helper/values.yaml | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/charts/cni-metrics-helper/README.md b/charts/cni-metrics-helper/README.md index e2d137300b..d5894fbd76 100644 --- a/charts/cni-metrics-helper/README.md +++ b/charts/cni-metrics-helper/README.md @@ -59,6 +59,9 @@ The following table lists the configurable parameters for this chart and their d | serviceAccount.name | The name of the ServiceAccount to use | nil | | serviceAccount.create | Specifies whether a ServiceAccount should be created | true | | serviceAccount.annotations | Specifies the annotations for ServiceAccount | {} | +| revisionHistoryLimit | The number of revisions to keep | 10 | +| podSecurityContext | SecurityContext to set on the pod | {} | +| containerSecurityContext | SecurityContext to set on the container | {} | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install` or provide a YAML file containing the values for the above parameters: diff --git a/charts/cni-metrics-helper/templates/deployment.yaml b/charts/cni-metrics-helper/templates/deployment.yaml index fa3e872bdd..70f75d4e20 100644 --- a/charts/cni-metrics-helper/templates/deployment.yaml +++ b/charts/cni-metrics-helper/templates/deployment.yaml @@ -6,6 +6,7 @@ metadata: labels: k8s-app: cni-metrics-helper spec: + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: matchLabels: k8s-app: cni-metrics-helper @@ -22,7 +23,13 @@ spec: {{- end }} {{- if .Values.resources }} resources: {{ toYaml .Values.resources | nindent 10 }} +{{- end }} +{{- if .Values.containerSecurityContext }} + securityContext: {{ toYaml .Values.containerSecurityContext | nindent 10 }} {{- end }} name: cni-metrics-helper image: "{{- if .Values.image.override }}{{- .Values.image.override }}{{- else }}{{- .Values.image.account }}.dkr.ecr.{{- .Values.image.region }}.{{- .Values.image.domain }}/cni-metrics-helper:{{- .Values.image.tag }}{{- end}}" serviceAccountName: {{ template "cni-metrics-helper.serviceAccountName" . }} +{{- if .Values.podSecurityContext }} + securityContext: {{ toYaml .Values.podSecurityContext | nindent 8 }} +{{- end }} diff --git a/charts/cni-metrics-helper/values.yaml b/charts/cni-metrics-helper/values.yaml index adf8d6ba40..dde77e5e50 100644 --- a/charts/cni-metrics-helper/values.yaml +++ b/charts/cni-metrics-helper/values.yaml @@ -28,3 +28,9 @@ serviceAccount: # eks.amazonaws.com/role-arn: arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME resources: {} + +revisionHistoryLimit: 10 + +podSecurityContext: {} + +containerSecurityContext: {}