Skip to content

Commit 2b24597

Browse files
author
Raman
committed
helm chart
1 parent 531b66a commit 2b24597

11 files changed

Lines changed: 32 additions & 69 deletions

File tree

deployment/helm/templates/_helpers.tpl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,18 @@ app.kubernetes.io/name: {{ include "chatserver.name" . }}
5050
app.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
{{/*

deployment/helm/templates/group-message-router/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
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 -}}

deployment/helm/templates/message-delivery/configmap.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

deployment/helm/templates/message-delivery/deployment.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ spec:
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 -}}
@@ -27,7 +31,6 @@ spec:
2731
imagePullSecrets:
2832
{{- toYaml . | nindent 8 -}}
2933
{{- end -}}
30-
serviceAccountName: {{ include "chatserver.serviceAccountName" . }}
3134
containers:
3235
- name: {{ $serviceName }}
3336
securityContext:
@@ -54,11 +57,4 @@ spec:
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 -}}

deployment/helm/templates/message-router/statefulset.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
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 -}}
@@ -29,7 +29,6 @@ spec:
2929
{{- toYaml . | nindent 8 -}}
3030
{{- end -}}
3131
serviceName: {{ $serviceName }}
32-
serviceAccountName: {{ include "chatserver.serviceAccountName" . }}
3332
containers:
3433
- name: {{ $serviceName }}
3534
securityContext:

deployment/helm/templates/nginx/deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ spec:
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 -}}
@@ -24,7 +28,6 @@ spec:
2428
imagePullSecrets:
2529
{{- toYaml . | nindent 8 -}}
2630
{{- end -}}
27-
serviceAccountName: {{ include "chatserver.serviceAccountName" . }}
2831
containers:
2932
- name: nginx
3033
securityContext:

deployment/helm/templates/notification/statefulset.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
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 -}}
@@ -31,7 +31,6 @@ spec:
3131
{{- toYaml . | nindent 8 -}}
3232
{{- end -}}
3333
serviceName: {{ $serviceName }}
34-
serviceAccountName: {{ include "chatserver.serviceAccountName" . }}
3534
containers:
3635
- name: {{ $serviceName }}
3736
securityContext:

deployment/helm/templates/profile/deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ spec:
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 -}}
@@ -28,7 +32,6 @@ spec:
2832
imagePullSecrets:
2933
{{- toYaml . | nindent 8 -}}
3034
{{- end -}}
31-
serviceAccountName: {{ include "chatserver.serviceAccountName" . }}
3235
containers:
3336
- name: {{ $serviceName }}
3437
securityContext:

deployment/helm/templates/tests/test-connection.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

deployment/helm/templates/ws-gateway/statefulset.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
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 -}}
@@ -29,7 +29,6 @@ spec:
2929
{{- toYaml . | nindent 8 -}}
3030
{{- end -}}
3131
serviceName: "{{ $serviceName }}-headless"
32-
serviceAccountName: {{ include "chatserver.serviceAccountName" . }}
3332
containers:
3433
- name: {{ $serviceName }}
3534
securityContext:

0 commit comments

Comments
 (0)