File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,16 +50,18 @@ app.kubernetes.io/name: {{ include "chatserver.name" . }}
5050app.kubernetes.io /instance: {{ .Release.Name }}
5151{{- end }}
5252
53- {{/*
54- Create the name of the service account to use
55- */ }}
56- {{- define " chatserver.serviceAccountName" -}}
57- {{- if .Values.serviceAccount.create }}
58- {{- default (include " chatserver.fullname" . ) .Values.serviceAccount.name }}
59- {{- else }}
60- {{- default " default" .Values.serviceAccount.name }}
61- {{- end }}
62- {{- end }}
53+ {{- /*
54+ Merges the global annotations with the service-specific annotations,
55+ giving precedence to the service-specific annotations.
56+ */ -}}
57+ {{- define " chatserver.annotations" -}}
58+ {{- $serviceAnnotations := . -}}
59+ {{- $globalAnnotations := .Values.podAnnotations -}}
60+ {{- $result := dict -}}
61+ {{- $result = merge $result $globalAnnotations -}}
62+ {{- $result = merge $result $serviceAnnotations -}}
63+ {{- $result -}}
64+ {{- end -}}
6365
6466
6567{{/*
Original file line number Diff line number Diff line change 1717 {{- include "chatserver.selectorLabels" . | nindent 6 -}}
1818 template :
1919 metadata :
20- {{- with . Values.podAnnotations -}}
20+ {{- with ( include "chatserver.annotations" . Values.mesageDelivery. podAnnotations ) -}}
2121 annotations :
2222 {{- toYaml . | nindent 8 -}}
2323 {{- end -}}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1919 template :
2020 metadata :
2121 name : {{ $serviceName }}
22+ {{- with ( include "chatserver.annotations" .Values.mesageDelivery.podAnnotations ) -}}
23+ annotations :
24+ {{- toYaml . | nindent 8 -}}
25+ {{- end -}}
2226 labels :
2327 - service : {{ $serviceName }}
2428 {{- include "chatserverlabels" . | nindent 4 -}}
2731 imagePullSecrets :
2832 {{- toYaml . | nindent 8 -}}
2933 {{- end -}}
30- serviceAccountName : {{ include "chatserver.serviceAccountName" . }}
3134 containers :
3235 - name : {{ $serviceName }}
3336 securityContext :
5457 {{ include "mongo.opton" | nindent 12 }}
5558 {{- end -}}
5659 {{ include "eventStore.option" (dict "consumerGroup" "message-delivery") | nindent 12 }}
57- volumeMounts :
58- - name : service-discovery
59- mountPath : /app
60- volumes :
61- - name : service-discovery
62- configMap :
63- name : gateway-directory
6460{{- end -}}
Original file line number Diff line number Diff line change 1616 {{- include "chatserver.selectorLabels" . | nindent 6 -}}
1717 template :
1818 metadata :
19- {{- with . Values.podAnnotations -}}
19+ {{- with ( include "chatserver.annotations" . Values.messageRouter. podAnnotations ) -}}
2020 annotations :
2121 {{- toYaml . | nindent 8 -}}
2222 {{- end -}}
2929 {{- toYaml . | nindent 8 -}}
3030 {{- end -}}
3131 serviceName : {{ $serviceName }}
32- serviceAccountName : {{ include "chatserver.serviceAccountName" . }}
3332 containers :
3433 - name : {{ $serviceName }}
3534 securityContext :
Original file line number Diff line number Diff line change 1616 template :
1717 metadata :
1818 name : nginx
19+ {{- with ( include "chatserver.annotations" .Values.nginx.podAnnotations ) -}}
20+ annotations :
21+ {{- toYaml . | nindent 8 -}}
22+ {{- end -}}
1923 labels :
2024 - service : " nginx"
2125 {{- include "chatserver.labels" . | nindent 4 -}}
2428 imagePullSecrets :
2529 {{- toYaml . | nindent 8 -}}
2630 {{- end -}}
27- serviceAccountName : {{ include "chatserver.serviceAccountName" . }}
2831 containers :
2932 - name : nginx
3033 securityContext :
Original file line number Diff line number Diff line change 1818 {{- include "chatserver.selectorLabels" . | nindent 6 -}}
1919 template :
2020 metadata :
21- {{- with . Values.podAnnotations -}}
21+ {{- with ( include "chatserver.annotations" . Values.profileMs. podAnnotations ) -}}
2222 annotations :
2323 {{- toYaml . | nindent 8 -}}
2424 {{- end -}}
3131 {{- toYaml . | nindent 8 -}}
3232 {{- end -}}
3333 serviceName : {{ $serviceName }}
34- serviceAccountName : {{ include "chatserver.serviceAccountName" . }}
3534 containers :
3635 - name : {{ $serviceName }}
3736 securityContext :
Original file line number Diff line number Diff line change 2020 template :
2121 metadata :
2222 name : {{ $serviceName }}
23+ {{- with ( include "chatserver.annotations" .Values.profileMs.podAnnotations ) -}}
24+ annotations :
25+ {{- toYaml . | nindent 8 -}}
26+ {{- end -}}
2327 labels :
2428 - service : {{ $serviceName }}
2529 {{- include "chatserver.labels" . | nindent 4 -}}
2832 imagePullSecrets :
2933 {{- toYaml . | nindent 8 -}}
3034 {{- end -}}
31- serviceAccountName : {{ include "chatserver.serviceAccountName" . }}
3235 containers :
3336 - name : {{ $serviceName }}
3437 securityContext :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1616 {{- include "chatserver.selectorLabels" . | nindent 6 -}}
1717 template :
1818 metadata :
19- {{- with . Values.podAnnotations -}}
19+ {{- with ( include "chatserver.annotations" . Values.gateway. podAnnotations ) -}}
2020 annotations :
2121 {{- toYaml . | nindent 8 -}}
2222 {{- end -}}
2929 {{- toYaml . | nindent 8 -}}
3030 {{- end -}}
3131 serviceName : " {{ $serviceName }}-headless"
32- serviceAccountName : {{ include "chatserver.serviceAccountName" . }}
3332 containers :
3433 - name : {{ $serviceName }}
3534 securityContext :
You can’t perform that action at this time.
0 commit comments