From d6795a3c4ad8a08ee5fd67455c529aea733fc755 Mon Sep 17 00:00:00 2001 From: Smaine Kahlouch Date: Sun, 10 Sep 2023 17:12:55 +0200 Subject: [PATCH] fix: infrastructure gateways dependencies --- clusters/mycluster-0/infrastructure.yaml | 20 +++++++++++++++++++ .../base/gapi/platform-gateway.yaml | 2 +- .../mycluster-0/gapi/kustomization.yaml | 5 +++++ infrastructure/mycluster-0/kustomization.yaml | 1 - 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 infrastructure/mycluster-0/gapi/kustomization.yaml diff --git a/clusters/mycluster-0/infrastructure.yaml b/clusters/mycluster-0/infrastructure.yaml index 4ebc063..831f042 100644 --- a/clusters/mycluster-0/infrastructure.yaml +++ b/clusters/mycluster-0/infrastructure.yaml @@ -70,6 +70,7 @@ spec: dependsOn: - name: crossplane-providers --- +# The infrastructure components are deployed when Crossplane is available in order to creates irsa resources apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: @@ -93,4 +94,23 @@ spec: name: flux-system dependsOn: - name: crossplane-configuration +--- +# Gateways must be created after Kyverno's cluster policies are applied in order to add AWS annotations +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infrastructure-gateways + namespace: flux-system +spec: + prune: true + interval: 4m0s + path: ./infrastructure/mycluster-0/gapi + postBuild: + substitute: + domain_name: "cloud.ogenki.io" + sourceRef: + kind: GitRepository + name: flux-system + dependsOn: + - name: crds - name: security diff --git a/infrastructure/base/gapi/platform-gateway.yaml b/infrastructure/base/gapi/platform-gateway.yaml index 6c038c9..e2880bb 100644 --- a/infrastructure/base/gapi/platform-gateway.yaml +++ b/infrastructure/base/gapi/platform-gateway.yaml @@ -8,7 +8,7 @@ spec: gatewayClassName: cilium listeners: - name: http - hostname: "*.cloud.ogenki.io" + hostname: "*.${domain_name}" port: 443 protocol: HTTPS allowedRoutes: diff --git a/infrastructure/mycluster-0/gapi/kustomization.yaml b/infrastructure/mycluster-0/gapi/kustomization.yaml new file mode 100644 index 0000000..27ae8aa --- /dev/null +++ b/infrastructure/mycluster-0/gapi/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base/gapi diff --git a/infrastructure/mycluster-0/kustomization.yaml b/infrastructure/mycluster-0/kustomization.yaml index b3298bb..b0b9b43 100644 --- a/infrastructure/mycluster-0/kustomization.yaml +++ b/infrastructure/mycluster-0/kustomization.yaml @@ -4,4 +4,3 @@ kind: Kustomization resources: - ../base/aws-load-balancer-controller - ../base/external-dns - - ../base/gapi