From 27b25d22c0d0e6c2f40230c94a34f35c5f0b7bf4 Mon Sep 17 00:00:00 2001 From: devantler Date: Wed, 12 Jul 2023 23:48:32 +0200 Subject: [PATCH 01/12] test --- .github/workflows/end-to-end-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end-test.yaml b/.github/workflows/end-to-end-test.yaml index 5362da3cba..a50670abac 100644 --- a/.github/workflows/end-to-end-test.yaml +++ b/.github/workflows/end-to-end-test.yaml @@ -26,7 +26,7 @@ jobs: run: | flux create source git flux-system \ --url=${{ github.event.repository.html_url }} \ - --branch=${GITHUB_REF} \ + --branch=${GITHUB_REF#refs/heads/} \ --ignore-paths="./k8s/clusters/**/flux-system/" flux create kustomization flux-system \ --source=flux-system \ From 82d175f26a5d83170510a45dbc80f3592c3fcf0a Mon Sep 17 00:00:00 2001 From: devantler Date: Wed, 12 Jul 2023 23:54:37 +0200 Subject: [PATCH 02/12] test --- .github/workflows/end-to-end-test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end-test.yaml b/.github/workflows/end-to-end-test.yaml index a50670abac..21fe9fdb0b 100644 --- a/.github/workflows/end-to-end-test.yaml +++ b/.github/workflows/end-to-end-test.yaml @@ -15,6 +15,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Flux uses: fluxcd/flux2/action@main + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch - name: Setup Kubernetes uses: nolar/setup-k3d-k3s@v1 with: @@ -26,7 +30,7 @@ jobs: run: | flux create source git flux-system \ --url=${{ github.event.repository.html_url }} \ - --branch=${GITHUB_REF#refs/heads/} \ + --branch=${steps.extract_branch.outputs.branch} \ --ignore-paths="./k8s/clusters/**/flux-system/" flux create kustomization flux-system \ --source=flux-system \ From 6df535060030e0cd126fdd4437f5dd36a87e842e Mon Sep 17 00:00:00 2001 From: devantler Date: Wed, 12 Jul 2023 23:55:04 +0200 Subject: [PATCH 03/12] fix --- .github/workflows/end-to-end-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end-test.yaml b/.github/workflows/end-to-end-test.yaml index 21fe9fdb0b..ac85050b63 100644 --- a/.github/workflows/end-to-end-test.yaml +++ b/.github/workflows/end-to-end-test.yaml @@ -30,7 +30,7 @@ jobs: run: | flux create source git flux-system \ --url=${{ github.event.repository.html_url }} \ - --branch=${steps.extract_branch.outputs.branch} \ + --branch=${{ steps.extract_branch.outputs.branch }} \ --ignore-paths="./k8s/clusters/**/flux-system/" flux create kustomization flux-system \ --source=flux-system \ From 72cbe3737ef9682c0ad02a03723d7af23802f92e Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:00:23 +0200 Subject: [PATCH 04/12] Added empty kustomization to infrastructure/controllers --- k8s/infrastructure/controllers/kustomization.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 k8s/infrastructure/controllers/kustomization.yaml diff --git a/k8s/infrastructure/controllers/kustomization.yaml b/k8s/infrastructure/controllers/kustomization.yaml new file mode 100644 index 0000000000..419dcad196 --- /dev/null +++ b/k8s/infrastructure/controllers/kustomization.yaml @@ -0,0 +1,3 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: [] \ No newline at end of file From e317239bec28f6f22b71979123231e1b040c99b8 Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:00:35 +0200 Subject: [PATCH 05/12] Removed unnecessary .gitkeep --- k8s/infrastructure/controllers/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 k8s/infrastructure/controllers/.gitkeep diff --git a/k8s/infrastructure/controllers/.gitkeep b/k8s/infrastructure/controllers/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 From 33cff553d6af1bb0db6b39c134e23e22be357b0e Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:07:25 +0200 Subject: [PATCH 06/12] Fix apps/development --- k8s/apps/development/kustomization.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 k8s/apps/development/kustomization.yaml diff --git a/k8s/apps/development/kustomization.yaml b/k8s/apps/development/kustomization.yaml new file mode 100644 index 0000000000..419dcad196 --- /dev/null +++ b/k8s/apps/development/kustomization.yaml @@ -0,0 +1,3 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: [] \ No newline at end of file From f846d9c2c123a797039d954886e3792c4d2997d3 Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:07:41 +0200 Subject: [PATCH 07/12] remove unnecessary .gitkeep --- k8s/apps/development/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 k8s/apps/development/.gitkeep diff --git a/k8s/apps/development/.gitkeep b/k8s/apps/development/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 From 4300fd0cad86757d6fdbed38c2135ed07a8db2a9 Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:18:06 +0200 Subject: [PATCH 08/12] Disable docker compose updates in homelab --- .github/renovate.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 13a89f05ee..014adbdcb1 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -2,5 +2,8 @@ "extends": [ "config:base", ":disableDependencyDashboard" - ] + ], + "docker-compose": { + "enabled": false + } } From 4dded557971788992c40e70afcaa36248f0cbf24 Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:20:49 +0200 Subject: [PATCH 09/12] fixes --- .github/workflows/end-to-end-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/end-to-end-test.yaml b/.github/workflows/end-to-end-test.yaml index ac85050b63..cbf782d308 100644 --- a/.github/workflows/end-to-end-test.yaml +++ b/.github/workflows/end-to-end-test.yaml @@ -38,6 +38,7 @@ jobs: - name: Verify cluster reconciliation run: | kubectl -n flux-system wait kustomization/infra-controllers --for=condition=ready --timeout=5m + kubectl -n flux-system wait kustomization/infra-configs --for=condition=ready --timeout=5m kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m - name: Verify helm reconciliation run: | From a8b0d02a4056e7f3618f7474336b16965ab7e530 Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:24:24 +0200 Subject: [PATCH 10/12] Disable ClusterIssuer --- k8s/infrastructure/configs/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/infrastructure/configs/kustomization.yaml b/k8s/infrastructure/configs/kustomization.yaml index e6fff1fcfd..19f36876cc 100644 --- a/k8s/infrastructure/configs/kustomization.yaml +++ b/k8s/infrastructure/configs/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - cluster-issuers.yaml + # - cluster-issuers.yaml - network-policies.yaml \ No newline at end of file From b013c4e9f63e5018269178e61aeac560a0e74194 Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:28:08 +0200 Subject: [PATCH 11/12] fix --- .github/workflows/end-to-end-test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/end-to-end-test.yaml b/.github/workflows/end-to-end-test.yaml index cbf782d308..4be488a490 100644 --- a/.github/workflows/end-to-end-test.yaml +++ b/.github/workflows/end-to-end-test.yaml @@ -40,9 +40,9 @@ jobs: kubectl -n flux-system wait kustomization/infra-controllers --for=condition=ready --timeout=5m kubectl -n flux-system wait kustomization/infra-configs --for=condition=ready --timeout=5m kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m - - name: Verify helm reconciliation - run: | - kubectl -n podinfo wait helmrelease/podinfo --for=condition=ready --timeout=5m + # - name: Verify helm reconciliation + # run: | + # kubectl -n podinfo wait helmrelease/podinfo --for=condition=ready --timeout=5m - name: Debug failure if: failure() run: | From c77236668aa9b0b6c11efceabc9113a157e54efd Mon Sep 17 00:00:00 2001 From: devantler Date: Thu, 13 Jul 2023 00:34:42 +0200 Subject: [PATCH 12/12] Updated structure --- k8s/apps/production/kustomization.yaml | 3 ++ k8s/clusters/production/apps.yaml | 16 +++++++++ k8s/clusters/production/infrastructure.yaml | 39 +++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 k8s/apps/production/kustomization.yaml create mode 100644 k8s/clusters/production/apps.yaml create mode 100644 k8s/clusters/production/infrastructure.yaml diff --git a/k8s/apps/production/kustomization.yaml b/k8s/apps/production/kustomization.yaml new file mode 100644 index 0000000000..419dcad196 --- /dev/null +++ b/k8s/apps/production/kustomization.yaml @@ -0,0 +1,3 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: [] \ No newline at end of file diff --git a/k8s/clusters/production/apps.yaml b/k8s/clusters/production/apps.yaml new file mode 100644 index 0000000000..c56b471fb3 --- /dev/null +++ b/k8s/clusters/production/apps.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: apps + namespace: flux-system +spec: + interval: 10m + dependsOn: + - name: infra-configs + sourceRef: + kind: GitRepository + name: flux-system + path: ./k8s/apps/production + prune: true + wait: true \ No newline at end of file diff --git a/k8s/clusters/production/infrastructure.yaml b/k8s/clusters/production/infrastructure.yaml new file mode 100644 index 0000000000..f7304f4d99 --- /dev/null +++ b/k8s/clusters/production/infrastructure.yaml @@ -0,0 +1,39 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra-controllers + namespace: flux-system +spec: + interval: 1h + retryInterval: 1m + sourceRef: + kind: GitRepository + name: flux-system + path: ./k8s/infrastructure/controllers + prune: true + wait: true +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra-configs + namespace: flux-system +spec: + dependsOn: + - name: infra-controllers + interval: 1h + retryInterval: 1m + sourceRef: + kind: GitRepository + name: flux-system + path: ./k8s/infrastructure/configs + prune: true + patches: + - patch: | + - op: replace + path: /spec/acme/server + value: https://acme-staging-v02.api.letsencrypt.org/directory + target: + kind: ClusterIssuer + name: letsencrypt \ No newline at end of file