blob: b9ecdbbc4b1f38b95bee3c9cab84cd7788c00e4e [file] [log] [blame]
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +04001{{ $runCfg := .Values.runCfg | b64dec }}
2---
3apiVersion: v1
4kind: Secret
5metadata:
6 name: app-ssh-key
7type: Opaque
8data:
9 private: {{ .Values.sshPrivateKey }}
10---
11apiVersion: v1
12kind: ConfigMap
13metadata:
14 name: app-run-cfg
15data:
16 run: |
17{{ indent 4 $runCfg }}
18---
19apiVersion: v1
20kind: Service
21metadata:
22 name: app-app
23 namespace: {{ .Release.Namespace }}
24spec:
25 type: ClusterIP
26 selector:
27 app: app-app
28 ports:
29 - name: app
30 port: 80
31 targetPort: app
32 protocol: TCP
33---
34apiVersion: v1
35kind: Service
36metadata:
37 name: app-api
38 namespace: {{ .Release.Namespace }}
39spec:
40 type: ClusterIP
41 selector:
42 app: app-app
43 ports:
44 - name: api
45 port: 3000
46 targetPort: api
47 protocol: TCP
48---
49apiVersion: apps/v1
50kind: Deployment
51metadata:
52 name: app-app
53 namespace: {{ .Release.Namespace }}
Giorgi Lekveishvili34f4f942024-08-18 18:30:34 +040054 annotations:
55 dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040056spec:
57 selector:
58 matchLabels:
59 app: app-app
60 replicas: 1
61 template:
62 metadata:
63 labels:
64 app: app-app
Giorgi Lekveishvili128b11a2024-08-18 18:47:13 +040065 annotations:
66 dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040067 spec:
68 runtimeClassName: {{ .Values.runtimeClassName }}
69 volumes:
70 - name: ssh-key
71 secret:
72 secretName: app-ssh-key
73 - name: run-cfg
74 configMap:
75 name: app-run-cfg
76 {{- range .Values.volumes }}
77 - name: volume-{{ .name }}
78 persistentVolumeClaim:
79 claimName: {{ .name }}
80 {{- end }}
81 containers:
82 - name: app
83 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
84 imagePullPolicy: {{ .Values.image.pullPolicy }}
85 ports:
86 - name: api
87 containerPort: 3000
88 protocol: TCP
89 - name: app
90 containerPort: {{ .Values.appPort }}
91 protocol: TCP
92 env:
93 - name: SELF_IP
94 valueFrom:
95 fieldRef:
96 fieldPath: status.podIP
97 command:
98 - app-runner
99 - --port=3000
100 - --app-id={{ .Values.appId }}
101 - --app-dir={{ .Values.appDir }}
102 - --repo-addr={{ .Values.repoAddr }}
Giorgi Lekveishvili971aa302024-10-24 08:56:18 +0400103 - --branch={{ .Values.branch }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +0400104 - --ssh-key=/pcloud/ssh-key/private
105 - --run-cfg=/pcloud/config/run
106 - --manager-addr={{ .Values.managerAddr }}
107 volumeMounts:
108 - name: ssh-key
109 readOnly: true
110 mountPath: /pcloud/ssh-key
111 - name: run-cfg
112 readOnly: true
113 mountPath: /pcloud/config
114 {{- range .Values.volumes }}
115 - name: volume-{{ .name }}
116 mountPath: {{ .mountPath }}
117 {{- end }}
Giorgi Lekveishvili7ef0ff12024-09-21 10:27:57 +0400118 {{- if .Values.extraContainers }}
119 {{ toYaml .Values.extraContainers | nindent 6 }}
120 {{- end }}