| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 1 | apiVersion: apps/v1 |
| 2 | kind: StatefulSet |
| 3 | metadata: |
| 4 | name: soft-serve |
| 5 | namespace: {{ .Release.Namespace }} |
| 6 | spec: |
| 7 | selector: |
| 8 | matchLabels: |
| 9 | app: soft-serve |
| 10 | serviceName: soft-serve |
| 11 | replicas: 1 |
| 12 | template: |
| 13 | metadata: |
| 14 | labels: |
| 15 | app: soft-serve |
| 16 | spec: |
| 17 | volumes: |
| 18 | - name: data |
| 19 | persistentVolumeClaim: |
| Giorgi Lekveishvili | d4eb586 | 2024-08-29 15:05:25 +0400 | [diff] [blame] | 20 | claimName: {{ .Values.persistentVolumeClaimName }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 21 | {{ if and .Values.privateKey .Values.publicKey }} |
| 22 | - name: keys |
| 23 | configMap: |
| 24 | name: keys |
| 25 | {{ end }} |
| 26 | containers: |
| 27 | - name: soft-serve |
| 28 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 29 | imagePullPolicy: {{ .Values.image.pullPolicy}} |
| 30 | env: |
| 31 | - name: SOFT_SERVE_SSH_LISTEN_ADDR |
| Giorgi Lekveishvili | 06a6791 | 2025-04-20 15:56:03 +0400 | [diff] [blame] | 32 | value: ":{{ .Values.sshPort }}" |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 33 | - name: SOFT_SERVE_SSH_PUBLIC_URL |
| Giorgi Lekveishvili | 627f6c4 | 2024-08-29 15:31:07 +0400 | [diff] [blame] | 34 | value: "ssh://{{ .Values.host }}:{{ .Values.sshPublicPort }}" |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 35 | - name: SOFT_SERVE_INITIAL_ADMIN_KEYS |
| 36 | value: |- |
| 37 | {{ indent 12 .Values.adminKey }} |
| 38 | {{ if and .Values.privateKey .Values.publicKey }} |
| 39 | - name: SOFT_SERVE_SSH_KEY_PATH |
| 40 | value: /.ssh/key |
| 41 | {{ end }} |
| 42 | - name: SOFT_SERVE_DATA_PATH |
| 43 | value: /var/lib/soft-serve/repos |
| 44 | - name: SOFT_SERVE_HTTP_LISTEN_ADDR |
| Giorgi Lekveishvili | 06a6791 | 2025-04-20 15:56:03 +0400 | [diff] [blame] | 45 | value: ":{{.Values.httpPort}}" |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 46 | - name: SOFT_SERVE_HTTP_PUBLIC_URL |
| Giorgi Lekveishvili | 627f6c4 | 2024-08-29 15:31:07 +0400 | [diff] [blame] | 47 | value: "http://{{ .Values.host }}" |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 48 | ports: |
| 49 | - name: ssh |
| Giorgi Lekveishvili | 06a6791 | 2025-04-20 15:56:03 +0400 | [diff] [blame] | 50 | containerPort: {{ .Values.sshPort }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 51 | protocol: TCP |
| 52 | - name: http |
| Giorgi Lekveishvili | 06a6791 | 2025-04-20 15:56:03 +0400 | [diff] [blame] | 53 | containerPort: {{ .Values.httpPort }} |
| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 54 | protocol: TCP |
| 55 | volumeMounts: |
| 56 | - name: data |
| 57 | mountPath: /var/lib/soft-serve |
| 58 | readOnly: false |
| 59 | {{ if and .Values.privateKey .Values.publicKey }} |
| 60 | - name: keys |
| 61 | mountPath: /.ssh |
| 62 | readOnly: true |
| 63 | {{ end }} |