From b147e50ea08ff6aa8ab4e4c567a61376f6d87a5e Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 23 Feb 2024 16:47:52 +0200 Subject: [PATCH] Onboard tenants on the prod-us cluster Signed-off-by: Stefan Prodan --- clusters/prod-us/apps-tenant.yaml | 29 +++++++++++++++++++++++++++++ clusters/prod-us/infra-tenant.yaml | 29 +++++++++++++++++++++++++++++ clusters/prod-us/runtime-info.yaml | 14 ++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 clusters/prod-us/apps-tenant.yaml create mode 100644 clusters/prod-us/infra-tenant.yaml create mode 100644 clusters/prod-us/runtime-info.yaml diff --git a/clusters/prod-us/apps-tenant.yaml b/clusters/prod-us/apps-tenant.yaml new file mode 100644 index 0000000..1ac1c95 --- /dev/null +++ b/clusters/prod-us/apps-tenant.yaml @@ -0,0 +1,29 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: flux-apps-tenant + namespace: flux-system +spec: + serviceAccountName: kustomize-controller + dependsOn: + - name: flux-infra-tenant + interval: 12h + retryInterval: 3m + path: ./tenants/apps + prune: true + sourceRef: + kind: GitRepository + name: flux-system + postBuild: + substituteFrom: + - kind: ConfigMap + name: flux-runtime-info + patches: + - patch: | + $patch: delete + apiVersion: all + kind: all + metadata: + name: all + target: + labelSelector: toolkit.fluxcd.io/role=automation diff --git a/clusters/prod-us/infra-tenant.yaml b/clusters/prod-us/infra-tenant.yaml new file mode 100644 index 0000000..7e007cf --- /dev/null +++ b/clusters/prod-us/infra-tenant.yaml @@ -0,0 +1,29 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: flux-infra-tenant + namespace: flux-system +spec: + serviceAccountName: kustomize-controller + interval: 12h + retryInterval: 3m + wait: true + timeout: 15m + path: ./tenants/infra + prune: true + sourceRef: + kind: GitRepository + name: flux-system + postBuild: + substituteFrom: + - kind: ConfigMap + name: flux-runtime-info + patches: + - patch: | + $patch: delete + apiVersion: all + kind: all + metadata: + name: all + target: + labelSelector: toolkit.fluxcd.io/role=automation diff --git a/clusters/prod-us/runtime-info.yaml b/clusters/prod-us/runtime-info.yaml new file mode 100644 index 0000000..3a5af53 --- /dev/null +++ b/clusters/prod-us/runtime-info.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: flux-runtime-info + namespace: flux-system + labels: + toolkit.fluxcd.io/runtime: "true" + annotations: + kustomize.toolkit.fluxcd.io/ssa: "Merge" +data: + ENVIRONMENT: "production" + GIT_BRANCH: "production" + CLUSTER_NAME: "prod-us" + CLUSTER_DOMAIN: "us.example.com"