blob: 4746869255cebf30f329999f2453bc6daa81587c [file] [log] [blame]
giof8843412024-05-22 16:38:05 +04001apiVersion: rbac.authorization.k8s.io/v1
2kind: Role
3metadata:
4 name: job-creator
5rules:
6- apiGroups:
7 - "batch"
8 resources:
9 - jobs
10 verbs:
11 - create
12---
13apiVersion: rbac.authorization.k8s.io/v1
14kind: RoleBinding
15metadata:
16 name: job-creator
17roleRef:
18 apiGroup: rbac.authorization.k8s.io
19 kind: Role
20 name: job-creator
21subjects:
22- kind: ServiceAccount
23 name: default
24 namespace: {{ .Release.Namespace }}
25---
gio0eaf2712024-04-14 13:08:46 +040026apiVersion: v1
27kind: Secret
28metadata:
29 name: ssh-key
30type: Opaque
31data:
32 private: {{ .Values.sshPrivateKey }}
33---
34apiVersion: v1
35kind: Service
36metadata:
37 name: dodo-app
gio0eaf2712024-04-14 13:08:46 +040038spec:
39 type: ClusterIP
40 selector:
41 app: dodo-app
42 ports:
43 - name: http
44 port: 80
45 targetPort: http
46 protocol: TCP
47---
48apiVersion: apps/v1
49kind: Deployment
50metadata:
51 name: dodo-app
gio0eaf2712024-04-14 13:08:46 +040052spec:
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---
94apiVersion: v1
95kind: Secret
96metadata:
97 name: env-config
98type: Opaque
99data:
100 config.json: {{ .Values.envConfig }}