Skip to content

Commit

Permalink
feat: deployment in helm chart can define extra annotations and envir… (
Browse files Browse the repository at this point in the history
  • Loading branch information
lancelot1989 authored Nov 15, 2024
1 parent 6c08d23 commit af342ea
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deploy/helm/templates/dataprotection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kubeblocks.fullname" . }}-dataprotection
{{- with .Values.dataProtection.deployAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
app.kubernetes.io/component: "dataprotection"
Expand All @@ -24,7 +28,7 @@ spec:
{{- end }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with .Values.dataProtection.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -143,6 +147,9 @@ spec:
value: {{ .Values.dataProtection.worker.serviceAccount.annotations | toJson | quote }}
- name: WORKER_CLUSTER_ROLE_NAME
value: {{ include "dataprotection.workerClusterRoleName" . }}
{{- if .Values.dataProtection.extraEnvs }}
{{- toYaml .Values.dataProtection.extraEnvs | nindent 12 }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kubeblocks.fullname" . }}
{{- with .Values.deployAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
app.kubernetes.io/component: "apps"
Expand Down Expand Up @@ -179,6 +183,9 @@ spec:
value: {{ .Values.featureGates.componentReplicasAnnotation.enabled | quote }}
- name: IN_PLACE_POD_VERTICAL_SCALING
value: {{ .Values.featureGates.inPlacePodVerticalScaling.enabled | quote }}
{{- if .Values.extraEnvs }}
{{- toYaml .Values.extraEnvs | nindent 12 }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand Down
16 changes: 16 additions & 0 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ dataPlane:
# Add extra pod labels to KubeBlocks Deployment
extraLabels: {}

# Add extra annotations to KubeBlocks Deployment
deployAnnotations: {}

# Add extra pod envs to KubeBlocks Deployment
extraEnvs: []

## webhooks settings
##
## @param webhooks.conversionEnabled
Expand Down Expand Up @@ -392,6 +398,16 @@ dataProtection:
# Add extra pod labels to KubeBlocks-DataProtection Deployment
extraLabels: {}

# Add extra annotations to KubeBlocks-DataProtection Deployment
deployAnnotations: {}

# Add extra pod envs to KubeBlocks-DataProtection Deployment
extraEnvs: []

## @param podAnnotations
##
podAnnotations: {}

## BackupRepo settings
##
## @param backupRepo.create - creates a backup repo during installation
Expand Down

0 comments on commit af342ea

Please sign in to comment.