diff --git a/momentum-structure/README.md b/momentum-structure/README.md index dcbb7ee..1283329 100644 --- a/momentum-structure/README.md +++ b/momentum-structure/README.md @@ -8,13 +8,13 @@ The structure is as follows (generated with `tree -a -I`): ```bash . -└── {root} - ├── kustomization.yaml - └── {application} # An application e.g. my-app (level 1) +└── momentum-root # This is the root of the repository + ├── kustomization.yaml # This is the root kustomization file + └── {application} ├── _base │ ├── kustomization.yaml │ ├── ns.yaml - │ ├── release.yaml + │ ├── release.yaml # This is the helm release for base │ ├── secrets.yaml │ └── values.yaml ├── _deploy @@ -24,13 +24,13 @@ The structure is as follows (generated with `tree -a -I`): │ ├── secrets.yaml │ └── values.yaml ├── _template - │ ├── secrets.yaml # The helmrelease keys for secrets templated with go template - │ └── values.yaml # The helmrelease values templated with go template + │ ├── secrets.yaml + │ └── values.yaml ├── kustomization.yaml - ├── ns.yaml # The namespace of the application (to store the helmrepository stuff) - ├── repository.yaml # The helm repository of the application - ├── {deployment}.yaml # A deployment of the application, which is a flux kustomization - └── {stage} # A stage of the application e.g. cluster-test, cluster-prod (level 2) + ├── ns.yaml + ├── repository.yaml + ├── {deployment}.yaml + └── {stage} ├── _base │ ├── kustomization.yaml │ ├── release.yaml @@ -47,7 +47,7 @@ The structure is as follows (generated with `tree -a -I`): │ └── values.yaml ├── kustomization.yaml ├── {deployment}.yaml - └── {stage} # A stage of the application e.g. test,prod (level 3) + └── {stage} ├── _base │ ├── kustomization.yaml │ ├── release.yaml diff --git a/momentum-structure/{root}/kustomization.yaml b/momentum-structure/momentum-root/kustomization.yaml similarity index 100% rename from momentum-structure/{root}/kustomization.yaml rename to momentum-structure/momentum-root/kustomization.yaml diff --git a/momentum-structure/{root}/{application}/_base/kustomization.yaml b/momentum-structure/momentum-root/{application}/_base/kustomization.yaml similarity index 93% rename from momentum-structure/{root}/{application}/_base/kustomization.yaml rename to momentum-structure/momentum-root/{application}/_base/kustomization.yaml index e52824c..c95e0d6 100644 --- a/momentum-structure/{root}/{application}/_base/kustomization.yaml +++ b/momentum-structure/momentum-root/{application}/_base/kustomization.yaml @@ -11,7 +11,7 @@ configMapGenerator: disableNameSuffixHash: true secretGenerator: - files: - - secrets.yaml + - values.yaml=secrets.yaml name: base-secrets options: disableNameSuffixHash: true diff --git a/momentum-structure/{root}/{application}/_base/ns.yaml b/momentum-structure/momentum-root/{application}/_base/ns.yaml similarity index 74% rename from momentum-structure/{root}/{application}/_base/ns.yaml rename to momentum-structure/momentum-root/{application}/_base/ns.yaml index 01e4139..a881f74 100644 --- a/momentum-structure/{root}/{application}/_base/ns.yaml +++ b/momentum-structure/momentum-root/{application}/_base/ns.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: patch \ No newline at end of file + name: patch diff --git a/momentum-structure/{root}/{application}/_base/release.yaml b/momentum-structure/momentum-root/{application}/_base/release.yaml similarity index 87% rename from momentum-structure/{root}/{application}/_base/release.yaml rename to momentum-structure/momentum-root/{application}/_base/release.yaml index 3479dbf..69fc77b 100644 --- a/momentum-structure/{root}/{application}/_base/release.yaml +++ b/momentum-structure/momentum-root/{application}/_base/release.yaml @@ -3,10 +3,10 @@ kind: HelmRelease metadata: name: '{application}' spec: - interval: 10m + interval: '{application-interval}' chart: spec: - chart: '{application-chart}' + version: '{application-chart-version}' sourceRef: kind: HelmRepository name: '{application}-charts' diff --git a/momentum-structure/momentum-root/{application}/_base/secrets.yaml b/momentum-structure/momentum-root/{application}/_base/secrets.yaml new file mode 100644 index 0000000..c423301 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_base/secrets.yaml @@ -0,0 +1 @@ +base-secretkey: base-secretvalue diff --git a/momentum-structure/momentum-root/{application}/_base/values.yaml b/momentum-structure/momentum-root/{application}/_base/values.yaml new file mode 100644 index 0000000..a6694a3 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_base/values.yaml @@ -0,0 +1 @@ +base-key: base-value diff --git a/momentum-structure/{root}/{application}/_deploy/{deployment}/kustomization.yaml b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/kustomization.yaml similarity index 93% rename from momentum-structure/{root}/{application}/_deploy/{deployment}/kustomization.yaml rename to momentum-structure/momentum-root/{application}/_deploy/{deployment}/kustomization.yaml index f04edeb..bdd24f4 100644 --- a/momentum-structure/{root}/{application}/_deploy/{deployment}/kustomization.yaml +++ b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/kustomization.yaml @@ -11,7 +11,7 @@ configMapGenerator: disableNameSuffixHash: true secretGenerator: - files: - - secrets.yaml + - values.yaml=secrets.yaml name: deploy-secrets options: disableNameSuffixHash: true diff --git a/momentum-structure/momentum-root/{application}/_deploy/{deployment}/release.yaml b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/release.yaml new file mode 100644 index 0000000..ebb5326 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/release.yaml @@ -0,0 +1,9 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: '{application}' +spec: + interval: '{application-interval}' + chart: + spec: + version: '{application-chart-version}' diff --git a/momentum-structure/momentum-root/{application}/_deploy/{deployment}/secrets.yaml b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/secrets.yaml new file mode 100644 index 0000000..152a252 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/secrets.yaml @@ -0,0 +1 @@ +deploy-secretkey: deploy-secretvalue diff --git a/momentum-structure/momentum-root/{application}/_deploy/{deployment}/values.yaml b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/values.yaml new file mode 100644 index 0000000..7e917e2 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_deploy/{deployment}/values.yaml @@ -0,0 +1 @@ +deploy-key: deploy-value diff --git a/momentum-structure/momentum-root/{application}/_template/secrets.yaml b/momentum-structure/momentum-root/{application}/_template/secrets.yaml new file mode 100644 index 0000000..4a0dda1 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_template/secrets.yaml @@ -0,0 +1 @@ +template-secretkey: {{ .template-secretvalue }} diff --git a/momentum-structure/momentum-root/{application}/_template/values.yaml b/momentum-structure/momentum-root/{application}/_template/values.yaml new file mode 100644 index 0000000..53d5d19 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/_template/values.yaml @@ -0,0 +1 @@ +template-key: {{.template-value}} diff --git a/momentum-structure/{root}/{application}/kustomization.yaml b/momentum-structure/momentum-root/{application}/kustomization.yaml similarity index 100% rename from momentum-structure/{root}/{application}/kustomization.yaml rename to momentum-structure/momentum-root/{application}/kustomization.yaml diff --git a/momentum-structure/{root}/{application}/ns.yaml b/momentum-structure/momentum-root/{application}/ns.yaml similarity index 100% rename from momentum-structure/{root}/{application}/ns.yaml rename to momentum-structure/momentum-root/{application}/ns.yaml diff --git a/momentum-structure/{root}/{application}/repository.yaml b/momentum-structure/momentum-root/{application}/repository.yaml similarity index 100% rename from momentum-structure/{root}/{application}/repository.yaml rename to momentum-structure/momentum-root/{application}/repository.yaml diff --git a/momentum-structure/{root}/{application}/{deployment}.yaml b/momentum-structure/momentum-root/{application}/{deployment}.yaml similarity index 61% rename from momentum-structure/{root}/{application}/{deployment}.yaml rename to momentum-structure/momentum-root/{application}/{deployment}.yaml index eb389c9..1a417f0 100644 --- a/momentum-structure/{root}/{application}/{deployment}.yaml +++ b/momentum-structure/momentum-root/{application}/{deployment}.yaml @@ -2,9 +2,11 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: '{deployment}' + namespace: flux-system spec: + targetNamespace: '{deployment}' interval: 5m0s - path: ./_deploy/{deployment}/ + path: ./momentum-root/{application}/_deploy/{deployment}/ prune: true sourceRef: kind: GitRepository diff --git a/momentum-structure/momentum-root/{application}/{stage}/_base/kustomization.yaml b/momentum-structure/momentum-root/{application}/{stage}/_base/kustomization.yaml new file mode 100644 index 0000000..d3f9e47 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_base/kustomization.yaml @@ -0,0 +1,23 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../_base/ +configMapGenerator: +- files: + - values.yaml + name: '{stage}-values' + options: + disableNameSuffixHash: true +secretGenerator: +- files: + - values.yaml=secrets.yaml + name: '{stage}-secrets' + options: + disableNameSuffixHash: true +patches: + - path: release.yaml +labels: +- includeSelectors: true + pairs: + gitops.natron.io/application: '{application}' + gitops.natron.io/stage: '{stage}' diff --git a/momentum-structure/{root}/{application}/{stage}/_base/release.yaml b/momentum-structure/momentum-root/{application}/{stage}/_base/release.yaml similarity index 79% rename from momentum-structure/{root}/{application}/{stage}/_base/release.yaml rename to momentum-structure/momentum-root/{application}/{stage}/_base/release.yaml index 560942e..86badad 100644 --- a/momentum-structure/{root}/{application}/{stage}/_base/release.yaml +++ b/momentum-structure/momentum-root/{application}/{stage}/_base/release.yaml @@ -3,6 +3,10 @@ kind: HelmRelease metadata: name: '{application}' spec: + interval: '{application-interval}' + chart: + spec: + version: '{application-chart-version}' valuesFrom: - kind: ConfigMap name: base-values diff --git a/momentum-structure/momentum-root/{application}/{stage}/_base/secrets.yaml b/momentum-structure/momentum-root/{application}/{stage}/_base/secrets.yaml new file mode 100644 index 0000000..f67a17d --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_base/secrets.yaml @@ -0,0 +1 @@ +stage-base-secretkey: stage-base-secretvalue diff --git a/momentum-structure/momentum-root/{application}/{stage}/_base/values.yaml b/momentum-structure/momentum-root/{application}/{stage}/_base/values.yaml new file mode 100644 index 0000000..9fd259c --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_base/values.yaml @@ -0,0 +1 @@ +stage-base-key: stage-base-value diff --git a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/kustomization.yaml b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/kustomization.yaml similarity index 93% rename from momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/kustomization.yaml rename to momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/kustomization.yaml index 9646f77..5908e49 100644 --- a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/kustomization.yaml +++ b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/kustomization.yaml @@ -11,7 +11,7 @@ configMapGenerator: disableNameSuffixHash: true secretGenerator: - files: - - secrets.yaml + - values.yaml=secrets.yaml name: deploy-secrets options: disableNameSuffixHash: true diff --git a/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/release.yaml b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/release.yaml new file mode 100644 index 0000000..ebb5326 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/release.yaml @@ -0,0 +1,9 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: '{application}' +spec: + interval: '{application-interval}' + chart: + spec: + version: '{application-chart-version}' diff --git a/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/secrets.yaml b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/secrets.yaml new file mode 100644 index 0000000..152a252 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/secrets.yaml @@ -0,0 +1 @@ +deploy-secretkey: deploy-secretvalue diff --git a/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/values.yaml b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/values.yaml new file mode 100644 index 0000000..7e917e2 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_deploy/{deployment}/values.yaml @@ -0,0 +1 @@ +deploy-key: deploy-value diff --git a/momentum-structure/momentum-root/{application}/{stage}/_template/secrets.yaml b/momentum-structure/momentum-root/{application}/{stage}/_template/secrets.yaml new file mode 100644 index 0000000..4a0dda1 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_template/secrets.yaml @@ -0,0 +1 @@ +template-secretkey: {{ .template-secretvalue }} diff --git a/momentum-structure/momentum-root/{application}/{stage}/_template/values.yaml b/momentum-structure/momentum-root/{application}/{stage}/_template/values.yaml new file mode 100644 index 0000000..53d5d19 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/_template/values.yaml @@ -0,0 +1 @@ +template-key: {{.template-value}} diff --git a/momentum-structure/{root}/{application}/{stage}/kustomization.yaml b/momentum-structure/momentum-root/{application}/{stage}/kustomization.yaml similarity index 100% rename from momentum-structure/{root}/{application}/{stage}/kustomization.yaml rename to momentum-structure/momentum-root/{application}/{stage}/kustomization.yaml diff --git a/momentum-structure/{root}/{application}/{stage}/{deployment}.yaml b/momentum-structure/momentum-root/{application}/{stage}/{deployment}.yaml similarity index 65% rename from momentum-structure/{root}/{application}/{stage}/{deployment}.yaml rename to momentum-structure/momentum-root/{application}/{stage}/{deployment}.yaml index 3570465..3ac73b6 100644 --- a/momentum-structure/{root}/{application}/{stage}/{deployment}.yaml +++ b/momentum-structure/momentum-root/{application}/{stage}/{deployment}.yaml @@ -2,9 +2,11 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: '{deployment}-{stage}' # next stage would be '{deployment}-{stage}-{next_stage}' + namespace: flux-system spec: + targetNamespace: '{deployment}-{stage}' interval: 5m0s - path: ./_deploy/{deployment}/ + path: ./momentum-root/{application}/{stage}/_deploy/{deployment}/ prune: true sourceRef: kind: GitRepository diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/kustomization.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/kustomization.yaml new file mode 100644 index 0000000..9cf1767 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/kustomization.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../../_base/ +configMapGenerator: +- files: + - values.yaml + name: '{stage}-{stage}-values' + options: + disableNameSuffixHash: true +secretGenerator: +- files: + - values.yaml=secrets.yaml + name: '{stage}-{stage}-secrets' + options: + disableNameSuffixHash: true +patches: + - path: release.yaml diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/release.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/release.yaml similarity index 83% rename from momentum-structure/{root}/{application}/{stage}/{stage}/_base/release.yaml rename to momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/release.yaml index dcda8a7..9f374f2 100644 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/release.yaml +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/release.yaml @@ -3,6 +3,10 @@ kind: HelmRelease metadata: name: '{application}' spec: + interval: '{application-interval}' + chart: + spec: + version: '{application-chart-version}' valuesFrom: - kind: ConfigMap name: base-values diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/secrets.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/secrets.yaml new file mode 100644 index 0000000..f67a17d --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/secrets.yaml @@ -0,0 +1 @@ +stage-base-secretkey: stage-base-secretvalue diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/values.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/values.yaml new file mode 100644 index 0000000..9fd259c --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_base/values.yaml @@ -0,0 +1 @@ +stage-base-key: stage-base-value diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/kustomization.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/kustomization.yaml similarity index 93% rename from momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/kustomization.yaml rename to momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/kustomization.yaml index 9f93013..177a543 100644 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/kustomization.yaml +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/kustomization.yaml @@ -11,7 +11,7 @@ configMapGenerator: disableNameSuffixHash: true secretGenerator: - files: - - secrets.yaml + - values.yaml=secrets.yaml name: deploy-secrets options: disableNameSuffixHash: true diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/release.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/release.yaml new file mode 100644 index 0000000..ebb5326 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/release.yaml @@ -0,0 +1,9 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: '{application}' +spec: + interval: '{application-interval}' + chart: + spec: + version: '{application-chart-version}' diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/secrets.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/secrets.yaml new file mode 100644 index 0000000..152a252 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/secrets.yaml @@ -0,0 +1 @@ +deploy-secretkey: deploy-secretvalue diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/values.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/values.yaml new file mode 100644 index 0000000..7e917e2 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/values.yaml @@ -0,0 +1 @@ +deploy-key: deploy-value diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_template/secrets.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_template/secrets.yaml new file mode 100644 index 0000000..4a0dda1 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_template/secrets.yaml @@ -0,0 +1 @@ +template-secretkey: {{ .template-secretvalue }} diff --git a/momentum-structure/momentum-root/{application}/{stage}/{stage}/_template/values.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_template/values.yaml new file mode 100644 index 0000000..53d5d19 --- /dev/null +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/_template/values.yaml @@ -0,0 +1 @@ +template-key: {{.template-value}} diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/kustomization.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/kustomization.yaml similarity index 100% rename from momentum-structure/{root}/{application}/{stage}/{stage}/kustomization.yaml rename to momentum-structure/momentum-root/{application}/{stage}/{stage}/kustomization.yaml diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/{deployment}.yaml b/momentum-structure/momentum-root/{application}/{stage}/{stage}/{deployment}.yaml similarity index 54% rename from momentum-structure/{root}/{application}/{stage}/{stage}/{deployment}.yaml rename to momentum-structure/momentum-root/{application}/{stage}/{stage}/{deployment}.yaml index 07e0950..46edcd3 100644 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/{deployment}.yaml +++ b/momentum-structure/momentum-root/{application}/{stage}/{stage}/{deployment}.yaml @@ -1,10 +1,12 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: '{deployment}-{stage}-{stage}' # next stage would be '{deployment}-{stage}--{stage}-{next_stage}' + name: '{deployment}-{stage}-{stage}' # next stage would be '{deployment}-{stage}-{stage}-{next_stage}' + namespace: flux-system spec: + targetNamespace: '{deployment}-{stage}-{stage}' interval: 5m0s - path: ./_deploy/{deployment}/ + path: ./momentum-root/{application}/{stage}/{stage}/_deploy/{deployment}/ prune: true sourceRef: kind: GitRepository diff --git a/momentum-structure/test.yaml b/momentum-structure/test.yaml deleted file mode 100644 index d6e7145..0000000 --- a/momentum-structure/test.yaml +++ /dev/null @@ -1,123 +0,0 @@ -apiVersion: v1 -data: - values.yaml: 'base-key: base-value' -kind: ConfigMap -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: base-values - namespace: '{deployment}-{stage}-{stage}' ---- -apiVersion: v1 -data: - values.yaml: 'deploy-key: deploy-value' -kind: ConfigMap -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: deploy-values - namespace: '{deployment}-{stage}-{stage}' ---- -apiVersion: v1 -data: - values.yaml: 'stage-base-key: stage-base-value' -kind: ConfigMap -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: '{stage}-values' - namespace: '{deployment}-{stage}-{stage}' ---- -apiVersion: v1 -data: - values.yaml: 'stage-base-key: stage-base-value' -kind: ConfigMap -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: '{stage}-{stage}-values' - namespace: '{deployment}-{stage}-{stage}' ---- -apiVersion: v1 -data: - secrets.yaml: YmFzZS1zZWNyZXRrZXk6IGJhc2Utc2VjcmV0dmFsdWU= -kind: Secret -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: base-secrets - namespace: '{deployment}-{stage}-{stage}' -type: Opaque ---- -apiVersion: v1 -data: - secrets.yaml: ZGVwbG95LXNlY3JldGtleTogZGVwbG95LXNlY3JldHZhbHVl -kind: Secret -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: deploy-secrets - namespace: '{deployment}-{stage}-{stage}' -type: Opaque ---- -apiVersion: v1 -data: - secrets.yaml: c3RhZ2UtYmFzZS1zZWNyZXRrZXk6IHN0YWdlLWJhc2Utc2VjcmV0dmFsdWU= -kind: Secret -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: '{stage}-secrets' - namespace: '{deployment}-{stage}-{stage}' -type: Opaque ---- -apiVersion: v1 -data: - secrets.yaml: c3RhZ2UtYmFzZS1zZWNyZXRrZXk6IHN0YWdlLWJhc2Utc2VjcmV0dmFsdWU= -kind: Secret -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: '{stage}-{stage}-secrets' - namespace: '{deployment}-{stage}-{stage}' -type: Opaque ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - labels: - gitops.natron.io/stage: '{stage}-{stage}' - name: '{application}' - namespace: '{deployment}-{stage}-{stage}' -spec: - chart: - spec: - chart: '{application-chart}' - sourceRef: - kind: HelmRepository - name: '{application}-charts' - namespace: '{application}' - install: - remediation: - remediateLastFailure: true - interval: 10m - upgrade: - remediation: - remediateLastFailure: true - valuesFrom: - - kind: ConfigMap - name: base-values - - kind: Secret - name: base-secrets - - kind: ConfigMap - name: '{stage}-values' - - kind: Secret - name: '{stage}-secrets' - - kind: ConfigMap - name: '{stage}-{stage}-values' - - kind: Secret - name: '{stage}-{stage}-secrets' - - kind: ConfigMap - name: deploy-values - - kind: Secret - name: deploy-secrets diff --git a/momentum-structure/{root}/{application}/_base/secrets.yaml b/momentum-structure/{root}/{application}/_base/secrets.yaml deleted file mode 100644 index 85931f7..0000000 --- a/momentum-structure/{root}/{application}/_base/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -base-secretkey: base-secretvalue \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/_base/values.yaml b/momentum-structure/{root}/{application}/_base/values.yaml deleted file mode 100644 index 28e0cff..0000000 --- a/momentum-structure/{root}/{application}/_base/values.yaml +++ /dev/null @@ -1 +0,0 @@ -base-key: base-value \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/_deploy/{deployment}/release.yaml b/momentum-structure/{root}/{application}/_deploy/{deployment}/release.yaml deleted file mode 100644 index 82b2fa4..0000000 --- a/momentum-structure/{root}/{application}/_deploy/{deployment}/release.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: '{application}' diff --git a/momentum-structure/{root}/{application}/_deploy/{deployment}/secrets.yaml b/momentum-structure/{root}/{application}/_deploy/{deployment}/secrets.yaml deleted file mode 100644 index 0d94305..0000000 --- a/momentum-structure/{root}/{application}/_deploy/{deployment}/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -deploy-secretkey: deploy-secretvalue \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/_deploy/{deployment}/values.yaml b/momentum-structure/{root}/{application}/_deploy/{deployment}/values.yaml deleted file mode 100644 index 833e9f5..0000000 --- a/momentum-structure/{root}/{application}/_deploy/{deployment}/values.yaml +++ /dev/null @@ -1 +0,0 @@ -deploy-key: deploy-value \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/_template/secrets.yaml b/momentum-structure/{root}/{application}/_template/secrets.yaml deleted file mode 100644 index db87856..0000000 --- a/momentum-structure/{root}/{application}/_template/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -template-secretkey: {{ .template-secretvalue }} \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/_template/values.yaml b/momentum-structure/{root}/{application}/_template/values.yaml deleted file mode 100644 index e9a9104..0000000 --- a/momentum-structure/{root}/{application}/_template/values.yaml +++ /dev/null @@ -1 +0,0 @@ -template-key: {{.template-value}} \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/_base/kustomization.yaml b/momentum-structure/{root}/{application}/{stage}/_base/kustomization.yaml deleted file mode 100644 index 7f59bfd..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_base/kustomization.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../../_base/release.yaml -configMapGenerator: -- files: - - ../../_base/values.yaml - name: base-values - options: - disableNameSuffixHash: true -- files: - - values.yaml - name: '{stage}-values' - options: - disableNameSuffixHash: true -secretGenerator: -- files: - - ../../_base/secrets.yaml - name: base-secrets - options: - disableNameSuffixHash: true -- files: - - secrets.yaml - name: '{stage}-secrets' - options: - disableNameSuffixHash: true -patches: - - path: release.yaml diff --git a/momentum-structure/{root}/{application}/{stage}/_base/secrets.yaml b/momentum-structure/{root}/{application}/{stage}/_base/secrets.yaml deleted file mode 100644 index 86bb9ca..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_base/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -stage-base-secretkey: stage-base-secretvalue \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/_base/values.yaml b/momentum-structure/{root}/{application}/{stage}/_base/values.yaml deleted file mode 100644 index 22682de..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_base/values.yaml +++ /dev/null @@ -1 +0,0 @@ -stage-base-key: stage-base-value \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/release.yaml b/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/release.yaml deleted file mode 100644 index 82b2fa4..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/release.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: '{application}' diff --git a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/secrets.yaml b/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/secrets.yaml deleted file mode 100644 index 0d94305..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -deploy-secretkey: deploy-secretvalue \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/values.yaml b/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/values.yaml deleted file mode 100644 index 833e9f5..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_deploy/{deployment}/values.yaml +++ /dev/null @@ -1 +0,0 @@ -deploy-key: deploy-value \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/_template/secrets.yaml b/momentum-structure/{root}/{application}/{stage}/_template/secrets.yaml deleted file mode 100644 index db87856..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_template/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -template-secretkey: {{ .template-secretvalue }} \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/_template/values.yaml b/momentum-structure/{root}/{application}/{stage}/_template/values.yaml deleted file mode 100644 index e9a9104..0000000 --- a/momentum-structure/{root}/{application}/{stage}/_template/values.yaml +++ /dev/null @@ -1 +0,0 @@ -template-key: {{.template-value}} \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/kustomization.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_base/kustomization.yaml deleted file mode 100644 index 8087c2a..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/kustomization.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../../../_base/release.yaml -configMapGenerator: -- files: - - ../../../_base/values.yaml - name: base-values - options: - disableNameSuffixHash: true -- files: - - ../../_base/values.yaml - name: '{stage}-values' - options: - disableNameSuffixHash: true -- files: - - values.yaml - name: '{stage}-{stage}-values' - options: - disableNameSuffixHash: true -secretGenerator: -- files: - - ../../../_base/secrets.yaml - name: base-secrets - options: - disableNameSuffixHash: true -- files: - - ../../_base/secrets.yaml - name: '{stage}-secrets' - options: - disableNameSuffixHash: true -- files: - - secrets.yaml - name: '{stage}-{stage}-secrets' - options: - disableNameSuffixHash: true -patches: - - path: release.yaml diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/secrets.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_base/secrets.yaml deleted file mode 100644 index 86bb9ca..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -stage-base-secretkey: stage-base-secretvalue \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/values.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_base/values.yaml deleted file mode 100644 index 22682de..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_base/values.yaml +++ /dev/null @@ -1 +0,0 @@ -stage-base-key: stage-base-value \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/release.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/release.yaml deleted file mode 100644 index 82b2fa4..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/release.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: '{application}' diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/secrets.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/secrets.yaml deleted file mode 100644 index 0d94305..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -deploy-secretkey: deploy-secretvalue \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/values.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/values.yaml deleted file mode 100644 index 833e9f5..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_deploy/{deployment}/values.yaml +++ /dev/null @@ -1 +0,0 @@ -deploy-key: deploy-value \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_template/secrets.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_template/secrets.yaml deleted file mode 100644 index db87856..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_template/secrets.yaml +++ /dev/null @@ -1 +0,0 @@ -template-secretkey: {{ .template-secretvalue }} \ No newline at end of file diff --git a/momentum-structure/{root}/{application}/{stage}/{stage}/_template/values.yaml b/momentum-structure/{root}/{application}/{stage}/{stage}/_template/values.yaml deleted file mode 100644 index e9a9104..0000000 --- a/momentum-structure/{root}/{application}/{stage}/{stage}/_template/values.yaml +++ /dev/null @@ -1 +0,0 @@ -template-key: {{.template-value}} \ No newline at end of file