1+ {{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}} 
2+ apiVersion : apps/v1 
3+ kind : Deployment 
4+ metadata :
5+   name : {{ include "api.fullname" . }} 
6+   labels :
7+     {{- include "api.labels" . | nindent 4 }} 
8+     {{- if .Values.deployment.labels -}} 
9+     {{-   toYaml .Values.deployment.labels | nindent 4 }} 
10+     {{- end }} 
11+   annotations :
12+     {{- if .Values.deployment.annotations -}} 
13+     {{-   toYaml .Values.deployment.annotations | nindent 4 }} 
14+     {{- end }} 
15+ spec :
16+   replicas : {{ .Values.replica }} 
17+   selector :
18+     matchLabels :
19+       {{- include "api.selectorLabels" . | nindent 6 }} 
20+   template :
21+     metadata :
22+       labels :
23+         {{- include "api.labels" . | nindent 8 }} 
24+       annotations :
25+         {{- if .Values.pod.annotations -}} 
26+         {{-   toYaml .Values.pod.annotations | nindent 8 }} 
27+         {{- end }} 
28+     spec :
29+       serviceAccountName : {{ include "api.serviceAccountName" . }} 
30+       {{- if .tolerations }} 
31+       tolerations :
32+         {{- toYaml .tolerations | nindent 8 }} 
33+       {{- end }} 
34+       {{- include "ctrlplane.nodeSelector" . | nindent 6 }} 
35+       {{- include "ctrlplane.priorityClassName" . | nindent 6 }} 
36+       {{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }} 
37+       containers :
38+         - name : api 
39+           image : " {{ .Values.image.repository }}:{{ .Values.image.tag }}" 
40+           ports :
41+             - name : api 
42+               containerPort : 8081 
43+               protocol : TCP 
44+           env :
45+             - name : BASE_URL 
46+               value : {{ .Values.global.fqdn }} 
47+             - name : AUTH_URL 
48+               value : {{ .Values.global.fqdn }} 
49+ 
50+             - name : VARIABLES_AES_256_KEY 
51+               valueFrom :
52+                 secretKeyRef :
53+                   name : {{ .Release.Name }}-encryption-key 
54+                   key : AES_256_KEY 
55+ 
56+             {{- if ne .Values.global.authProviders.google.clientId "" }} 
57+             - name : AUTH_GOOGLE_CLIENT_ID 
58+               value : {{ .Values.global.authProviders.google.clientId }} 
59+             - name : AUTH_GOOGLE_CLIENT_SECRET 
60+               value : {{ .Values.global.authProviders.google.clientSecret }} 
61+             {{- end }} 
62+ 
63+             {{- if ne .Values.global.authProviders.oidc.clientId "" }} 
64+             - name : AUTH_OIDC_ISSUER 
65+               value : {{ .Values.global.authProviders.oidc.issuer }} 
66+             - name : AUTH_OIDC_CLIENT_ID 
67+               value : {{ .Values.global.authProviders.oidc.clientId }} 
68+             - name : AUTH_OIDC_CLIENT_SECRET 
69+               value : {{ .Values.global.authProviders.oidc.clientSecret }} 
70+             {{- end }} 
71+ 
72+             {{- if eq .Values.global.authProviders.credentials.enabled "true" }} 
73+             - name : AUTH_CREDENTIALS_ENABLED 
74+               value : " true" 
75+             {{- else if eq .Values.global.authProviders.credentials.enabled "false" }} 
76+             - name : AUTH_CREDENTIALS_ENABLED 
77+               value : " false" 
78+             {{- else }} 
79+             - name : AUTH_CREDENTIALS_ENABLED 
80+               value : " auto" 
81+             {{- end }} 
82+ 
83+             - name : KAFKA_BROKERS 
84+               value : {{ .Values.global.kafkaBrokers | quote }} 
85+ 
86+             - name : POSTGRES_URL 
87+               valueFrom :
88+                 secretKeyRef :
89+                   name : {{ .Release.Name }}-connections 
90+                   key : POSTGRES_URL 
91+ 
92+             - name : AUTH_SECRET 
93+               valueFrom :
94+                 secretKeyRef :
95+                   name : {{ include "api.fullname" . }} 
96+                   key : AUTH_SECRET 
97+             - name : GITHUB_URL 
98+               value : {{ include "ctrlplane.githubUrl" . }} 
99+             {{- with (include "ctrlplane.githubBot" . | fromYaml) }} 
100+             - name : GITHUB_BOT_NAME 
101+               value : {{ .name | quote }} 
102+             - name : GITHUB_BOT_APP_ID 
103+               value : {{ .appId | quote }} 
104+             - name : GITHUB_BOT_CLIENT_ID 
105+               value : {{ .clientId | quote }} 
106+             - name : GITHUB_BOT_CLIENT_SECRET 
107+               valueFrom :
108+                 secretKeyRef :
109+                   name : {{ .secretRef }} 
110+                   key : GITHUB_BOT_CLIENT_SECRET 
111+                   optional : true 
112+             - name : GITHUB_BOT_PRIVATE_KEY 
113+               valueFrom :
114+                 secretKeyRef :
115+                   name : {{ .secretRef }} 
116+                   key : GITHUB_BOT_PRIVATE_KEY 
117+                   optional : true 
118+             - name : GITHUB_WEBHOOK_SECRET 
119+               valueFrom :
120+                 secretKeyRef :
121+                   name : {{ .secretRef }} 
122+                   key : GITHUB_WEBHOOK_SECRET 
123+                   optional : true 
124+             #  - name: OTEL_EXPORTER_OTLP_ENDPOINT
125+               #  value: http://{{ $.Release.Name }}-otel:4318
126+             {{- end }} 
127+             {{- with (include "ctrlplane.azureApp" . | fromYaml) }} 
128+             - name : AZURE_APP_CLIENT_ID 
129+               value : {{ .clientId | quote }} 
130+             {{- end }} 
131+             {{- include "ctrlplane.extraEnv" . | nindent 12 }} 
132+             {{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }} 
133+           livenessProbe :
134+             httpGet :
135+               path : /api/healthz 
136+               port : api 
137+           readinessProbe :
138+             httpGet :
139+               path : /api/healthz 
140+               port : api 
141+           startupProbe :
142+             httpGet :
143+               path : /api/healthz 
144+               port : api 
145+           resources :
146+             {{- toYaml .Values.resources | nindent 12 }} 
0 commit comments