blob: b8c1359420988bb7ea93ceb483091b772d519088 [file] [log] [blame]
giof8843412024-05-22 16:38:05 +04001apiVersion: rbac.authorization.k8s.io/v1
gio33059762024-07-05 13:19:07 +04002kind: ClusterRole
giof8843412024-05-22 16:38:05 +04003metadata:
gio33059762024-07-05 13:19:07 +04004 name: {{ .Values.clusterRoleName }}
giof8843412024-05-22 16:38:05 +04005rules:
6- apiGroups:
gio33059762024-07-05 13:19:07 +04007 - ""
8 resources:
9 - namespaces
10 verbs:
11 - create
12- apiGroups:
giof8843412024-05-22 16:38:05 +040013 - "batch"
14 resources:
15 - jobs
16 verbs:
17 - create
gio33059762024-07-05 13:19:07 +040018- apiGroups:
19 - "helm.toolkit.fluxcd.io"
20 resources:
21 - helmreleases
22 verbs:
23 - get
giof8843412024-05-22 16:38:05 +040024---
25apiVersion: rbac.authorization.k8s.io/v1
gio33059762024-07-05 13:19:07 +040026kind: ClusterRoleBinding
giof8843412024-05-22 16:38:05 +040027metadata:
gio33059762024-07-05 13:19:07 +040028 name: {{ .Values.clusterRoleName }}
giof8843412024-05-22 16:38:05 +040029roleRef:
30 apiGroup: rbac.authorization.k8s.io
gio33059762024-07-05 13:19:07 +040031 kind: ClusterRole
32 name: {{ .Values.clusterRoleName }}
giof8843412024-05-22 16:38:05 +040033subjects:
34- kind: ServiceAccount
35 name: default
36 namespace: {{ .Release.Namespace }}
37---
gio0eaf2712024-04-14 13:08:46 +040038apiVersion: v1
39kind: Secret
40metadata:
41 name: ssh-key
42type: Opaque
43data:
44 private: {{ .Values.sshPrivateKey }}
45---
46apiVersion: v1
47kind: Service
48metadata:
49 name: dodo-app
gio0eaf2712024-04-14 13:08:46 +040050spec:
51 type: ClusterIP
52 selector:
53 app: dodo-app
54 ports:
55 - name: http
56 port: 80
57 targetPort: http
58 protocol: TCP
59---
60apiVersion: apps/v1
61kind: Deployment
62metadata:
63 name: dodo-app
gio0eaf2712024-04-14 13:08:46 +040064spec:
65 selector:
66 matchLabels:
67 app: dodo-app
68 replicas: 1
69 template:
70 metadata:
71 labels:
72 app: dodo-app
73 spec:
74 volumes:
75 - name: ssh-key
76 secret:
77 secretName: ssh-key
78 - name: env-config
79 secret:
80 secretName: env-config
81 containers:
82 - name: dodo-app
83 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
84 imagePullPolicy: {{ .Values.image.pullPolicy }}
85 ports:
86 - name: http
87 containerPort: 8080
88 protocol: TCP
89 command:
90 - pcloud-installer
91 - dodo-app
92 - --repo-addr={{ .Values.repoAddr }}
93 - --ssh-key=/pcloud/ssh-key/private
94 - --port=8080
95 - --self={{ .Values.self }}
96 - --namespace={{ .Values.namespace }} # TODO(gio): maybe use .Release.Namespace ?
97 - --env-config=/pcloud/env-config/config.json
gio266c04f2024-07-03 14:18:45 +040098 - --app-admin-key={{ .Values.appAdminKey }}
99 - --git-repo-public-key={{ .Values.gitRepoPublicKey }}
gio0eaf2712024-04-14 13:08:46 +0400100 volumeMounts:
101 - name: ssh-key
102 readOnly: true
103 mountPath: /pcloud/ssh-key
104 - name: env-config
105 readOnly: true
106 mountPath: /pcloud/env-config
107---
108apiVersion: v1
109kind: Secret
110metadata:
111 name: env-config
112type: Opaque
113data:
114 config.json: {{ .Values.envConfig }}