11apiVersion : apps/v1
22kind : Deployment
33metadata :
4- name : cadence-web-deployment
4+ name : {{ include " cadence.fullname" . }} -web
55 labels :
6- app : cadence-web
7- {{- include "cadence.commonlabels" . | nindent 4 }}
6+ {{- include " cadence.labels" . | nindent 4 }}
7+ app.kubernetes.io/component : web
88spec :
9- replicas : 1
9+ replicas : {{ .Values.web.replicas }}
10+ {{- with .Values.web.strategy }}
11+ strategy :
12+ {{- toYaml . | nindent 4 }}
13+ {{- end }}
1014 selector :
1115 matchLabels :
12- app : cadence- web
16+ {{- include " cadence.serviceLabels" (dict "serviceName" " web" "Values" .Values "Chart" .Chart "Release" .Release) | indent 6 }}
1317 template :
1418 metadata :
19+ {{- $webPodAnnotations := .Values.web.podAnnotations | default dict }}
20+ {{- if $webPodAnnotations }}
21+ annotations :
22+ {{- toYaml $webPodAnnotations | nindent 8 }}
23+ {{- end }}
1524 labels :
16- app : cadence-web
25+ {{- include "cadence.labels" . | nindent 8 }}
26+ {{- with .Values.web.podLabels }}
27+ {{- toYaml . | nindent 8 }}
28+ {{- end }}
29+ app.kubernetes.io/component : web
1730 spec :
31+ {{- if $.Values.serviceAccount.create }}
32+ serviceAccountName : {{ include "cadence.serviceAccountName" $ }}
33+ {{- end }}
34+ {{- $globalImagePullSecrets := .Values.global.imagePullSecrets | default list }}
35+ {{- $serviceImagePullSecrets := .Values.web.image.imagePullSecrets | default list }}
36+ {{- $mergedImagePullSecrets := concat $globalImagePullSecrets $serviceImagePullSecrets }}
37+ {{- if $mergedImagePullSecrets }}
38+ imagePullSecrets :
39+ {{- toYaml $mergedImagePullSecrets | nindent 8 }}
40+ {{- end }}
41+ {{- $globalPriorityClassName := .Values.global.priorityClassName | default "" }}
42+ {{- $servicePriorityClassName := .Values.web.priorityClassName | default $globalPriorityClassName }}
43+ {{- if $servicePriorityClassName }}
44+ priorityClassName : {{ $servicePriorityClassName }}
45+ {{- end }}
46+ {{- $globalPodSecurityContext := .Values.global.podSecurityContext | default dict }}
47+ {{- $servicePodSecurityContext := .Values.web.podSecurityContext | default $globalPodSecurityContext }}
48+ {{- if $servicePodSecurityContext }}
49+ securityContext :
50+ {{- toYaml $servicePodSecurityContext | nindent 8 }}
51+ {{- end }}
52+ {{- $globalNodeSelector := .Values.global.nodeSelector | default dict }}
53+ {{- $serviceNodeSelector := .Values.web.nodeSelector | default $globalNodeSelector }}
54+ {{- if $serviceNodeSelector }}
55+ nodeSelector :
56+ {{- toYaml $serviceNodeSelector | nindent 8 }}
57+ {{- end }}
58+ {{- $globalAffinity := .Values.global.affinity | default dict }}
59+ {{- $serviceAffinity := .Values.web.affinity | default $globalAffinity }}
60+ {{- if $serviceAffinity }}
61+ affinity :
62+ {{- toYaml $serviceAffinity | nindent 8 }}
63+ {{- end }}
64+ {{- $globalTolerations := .Values.global.tolerations | default list }}
65+ {{- $serviceTolerations := .Values.web.tolerations | default $globalTolerations }}
66+ {{- if $serviceTolerations }}
67+ tolerations :
68+ {{- toYaml $serviceTolerations | nindent 8 }}
69+ {{- end }}
70+ {{- $globalTopologySpreadConstraints := .Values.global.topologySpreadConstraints | default list }}
71+ {{- $serviceTopologySpreadConstraints := .Values.web.topologySpreadConstraints | default $globalTopologySpreadConstraints }}
72+ {{- if $serviceTopologySpreadConstraints }}
73+ topologySpreadConstraints :
74+ {{- toYaml $serviceTopologySpreadConstraints | nindent 8 }}
75+ {{- end }}
1876 containers :
1977 - name : cadence-web
20- image : {{ $.Values.web.image.repository }}:{{ $.Values.web.image.tag }}
21- imagePullPolicy : Always
78+ image : {{ .Values.web.image.repository }}:{{ .Values.web.image.tag }}
79+ imagePullPolicy : {{ .Values.web.image.pullPolicy }}
80+ {{- $globalContainerSecurityContext := .Values.global.containerSecurityContext | default dict }}
81+ {{- $serviceContainerSecurityContext := .Values.web.containerSecurityContext | default $globalContainerSecurityContext }}
82+ {{- if $serviceContainerSecurityContext }}
83+ securityContext :
84+ {{- toYaml $serviceContainerSecurityContext | nindent 10 }}
85+ {{- end }}
2286 ports :
23- - containerPort : 8088
87+ - name : http
88+ containerPort : 8088
89+ protocol : TCP
2490 env :
2591 - name : CADENCE_GRPC_PEERS
26- value : cadence-frontend.{{ .Release.Namespace }}.svc.cluster.local:{{ $.Values.frontend.grpcPort }}
92+ value : {{ include "cadence.grpcPeers" . }}
93+ {{- $webEnv := .Values.web.env | default list -}}
94+ {{- if $webEnv }}
95+ {{- toYaml $webEnv | nindent 8 }}
96+ {{- end }}
97+ {{- $webSecrets := .Values.web.secretEnv | default list -}}
98+ {{- if $webSecrets }}
99+ envFrom :
100+ - secretRef :
101+ name : {{ include "cadence.fullname" . }}-web-secrets
102+ {{- end }}
103+ {{- with .Values.web.resources }}
27104 resources :
28- limits :
29- cpu : {{ $.Values.web.cpu.limit }}
30- memory : {{ $.Values.web.memory.limit }}
31- requests :
32- cpu : {{ $.Values.web.cpu.request }}
33- memory : {{ $.Values.web.memory.request }}
34- ---
35- apiVersion : v1
36- kind : Service
37- metadata :
38- name : cadence-web-service
39- spec :
40- selector :
41- app : cadence-web
42- ports :
43- - protocol : TCP
44- port : 8088
45- targetPort : 8088
105+ {{- toYaml . | nindent 10 }}
106+ {{- end }}
0 commit comments