From 4929d9a08754c2192d4650f8722f63409cc35010 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 20 Sep 2024 18:37:37 -0400 Subject: [PATCH] fix(database): fix database namespace for thin cluster --- kubernetes/thin/apps/database/ks.yaml | 59 ------------------- .../thin/apps/database/kustomization.yaml | 7 +++ kubernetes/thin/apps/database/namespace.yaml | 6 ++ .../postgresql/{ => app}/helm-release.yaml | 0 .../postgresql/{ => app}/kustomization.yaml | 0 .../{ => app}/pgadmin4/helm-release.yaml | 0 .../{ => app}/pgadmin4/helm-repository.yaml | 0 .../{ => app}/pgadmin4/kustomization.yaml | 0 .../postgresql/{ => app}/pgsql-pv.yaml | 0 .../postgresql/{ => app}/pgsql.sops.yaml | 0 .../thin/apps/database/postgresql/ks.yaml | 29 +++++++++ .../redis/{ => app}/helm-release.yaml | 0 .../redis/{ => app}/kustomization.yaml | 0 .../database/redis/{ => app}/redis.sops.yaml | 0 kubernetes/thin/apps/database/redis/ks.yaml | 29 +++++++++ kubernetes/thin/apps/kustomization.yaml | 4 +- 16 files changed, 73 insertions(+), 61 deletions(-) delete mode 100644 kubernetes/thin/apps/database/ks.yaml create mode 100644 kubernetes/thin/apps/database/kustomization.yaml create mode 100644 kubernetes/thin/apps/database/namespace.yaml rename kubernetes/thin/apps/database/postgresql/{ => app}/helm-release.yaml (100%) rename kubernetes/thin/apps/database/postgresql/{ => app}/kustomization.yaml (100%) rename kubernetes/thin/apps/database/postgresql/{ => app}/pgadmin4/helm-release.yaml (100%) rename kubernetes/thin/apps/database/postgresql/{ => app}/pgadmin4/helm-repository.yaml (100%) rename kubernetes/thin/apps/database/postgresql/{ => app}/pgadmin4/kustomization.yaml (100%) rename kubernetes/thin/apps/database/postgresql/{ => app}/pgsql-pv.yaml (100%) rename kubernetes/thin/apps/database/postgresql/{ => app}/pgsql.sops.yaml (100%) create mode 100644 kubernetes/thin/apps/database/postgresql/ks.yaml rename kubernetes/thin/apps/database/redis/{ => app}/helm-release.yaml (100%) rename kubernetes/thin/apps/database/redis/{ => app}/kustomization.yaml (100%) rename kubernetes/thin/apps/database/redis/{ => app}/redis.sops.yaml (100%) create mode 100644 kubernetes/thin/apps/database/redis/ks.yaml diff --git a/kubernetes/thin/apps/database/ks.yaml b/kubernetes/thin/apps/database/ks.yaml deleted file mode 100644 index 2cce906..0000000 --- a/kubernetes/thin/apps/database/ks.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: postgresql - namespace: flux-system -spec: - targetNamespace: database - timeout: 5m - interval: 10m - path: ./kubernetes/thin/apps/database/postgresql - prune: true - sourceRef: - kind: GitRepository - name: home-cluster - decryption: - provider: sops - secretRef: - name: sops-gpg - dependsOn: - - name: openebs-sc - namespace: flux-system - postBuild: - substitute: {} - substituteFrom: - - kind: ConfigMap - name: cluster-settings - - kind: Secret - name: cluster-secrets ---- -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: redis - namespace: flux-system -spec: - targetNamespace: database - timeout: 5m - interval: 10m - path: ./kubernetes/thin/apps/database/redis - prune: true - sourceRef: - kind: GitRepository - name: home-cluster - decryption: - provider: sops - secretRef: - name: sops-gpg - dependsOn: - - name: openebs-sc - namespace: flux-system - postBuild: - substitute: {} - substituteFrom: - - kind: ConfigMap - name: cluster-settings - - kind: Secret - name: cluster-secrets diff --git a/kubernetes/thin/apps/database/kustomization.yaml b/kubernetes/thin/apps/database/kustomization.yaml new file mode 100644 index 0000000..d9ee1cb --- /dev/null +++ b/kubernetes/thin/apps/database/kustomization.yaml @@ -0,0 +1,7 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./namespace.yaml +- ./postgresql/ks.yaml +- ./redis/ks.yaml \ No newline at end of file diff --git a/kubernetes/thin/apps/database/namespace.yaml b/kubernetes/thin/apps/database/namespace.yaml new file mode 100644 index 0000000..7613708 --- /dev/null +++ b/kubernetes/thin/apps/database/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: database + annotations: + kustomize.toolkit.fluxcd.io/prune: disabled \ No newline at end of file diff --git a/kubernetes/thin/apps/database/postgresql/helm-release.yaml b/kubernetes/thin/apps/database/postgresql/app/helm-release.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/helm-release.yaml rename to kubernetes/thin/apps/database/postgresql/app/helm-release.yaml diff --git a/kubernetes/thin/apps/database/postgresql/kustomization.yaml b/kubernetes/thin/apps/database/postgresql/app/kustomization.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/kustomization.yaml rename to kubernetes/thin/apps/database/postgresql/app/kustomization.yaml diff --git a/kubernetes/thin/apps/database/postgresql/pgadmin4/helm-release.yaml b/kubernetes/thin/apps/database/postgresql/app/pgadmin4/helm-release.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/pgadmin4/helm-release.yaml rename to kubernetes/thin/apps/database/postgresql/app/pgadmin4/helm-release.yaml diff --git a/kubernetes/thin/apps/database/postgresql/pgadmin4/helm-repository.yaml b/kubernetes/thin/apps/database/postgresql/app/pgadmin4/helm-repository.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/pgadmin4/helm-repository.yaml rename to kubernetes/thin/apps/database/postgresql/app/pgadmin4/helm-repository.yaml diff --git a/kubernetes/thin/apps/database/postgresql/pgadmin4/kustomization.yaml b/kubernetes/thin/apps/database/postgresql/app/pgadmin4/kustomization.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/pgadmin4/kustomization.yaml rename to kubernetes/thin/apps/database/postgresql/app/pgadmin4/kustomization.yaml diff --git a/kubernetes/thin/apps/database/postgresql/pgsql-pv.yaml b/kubernetes/thin/apps/database/postgresql/app/pgsql-pv.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/pgsql-pv.yaml rename to kubernetes/thin/apps/database/postgresql/app/pgsql-pv.yaml diff --git a/kubernetes/thin/apps/database/postgresql/pgsql.sops.yaml b/kubernetes/thin/apps/database/postgresql/app/pgsql.sops.yaml similarity index 100% rename from kubernetes/thin/apps/database/postgresql/pgsql.sops.yaml rename to kubernetes/thin/apps/database/postgresql/app/pgsql.sops.yaml diff --git a/kubernetes/thin/apps/database/postgresql/ks.yaml b/kubernetes/thin/apps/database/postgresql/ks.yaml new file mode 100644 index 0000000..040ec7d --- /dev/null +++ b/kubernetes/thin/apps/database/postgresql/ks.yaml @@ -0,0 +1,29 @@ +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: postgresql + namespace: flux-system +spec: + targetNamespace: database + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/database/postgresql/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs-sc + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets diff --git a/kubernetes/thin/apps/database/redis/helm-release.yaml b/kubernetes/thin/apps/database/redis/app/helm-release.yaml similarity index 100% rename from kubernetes/thin/apps/database/redis/helm-release.yaml rename to kubernetes/thin/apps/database/redis/app/helm-release.yaml diff --git a/kubernetes/thin/apps/database/redis/kustomization.yaml b/kubernetes/thin/apps/database/redis/app/kustomization.yaml similarity index 100% rename from kubernetes/thin/apps/database/redis/kustomization.yaml rename to kubernetes/thin/apps/database/redis/app/kustomization.yaml diff --git a/kubernetes/thin/apps/database/redis/redis.sops.yaml b/kubernetes/thin/apps/database/redis/app/redis.sops.yaml similarity index 100% rename from kubernetes/thin/apps/database/redis/redis.sops.yaml rename to kubernetes/thin/apps/database/redis/app/redis.sops.yaml diff --git a/kubernetes/thin/apps/database/redis/ks.yaml b/kubernetes/thin/apps/database/redis/ks.yaml new file mode 100644 index 0000000..049f79b --- /dev/null +++ b/kubernetes/thin/apps/database/redis/ks.yaml @@ -0,0 +1,29 @@ +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: redis + namespace: flux-system +spec: + targetNamespace: database + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/database/redis/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs-sc + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets diff --git a/kubernetes/thin/apps/kustomization.yaml b/kubernetes/thin/apps/kustomization.yaml index 658e4f4..88151a2 100644 --- a/kubernetes/thin/apps/kustomization.yaml +++ b/kubernetes/thin/apps/kustomization.yaml @@ -16,7 +16,7 @@ resources: - ./kubevirt/ks.yaml - ./kubevirt-cdi/ks.yaml -- ./database/ks.yaml -- ../../common/apps/exim/ks.yml +- ./database +- ../../common/apps/exim/ks.yaml - ./monitoring - ./default \ No newline at end of file