blob: 00ba74ee907d20e5b3b40ca3ce6dc2c3a5ef725a [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---
gio88d37662024-10-27 22:52:34 +040019{{- if .Values.appPorts }}
gio0eaf2712024-04-14 13:08:46 +040020apiVersion: v1
21kind: Service
22metadata:
23 name: app-app
24 namespace: {{ .Release.Namespace }}
25spec:
26 type: ClusterIP
27 selector:
28 app: app-app
29 ports:
gio88d37662024-10-27 22:52:34 +040030 {{- range .Values.appPorts }}
31 - name: {{ .name }}
32 port: {{ .containerPort }}
33 targetPort: {{ .name }}
34 protocol: {{ .protocol }}
35 {{- end }}
36{{- end }}
gio0eaf2712024-04-14 13:08:46 +040037---
38apiVersion: v1
39kind: Service
40metadata:
41 name: app-api
42 namespace: {{ .Release.Namespace }}
43spec:
44 type: ClusterIP
45 selector:
46 app: app-app
47 ports:
48 - name: api
49 port: 3000
50 targetPort: api
51 protocol: TCP
52---
53apiVersion: apps/v1
54kind: Deployment
55metadata:
56 name: app-app
57 namespace: {{ .Release.Namespace }}
gio12e887d2024-08-18 16:09:47 +040058 annotations:
59 dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }}
gio0eaf2712024-04-14 13:08:46 +040060spec:
61 selector:
62 matchLabels:
63 app: app-app
64 replicas: 1
65 template:
66 metadata:
67 labels:
68 app: app-app
gio12e887d2024-08-18 16:09:47 +040069 annotations:
70 dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }}
gio0eaf2712024-04-14 13:08:46 +040071 spec:
gioa1905942024-07-19 12:18:30 +040072 runtimeClassName: {{ .Values.runtimeClassName }}
gio0eaf2712024-04-14 13:08:46 +040073 volumes:
74 - name: ssh-key
75 secret:
76 secretName: app-ssh-key
77 - name: run-cfg
78 configMap:
79 name: app-run-cfg
gio1364e432024-06-29 11:39:18 +040080 {{- range .Values.volumes }}
81 - name: volume-{{ .name }}
82 persistentVolumeClaim:
83 claimName: {{ .name }}
84 {{- end }}
gio0eaf2712024-04-14 13:08:46 +040085 containers:
86 - name: app
87 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
88 imagePullPolicy: {{ .Values.image.pullPolicy }}
89 ports:
90 - name: api
91 containerPort: 3000
92 protocol: TCP
gio88d37662024-10-27 22:52:34 +040093 {{- if .Values.appPorts }}
94 {{ toYaml .Values.appPorts | nindent 8 }}
95 {{- end }}
gio0eaf2712024-04-14 13:08:46 +040096 env:
97 - name: SELF_IP
98 valueFrom:
99 fieldRef:
100 fieldPath: status.podIP
101 command:
102 - app-runner
103 - --port=3000
gio266c04f2024-07-03 14:18:45 +0400104 - --app-id={{ .Values.appId }}
giob54db242024-07-30 18:49:33 +0400105 - --app-dir={{ .Values.appDir }}
gio0eaf2712024-04-14 13:08:46 +0400106 - --repo-addr={{ .Values.repoAddr }}
gio2b1157a2024-10-24 08:45:07 +0400107 - --branch={{ .Values.branch }}
gio0eaf2712024-04-14 13:08:46 +0400108 - --ssh-key=/pcloud/ssh-key/private
109 - --run-cfg=/pcloud/config/run
gioa60f0de2024-07-08 10:49:48 +0400110 - --manager-addr={{ .Values.managerAddr }}
gio0eaf2712024-04-14 13:08:46 +0400111 volumeMounts:
112 - name: ssh-key
113 readOnly: true
114 mountPath: /pcloud/ssh-key
115 - name: run-cfg
116 readOnly: true
117 mountPath: /pcloud/config
gio1364e432024-06-29 11:39:18 +0400118 {{- range .Values.volumes }}
119 - name: volume-{{ .name }}
120 mountPath: {{ .mountPath }}
121 {{- end }}
giof15b9da2024-09-19 06:59:16 +0400122 {{- if .Values.extraContainers }}
123 {{ toYaml .Values.extraContainers | nindent 6 }}
124 {{- end }}