blob: e1a02924fa7454b799752d8b997ccf21cf6bae67 [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
65 spec:
66 runtimeClassName: {{ .Values.runtimeClassName }}
67 volumes:
68 - name: ssh-key
69 secret:
70 secretName: app-ssh-key
71 - name: run-cfg
72 configMap:
73 name: app-run-cfg
74 {{- range .Values.volumes }}
75 - name: volume-{{ .name }}
76 persistentVolumeClaim:
77 claimName: {{ .name }}
78 {{- end }}
79 containers:
80 - name: app
81 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
82 imagePullPolicy: {{ .Values.image.pullPolicy }}
83 ports:
84 - name: api
85 containerPort: 3000
86 protocol: TCP
87 - name: app
88 containerPort: {{ .Values.appPort }}
89 protocol: TCP
90 env:
91 - name: SELF_IP
92 valueFrom:
93 fieldRef:
94 fieldPath: status.podIP
95 command:
96 - app-runner
97 - --port=3000
98 - --app-id={{ .Values.appId }}
99 - --app-dir={{ .Values.appDir }}
100 - --repo-addr={{ .Values.repoAddr }}
101 - --ssh-key=/pcloud/ssh-key/private
102 - --run-cfg=/pcloud/config/run
103 - --manager-addr={{ .Values.managerAddr }}
104 volumeMounts:
105 - name: ssh-key
106 readOnly: true
107 mountPath: /pcloud/ssh-key
108 - name: run-cfg
109 readOnly: true
110 mountPath: /pcloud/config
111 {{- range .Values.volumes }}
112 - name: volume-{{ .name }}
113 mountPath: {{ .mountPath }}
114 {{- end }}