blob: 1e22086a8f7ad5515c01ab49b06ea3ae584ee8e8 [file] [log] [blame]
gio0eaf2712024-04-14 13:08:46 +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 }}
gio12e887d2024-08-18 16:09:47 +040054 annotations:
55 dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }}
gio0eaf2712024-04-14 13:08:46 +040056spec:
57 selector:
58 matchLabels:
59 app: app-app
60 replicas: 1
61 template:
62 metadata:
63 labels:
64 app: app-app
gio12e887d2024-08-18 16:09:47 +040065 annotations:
66 dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }}
gio0eaf2712024-04-14 13:08:46 +040067 spec:
gioa1905942024-07-19 12:18:30 +040068 runtimeClassName: {{ .Values.runtimeClassName }}
gio0eaf2712024-04-14 13:08:46 +040069 volumes:
70 - name: ssh-key
71 secret:
72 secretName: app-ssh-key
73 - name: run-cfg
74 configMap:
75 name: app-run-cfg
gio1364e432024-06-29 11:39:18 +040076 {{- range .Values.volumes }}
77 - name: volume-{{ .name }}
78 persistentVolumeClaim:
79 claimName: {{ .name }}
80 {{- end }}
gio0eaf2712024-04-14 13:08:46 +040081 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
gio266c04f2024-07-03 14:18:45 +0400100 - --app-id={{ .Values.appId }}
giob54db242024-07-30 18:49:33 +0400101 - --app-dir={{ .Values.appDir }}
gio0eaf2712024-04-14 13:08:46 +0400102 - --repo-addr={{ .Values.repoAddr }}
103 - --ssh-key=/pcloud/ssh-key/private
104 - --run-cfg=/pcloud/config/run
gioa60f0de2024-07-08 10:49:48 +0400105 - --manager-addr={{ .Values.managerAddr }}
gio0eaf2712024-04-14 13:08:46 +0400106 volumeMounts:
107 - name: ssh-key
108 readOnly: true
109 mountPath: /pcloud/ssh-key
110 - name: run-cfg
111 readOnly: true
112 mountPath: /pcloud/config
gio1364e432024-06-29 11:39:18 +0400113 {{- range .Values.volumes }}
114 - name: volume-{{ .name }}
115 mountPath: {{ .mountPath }}
116 {{- end }}