blob: 5bdf72ea53ab1098151575eeb43454eba820b64b [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 }}
54spec:
55 selector:
56 matchLabels:
57 app: app-app
58 replicas: 1
59 template:
60 metadata:
61 labels:
62 app: app-app
63 spec:
64 volumes:
65 - name: ssh-key
66 secret:
67 secretName: app-ssh-key
68 - name: run-cfg
69 configMap:
70 name: app-run-cfg
71 containers:
72 - name: app
73 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
74 imagePullPolicy: {{ .Values.image.pullPolicy }}
75 ports:
76 - name: api
77 containerPort: 3000
78 protocol: TCP
79 - name: app
80 containerPort: {{ .Values.appPort }}
81 protocol: TCP
82 env:
83 - name: SELF_IP
84 valueFrom:
85 fieldRef:
86 fieldPath: status.podIP
87 command:
88 - app-runner
89 - --port=3000
90 - --app-dir=/dodo-app
91 - --repo-addr={{ .Values.repoAddr }}
92 - --ssh-key=/pcloud/ssh-key/private
93 - --run-cfg=/pcloud/config/run
94 - --manager={{ .Values.manager }}
95 volumeMounts:
96 - name: ssh-key
97 readOnly: true
98 mountPath: /pcloud/ssh-key
99 - name: run-cfg
100 readOnly: true
101 mountPath: /pcloud/config