update
diff --git a/charts/dodo-app/.helmignore b/charts/dodo-app/.helmignore
new file mode 100644
index 0000000..0e8a0eb
--- /dev/null
+++ b/charts/dodo-app/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/charts/dodo-app/Chart.yaml b/charts/dodo-app/Chart.yaml
new file mode 100644
index 0000000..b91b7b9
--- /dev/null
+++ b/charts/dodo-app/Chart.yaml
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: dodo-app
+description: A Helm chart for updaring Dodo apps
+type: application
+version: 0.0.1
+appVersion: "0.0.1"
diff --git a/charts/dodo-app/templates/install.yaml b/charts/dodo-app/templates/install.yaml
new file mode 100644
index 0000000..58c920c
--- /dev/null
+++ b/charts/dodo-app/templates/install.yaml
@@ -0,0 +1,149 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: {{ .Values.clusterRoleName }}
+rules:
+- apiGroups:
+ - ""
+ resources:
+ - namespaces
+ verbs:
+ - create
+- apiGroups:
+ - "batch"
+ resources:
+ - jobs
+ verbs:
+ - create
+- apiGroups:
+ - "helm.toolkit.fluxcd.io"
+ resources:
+ - helmreleases
+ verbs:
+ - get
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: {{ .Values.clusterRoleName }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: {{ .Values.clusterRoleName }}
+subjects:
+- kind: ServiceAccount
+ name: default
+ namespace: {{ .Release.Namespace }}
+---
+apiVersion: v1
+kind: Secret
+metadata:
+ name: ssh-key
+type: Opaque
+data:
+ private: {{ .Values.sshPrivateKey }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: api
+spec:
+ type: ClusterIP
+ selector:
+ app: dodo-app
+ ports:
+ - name: http
+ port: 80
+ targetPort: api
+ protocol: TCP
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: web
+spec:
+ type: ClusterIP
+ selector:
+ app: dodo-app
+ ports:
+ - name: http
+ port: 80
+ targetPort: http
+ protocol: TCP
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: dodo-app
+spec:
+ selector:
+ matchLabels:
+ app: dodo-app
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ app: dodo-app
+ spec:
+ volumes:
+ - name: ssh-key
+ secret:
+ secretName: ssh-key
+ - name: env-config
+ secret:
+ secretName: env-config
+ - name: db
+ persistentVolumeClaim:
+ claimName: {{ .Values.persistentVolumeClaimName }}
+ initContainers:
+ - name: volume-permissions
+ image: busybox:latest
+ command: ["sh", "-c", "chmod -Rv 777 /dodo-app/db"]
+ volumeMounts:
+ - name: db
+ mountPath: /dodo-app/db
+ containers:
+ - name: dodo-app
+ image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ ports:
+ - name: http
+ containerPort: {{ .Values.port }}
+ protocol: TCP
+ - name: api
+ containerPort: {{ .Values.apiPort }}
+ protocol: TCP
+ command:
+ - pcloud-installer
+ - dodo-app
+ - --repo-addr={{ .Values.repoAddr }}
+ - --ssh-key=/pcloud/ssh-key/private
+ - --port={{ .Values.port }}
+ - --api-port={{ .Values.apiPort }}
+ - --self={{ .Values.self }}
+ - --repo-public-addr={{ .Values.repoPublicAddr }}
+ - --namespace={{ .Values.namespace }} # TODO(gio): maybe use .Release.Namespace ?
+ - --env-app-manager-addr={{ .Values.envAppManagerAddr }}
+ - --env-config=/pcloud/env-config/config.json
+ - --git-repo-public-key={{ .Values.gitRepoPublicKey }}
+ - --db=/dodo-app/db/apps.db
+ - --networks={{ .Values.allowedNetworks }}
+ - --external={{ .Values.external }}
+ - --fetch-users-addr={{ .Values.fetchUsersAddr }}
+ volumeMounts:
+ - name: ssh-key
+ readOnly: true
+ mountPath: /pcloud/ssh-key
+ - name: env-config
+ readOnly: true
+ mountPath: /pcloud/env-config
+ - name: db
+ mountPath: /dodo-app/db
+---
+apiVersion: v1
+kind: Secret
+metadata:
+ name: env-config
+type: Opaque
+data:
+ config.json: {{ .Values.envConfig }}
diff --git a/charts/dodo-app/values.yaml b/charts/dodo-app/values.yaml
new file mode 100644
index 0000000..b1d57c4
--- /dev/null
+++ b/charts/dodo-app/values.yaml
@@ -0,0 +1,19 @@
+image:
+ repository: giolekva/pcloud-installer
+ tag: latest
+ pullPolicy: Always
+port: 8080
+apiPort: 8081
+clusterRoleName: dodo-app-creator
+repoAddr: 192.168.0.11
+sshPrivateKey: key
+self: ""
+repoPublicAddr: ""
+namespace: ""
+envAppManagerAddr: ""
+envConfig: ""
+gitRepoPublicKey: ""
+persistentVolumeClaimName: ""
+allowedNetworks: ""
+external: false
+fetchUsersAddr: ""