blob: 9a9c2fcc959802b6b2a9fa4cabe1cd139c88eedb [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:
gioa60f0de2024-07-08 10:49:48 +040049 name: api
50spec:
51 type: ClusterIP
52 selector:
53 app: dodo-app
54 ports:
55 - name: http
56 port: 80
57 targetPort: api
58 protocol: TCP
59---
60apiVersion: v1
61kind: Service
62metadata:
63 name: web
gio0eaf2712024-04-14 13:08:46 +040064spec:
65 type: ClusterIP
66 selector:
67 app: dodo-app
68 ports:
69 - name: http
70 port: 80
71 targetPort: http
72 protocol: TCP
73---
74apiVersion: apps/v1
75kind: Deployment
76metadata:
77 name: dodo-app
gio0eaf2712024-04-14 13:08:46 +040078spec:
79 selector:
80 matchLabels:
81 app: dodo-app
82 replicas: 1
83 template:
84 metadata:
85 labels:
86 app: dodo-app
87 spec:
88 volumes:
89 - name: ssh-key
90 secret:
91 secretName: ssh-key
92 - name: env-config
93 secret:
94 secretName: env-config
gioa60f0de2024-07-08 10:49:48 +040095 - name: db
96 persistentVolumeClaim:
97 claimName: {{ .Values.persistentVolumeClaimName }}
98 initContainers:
99 - name: volume-permissions
100 image: busybox:latest
101 command: ["sh", "-c", "chmod -Rv 777 /dodo-app/db"]
102 volumeMounts:
103 - name: db
104 mountPath: /dodo-app/db
gio0eaf2712024-04-14 13:08:46 +0400105 containers:
106 - name: dodo-app
107 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
108 imagePullPolicy: {{ .Values.image.pullPolicy }}
109 ports:
110 - name: http
gioa60f0de2024-07-08 10:49:48 +0400111 containerPort: {{ .Values.port }}
112 protocol: TCP
113 - name: api
114 containerPort: {{ .Values.apiPort }}
gio0eaf2712024-04-14 13:08:46 +0400115 protocol: TCP
116 command:
117 - pcloud-installer
118 - dodo-app
119 - --repo-addr={{ .Values.repoAddr }}
120 - --ssh-key=/pcloud/ssh-key/private
gioa60f0de2024-07-08 10:49:48 +0400121 - --port={{ .Values.port }}
122 - --api-port={{ .Values.apiPort }}
gio0eaf2712024-04-14 13:08:46 +0400123 - --self={{ .Values.self }}
gioc81a8472024-09-24 13:06:19 +0200124 - --self-public={{ .Values.selfPublic }}
gio11617ac2024-07-15 16:09:04 +0400125 - --repo-public-addr={{ .Values.repoPublicAddr }}
gio0eaf2712024-04-14 13:08:46 +0400126 - --namespace={{ .Values.namespace }} # TODO(gio): maybe use .Release.Namespace ?
giocb34ad22024-07-11 08:01:13 +0400127 - --env-app-manager-addr={{ .Values.envAppManagerAddr }}
gio0eaf2712024-04-14 13:08:46 +0400128 - --env-config=/pcloud/env-config/config.json
gio266c04f2024-07-03 14:18:45 +0400129 - --git-repo-public-key={{ .Values.gitRepoPublicKey }}
gioa60f0de2024-07-08 10:49:48 +0400130 - --db=/dodo-app/db/apps.db
gio23bdc1b2024-07-11 16:07:47 +0400131 - --networks={{ .Values.allowedNetworks }}
gio11617ac2024-07-15 16:09:04 +0400132 - --external={{ .Values.external }}
giocafd4e62024-07-31 10:53:40 +0400133 - --fetch-users-addr={{ .Values.fetchUsersAddr }}
gio7fbd4ad2024-08-27 10:06:39 +0400134 - --headscale-api-addr={{ .Values.headscaleAPIAddr }}
gio0eaf2712024-04-14 13:08:46 +0400135 volumeMounts:
136 - name: ssh-key
137 readOnly: true
138 mountPath: /pcloud/ssh-key
139 - name: env-config
140 readOnly: true
141 mountPath: /pcloud/env-config
gioa60f0de2024-07-08 10:49:48 +0400142 - name: db
143 mountPath: /dodo-app/db
gio0eaf2712024-04-14 13:08:46 +0400144---
145apiVersion: v1
146kind: Secret
147metadata:
148 name: env-config
149type: Opaque
150data:
151 config.json: {{ .Values.envConfig }}