From 5c8cdb3cbbad8f3fb6262a29dc7c574e6a2a9959 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 6 Sep 2024 23:58:15 -0400 Subject: [PATCH] fix: traefik crds race condition --- .../traefik/{ => app}/dashboard-ingress.yaml | 0 .../apps/traefik/{ => app}/helm-release.yaml | 0 .../traefik/{ => app}/helm-repository.yaml | 0 .../apps/traefik/{ => app}/kustomization.yaml | 1 - .../apps/traefik/{ => app}/namespace.yaml | 0 .../{ => extra}/default-tls-store.yaml | 0 .../apps/traefik/extra/kustomization.yaml | 4 ++ kubernetes/common/apps/traefik/ks.yaml | 40 +++++++++++++++++++ kubernetes/main/core/kustomization.yaml | 2 +- kubernetes/thin/apps/kustomization.yaml | 2 +- 10 files changed, 46 insertions(+), 3 deletions(-) rename kubernetes/common/apps/traefik/{ => app}/dashboard-ingress.yaml (100%) rename kubernetes/common/apps/traefik/{ => app}/helm-release.yaml (100%) rename kubernetes/common/apps/traefik/{ => app}/helm-repository.yaml (100%) rename kubernetes/common/apps/traefik/{ => app}/kustomization.yaml (72%) rename kubernetes/common/apps/traefik/{ => app}/namespace.yaml (100%) rename kubernetes/common/apps/traefik/{ => extra}/default-tls-store.yaml (100%) create mode 100644 kubernetes/common/apps/traefik/extra/kustomization.yaml create mode 100644 kubernetes/common/apps/traefik/ks.yaml diff --git a/kubernetes/common/apps/traefik/dashboard-ingress.yaml b/kubernetes/common/apps/traefik/app/dashboard-ingress.yaml similarity index 100% rename from kubernetes/common/apps/traefik/dashboard-ingress.yaml rename to kubernetes/common/apps/traefik/app/dashboard-ingress.yaml diff --git a/kubernetes/common/apps/traefik/helm-release.yaml b/kubernetes/common/apps/traefik/app/helm-release.yaml similarity index 100% rename from kubernetes/common/apps/traefik/helm-release.yaml rename to kubernetes/common/apps/traefik/app/helm-release.yaml diff --git a/kubernetes/common/apps/traefik/helm-repository.yaml b/kubernetes/common/apps/traefik/app/helm-repository.yaml similarity index 100% rename from kubernetes/common/apps/traefik/helm-repository.yaml rename to kubernetes/common/apps/traefik/app/helm-repository.yaml diff --git a/kubernetes/common/apps/traefik/kustomization.yaml b/kubernetes/common/apps/traefik/app/kustomization.yaml similarity index 72% rename from kubernetes/common/apps/traefik/kustomization.yaml rename to kubernetes/common/apps/traefik/app/kustomization.yaml index 835cd22..191a565 100644 --- a/kubernetes/common/apps/traefik/kustomization.yaml +++ b/kubernetes/common/apps/traefik/app/kustomization.yaml @@ -4,5 +4,4 @@ resources: - ./namespace.yaml - ./helm-repository.yaml - ./helm-release.yaml -- ./default-tls-store.yaml - ./dashboard-ingress.yaml \ No newline at end of file diff --git a/kubernetes/common/apps/traefik/namespace.yaml b/kubernetes/common/apps/traefik/app/namespace.yaml similarity index 100% rename from kubernetes/common/apps/traefik/namespace.yaml rename to kubernetes/common/apps/traefik/app/namespace.yaml diff --git a/kubernetes/common/apps/traefik/default-tls-store.yaml b/kubernetes/common/apps/traefik/extra/default-tls-store.yaml similarity index 100% rename from kubernetes/common/apps/traefik/default-tls-store.yaml rename to kubernetes/common/apps/traefik/extra/default-tls-store.yaml diff --git a/kubernetes/common/apps/traefik/extra/kustomization.yaml b/kubernetes/common/apps/traefik/extra/kustomization.yaml new file mode 100644 index 0000000..4dfa729 --- /dev/null +++ b/kubernetes/common/apps/traefik/extra/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./default-tls-store.yaml \ No newline at end of file diff --git a/kubernetes/common/apps/traefik/ks.yaml b/kubernetes/common/apps/traefik/ks.yaml new file mode 100644 index 0000000..24dc76d --- /dev/null +++ b/kubernetes/common/apps/traefik/ks.yaml @@ -0,0 +1,40 @@ +# 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: traefik + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/common/apps/traefik/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg +--- +# 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: traefik-default-tls + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/common/apps/traefik/extra + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: traefik + namespace: flux-system \ No newline at end of file diff --git a/kubernetes/main/core/kustomization.yaml b/kubernetes/main/core/kustomization.yaml index 991316d..e505ffa 100644 --- a/kubernetes/main/core/kustomization.yaml +++ b/kubernetes/main/core/kustomization.yaml @@ -5,7 +5,7 @@ resources: - ./helm-repositories.yaml - ./cert-manager - ../../common/apps/metallb -- ../../common/apps/traefik +- ../../common/apps/traefik/ks.yaml # storage - ./longhorn - ./openebs diff --git a/kubernetes/thin/apps/kustomization.yaml b/kubernetes/thin/apps/kustomization.yaml index 5982996..a2eaf7b 100644 --- a/kubernetes/thin/apps/kustomization.yaml +++ b/kubernetes/thin/apps/kustomization.yaml @@ -4,7 +4,7 @@ resources: - ./helm-repositories.yaml #- ../../common/apps/metallb - ./main-ip-pool.yaml -- ../../common/apps/traefik +- ../../common/apps/traefik/ks.yaml # storage #- ./longhorn #- ../../common/apps/openebs