| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 1 | {{ $runCfg := .Values.runCfg | b64dec }} |
| 2 | --- |
| Giorgi Lekveishvili | 89cb44f | 2025-03-28 15:36:20 +0400 | [diff] [blame] | 3 | {{- if .Values.sshPrivateKey }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 4 | apiVersion: v1 |
| 5 | kind: Secret |
| 6 | metadata: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 7 | name: {{ .Values.name }}-ssh-key |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 8 | type: Opaque |
| 9 | data: |
| 10 | private: {{ .Values.sshPrivateKey }} |
| Giorgi Lekveishvili | 89cb44f | 2025-03-28 15:36:20 +0400 | [diff] [blame] | 11 | {{- end }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 12 | --- |
| 13 | apiVersion: v1 |
| 14 | kind: ConfigMap |
| 15 | metadata: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 16 | name: {{ .Values.name }}-run-cfg |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 17 | data: |
| 18 | run: | |
| 19 | {{ indent 4 $runCfg }} |
| 20 | --- |
| Giorgi Lekveishvili | cfa3ae9 | 2024-10-27 22:00:03 +0400 | [diff] [blame] | 21 | {{- if .Values.appPorts }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 22 | apiVersion: v1 |
| 23 | kind: Service |
| 24 | metadata: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 25 | name: {{ .Values.name }}-app |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 26 | namespace: {{ .Release.Namespace }} |
| 27 | spec: |
| 28 | type: ClusterIP |
| 29 | selector: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 30 | app: {{ .Values.name }}-app |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 31 | ports: |
| Giorgi Lekveishvili | cfa3ae9 | 2024-10-27 22:00:03 +0400 | [diff] [blame] | 32 | {{- range .Values.appPorts }} |
| 33 | - name: {{ .name }} |
| Giorgi Lekveishvili | 287fa31 | 2024-10-27 22:43:52 +0400 | [diff] [blame] | 34 | port: {{ .containerPort }} |
| Giorgi Lekveishvili | cfa3ae9 | 2024-10-27 22:00:03 +0400 | [diff] [blame] | 35 | targetPort: {{ .name }} |
| 36 | protocol: {{ .protocol }} |
| 37 | {{- end }} |
| 38 | {{- end }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 39 | --- |
| 40 | apiVersion: v1 |
| 41 | kind: Service |
| 42 | metadata: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 43 | name: {{ .Values.name }}-api |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 44 | namespace: {{ .Release.Namespace }} |
| 45 | spec: |
| 46 | type: ClusterIP |
| 47 | selector: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 48 | app: {{ .Values.name }}-app |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 49 | ports: |
| 50 | - name: api |
| Giorgi Lekveishvili | 96cf745 | 2024-10-30 07:50:32 +0400 | [diff] [blame] | 51 | port: 80 |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 52 | targetPort: api |
| 53 | protocol: TCP |
| 54 | --- |
| 55 | apiVersion: apps/v1 |
| 56 | kind: Deployment |
| 57 | metadata: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 58 | name: {{ .Values.name }}-app |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 59 | namespace: {{ .Release.Namespace }} |
| Giorgi Lekveishvili | 34f4f94 | 2024-08-18 18:30:34 +0400 | [diff] [blame] | 60 | annotations: |
| 61 | dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 62 | spec: |
| 63 | selector: |
| 64 | matchLabels: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 65 | app: {{ .Values.name }}-app |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 66 | replicas: 1 |
| 67 | template: |
| 68 | metadata: |
| 69 | labels: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 70 | app: {{ .Values.name }}-app |
| Giorgi Lekveishvili | 128b11a | 2024-08-18 18:47:13 +0400 | [diff] [blame] | 71 | annotations: |
| 72 | dodo.cloud/config-checksum: {{ sha256sum .Values.runCfg }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 73 | spec: |
| 74 | runtimeClassName: {{ .Values.runtimeClassName }} |
| 75 | volumes: |
| Giorgi Lekveishvili | f7dd50e | 2025-03-28 15:55:14 +0400 | [diff] [blame] | 76 | {{- if .Values.sshPrivateKey }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 77 | - name: ssh-key |
| 78 | secret: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 79 | secretName: {{ .Values.name }}-ssh-key |
| Giorgi Lekveishvili | f7dd50e | 2025-03-28 15:55:14 +0400 | [diff] [blame] | 80 | {{- end }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 81 | - name: run-cfg |
| 82 | configMap: |
| Giorgi Lekveishvili | 93e5092 | 2024-11-21 18:28:06 +0400 | [diff] [blame] | 83 | name: {{ .Values.name }}-run-cfg |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 84 | {{- range .Values.volumes }} |
| 85 | - name: volume-{{ .name }} |
| 86 | persistentVolumeClaim: |
| 87 | claimName: {{ .name }} |
| 88 | {{- end }} |
| 89 | containers: |
| 90 | - name: app |
| 91 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 92 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 93 | ports: |
| 94 | - name: api |
| Giorgi Lekveishvili | 96cf745 | 2024-10-30 07:50:32 +0400 | [diff] [blame] | 95 | containerPort: {{ .Values.apiPort }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 96 | protocol: TCP |
| Giorgi Lekveishvili | b46e2a6 | 2024-10-27 18:39:30 +0400 | [diff] [blame] | 97 | {{- if .Values.appPorts }} |
| 98 | {{ toYaml .Values.appPorts | nindent 8 }} |
| 99 | {{- end }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 100 | env: |
| 101 | - name: SELF_IP |
| 102 | valueFrom: |
| 103 | fieldRef: |
| 104 | fieldPath: status.podIP |
| 105 | command: |
| 106 | - app-runner |
| Giorgi Lekveishvili | 96cf745 | 2024-10-30 07:50:32 +0400 | [diff] [blame] | 107 | - --port={{ .Values.apiPort }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 108 | - --app-id={{ .Values.appId }} |
| Giorgi Lekveishvili | fd87cbd | 2025-05-12 17:33:26 +0400 | [diff] [blame^] | 109 | - --service={{ .Values.name }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 110 | - --app-dir={{ .Values.appDir }} |
| 111 | - --repo-addr={{ .Values.repoAddr }} |
| Giorgi Lekveishvili | 971aa30 | 2024-10-24 08:56:18 +0400 | [diff] [blame] | 112 | - --branch={{ .Values.branch }} |
| Giorgi Lekveishvili | c7a424a | 2025-03-28 15:37:19 +0400 | [diff] [blame] | 113 | - --root-dir={{ .Values.rootDir }} |
| Giorgi Lekveishvili | f7dd50e | 2025-03-28 15:55:14 +0400 | [diff] [blame] | 114 | {{- if .Values.sshPrivateKey }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 115 | - --ssh-key=/pcloud/ssh-key/private |
| Giorgi Lekveishvili | f7dd50e | 2025-03-28 15:55:14 +0400 | [diff] [blame] | 116 | {{- end }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 117 | - --run-cfg=/pcloud/config/run |
| 118 | - --manager-addr={{ .Values.managerAddr }} |
| 119 | volumeMounts: |
| Giorgi Lekveishvili | 4cc3038 | 2025-03-28 16:02:04 +0400 | [diff] [blame] | 120 | {{- if .Values.sshPrivateKey }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 121 | - name: ssh-key |
| 122 | readOnly: true |
| 123 | mountPath: /pcloud/ssh-key |
| Giorgi Lekveishvili | 4cc3038 | 2025-03-28 16:02:04 +0400 | [diff] [blame] | 124 | {{- end }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 125 | - name: run-cfg |
| 126 | readOnly: true |
| 127 | mountPath: /pcloud/config |
| 128 | {{- range .Values.volumes }} |
| 129 | - name: volume-{{ .name }} |
| 130 | mountPath: {{ .mountPath }} |
| 131 | {{- end }} |
| Giorgi Lekveishvili | 7ef0ff1 | 2024-09-21 10:27:57 +0400 | [diff] [blame] | 132 | {{- if .Values.extraContainers }} |
| 133 | {{ toYaml .Values.extraContainers | nindent 6 }} |
| 134 | {{- end }} |