DodoApp: Prepare dodo-app to support multiple app repositories
Previously Git repository storing configuration for PCloud
environment, linked dodo-app repositories directly. After this change,
dodo-app will first create config repository which will link
individual application repositories. And PCloud env will link to the
config repo. That way dodo-app manger will be able to create multiple
app repositories per installation.
Change-Id: I647cacda7a9a4f241d2acc28ae5d8bbd8c6424d6
diff --git a/core/installer/values-tmpl/dodo-app-instance.cue b/core/installer/values-tmpl/dodo-app-instance.cue
new file mode 100644
index 0000000..e783ffe
--- /dev/null
+++ b/core/installer/values-tmpl/dodo-app-instance.cue
@@ -0,0 +1,68 @@
+import (
+ "encoding/base64"
+)
+
+input: {
+ appName: string
+ repoAddr: string
+ gitRepoPublicKey: string
+ // TODO(gio): auto generate
+ fluxKeys: #SSHKey
+}
+
+name: "Dodo App Instance"
+namespace: "dodo-app-instance"
+readme: "Deploy app by pushing to Git repository"
+description: "Deploy app by pushing to Git repository"
+icon: ""
+_domain: "\(input.subdomain).\(input.network.domain)"
+
+resources: {
+ "config-kustomization": {
+ apiVersion: "kustomize.toolkit.fluxcd.io/v1"
+ kind: "Kustomization"
+ metadata: {
+ name: input.appName
+ namespace: release.namespace
+ }
+ spec: {
+ interval: "1m"
+ path: "./"
+ sourceRef: {
+ kind: "GitRepository"
+ name: "app"
+ namespace: release.namespace
+ }
+ prune: true
+ }
+ }
+ "config-secret": {
+ apiVersion: "v1"
+ kind: "Secret"
+ type: "Opaque"
+ metadata: {
+ name: input.appName
+ namespace: release.namespace
+ }
+ data: {
+ identity: base64.Encode(null, input.fluxKeys.private)
+ "identity.pub": base64.Encode(null, input.fluxKeys.public)
+ known_hosts: base64.Encode(null, "soft-serve.\(release.namespace).svc.cluster.local \(input.gitRepoPublicKey)")
+ }
+ }
+ "config-source": {
+ apiVersion: "source.toolkit.fluxcd.io/v1"
+ kind: "GitRepository"
+ metadata: {
+ name: input.appName
+ namespace: release.namespace
+ }
+ spec: {
+ interval: "1m0s"
+ ref: branch: "dodo"
+ secretRef: name: input.appName
+ timeout: "60s"
+ url: input.repoAddr
+ }
+ }
+}