| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 1 | apiVersion: rbac.authorization.k8s.io/v1 |
| 2 | kind: Role |
| 3 | metadata: |
| 4 | name: job-creator |
| 5 | rules: |
| 6 | - apiGroups: |
| 7 | - "batch" |
| 8 | resources: |
| 9 | - jobs |
| 10 | verbs: |
| 11 | - create |
| 12 | --- |
| 13 | apiVersion: rbac.authorization.k8s.io/v1 |
| 14 | kind: RoleBinding |
| 15 | metadata: |
| 16 | name: job-creator |
| 17 | roleRef: |
| 18 | apiGroup: rbac.authorization.k8s.io |
| 19 | kind: Role |
| 20 | name: job-creator |
| 21 | subjects: |
| 22 | - kind: ServiceAccount |
| 23 | name: default |
| 24 | namespace: {{ .Release.Namespace }} |
| 25 | --- |
| gio | 0eaf271 | 2024-04-14 13:08:46 +0400 | [diff] [blame] | 26 | apiVersion: v1 |
| 27 | kind: Secret |
| 28 | metadata: |
| 29 | name: ssh-key |
| 30 | type: Opaque |
| 31 | data: |
| 32 | private: {{ .Values.sshPrivateKey }} |
| 33 | --- |
| 34 | apiVersion: v1 |
| 35 | kind: Service |
| 36 | metadata: |
| 37 | name: dodo-app |
| gio | 0eaf271 | 2024-04-14 13:08:46 +0400 | [diff] [blame] | 38 | spec: |
| 39 | type: ClusterIP |
| 40 | selector: |
| 41 | app: dodo-app |
| 42 | ports: |
| 43 | - name: http |
| 44 | port: 80 |
| 45 | targetPort: http |
| 46 | protocol: TCP |
| 47 | --- |
| 48 | apiVersion: apps/v1 |
| 49 | kind: Deployment |
| 50 | metadata: |
| 51 | name: dodo-app |
| gio | 0eaf271 | 2024-04-14 13:08:46 +0400 | [diff] [blame] | 52 | spec: |
| 53 | selector: |
| 54 | matchLabels: |
| 55 | app: dodo-app |
| 56 | replicas: 1 |
| 57 | template: |
| 58 | metadata: |
| 59 | labels: |
| 60 | app: dodo-app |
| 61 | spec: |
| 62 | volumes: |
| 63 | - name: ssh-key |
| 64 | secret: |
| 65 | secretName: ssh-key |
| 66 | - name: env-config |
| 67 | secret: |
| 68 | secretName: env-config |
| 69 | containers: |
| 70 | - name: dodo-app |
| 71 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 72 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 73 | ports: |
| 74 | - name: http |
| 75 | containerPort: 8080 |
| 76 | protocol: TCP |
| 77 | command: |
| 78 | - pcloud-installer |
| 79 | - dodo-app |
| 80 | - --repo-addr={{ .Values.repoAddr }} |
| 81 | - --ssh-key=/pcloud/ssh-key/private |
| 82 | - --port=8080 |
| 83 | - --self={{ .Values.self }} |
| 84 | - --namespace={{ .Values.namespace }} # TODO(gio): maybe use .Release.Namespace ? |
| 85 | - --env-config=/pcloud/env-config/config.json |
| 86 | volumeMounts: |
| 87 | - name: ssh-key |
| 88 | readOnly: true |
| 89 | mountPath: /pcloud/ssh-key |
| 90 | - name: env-config |
| 91 | readOnly: true |
| 92 | mountPath: /pcloud/env-config |
| 93 | --- |
| 94 | apiVersion: v1 |
| 95 | kind: Secret |
| 96 | metadata: |
| 97 | name: env-config |
| 98 | type: Opaque |
| 99 | data: |
| 100 | config.json: {{ .Values.envConfig }} |