From af5abef4e923c33e486add4cd34cde9ce5b00881 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 26 Sep 2025 21:00:14 +0200 Subject: [PATCH 1/6] adjust ci --- .gitea/workflows/deploy.yaml | 30 ++---------------------------- .gitea/workflows/validate.yaml | 11 +---------- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 162d142..35bd5a2 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -10,7 +10,6 @@ jobs: runs-on: ubuntu-latest outputs: changes: ${{ steps.filter.outputs.k8s }} - helm: ${{ steps.filter.outputs.helm }} steps: - uses: actions/checkout@v5 with: @@ -21,47 +20,22 @@ jobs: filters: | k8s: - 'k8s/**' - helm: - - 'values/**' - - 'helmfile.yaml' deploy: runs-on: ubuntu-latest needs: check-changes - if: ${{ needs.check-changes.outputs.changes == 'true' || needs.check-changes.outputs.helm == 'true' }} + if: ${{ needs.check-changes.outputs.changes == 'true' }} steps: - uses: actions/checkout@v5 - - uses: https://gitea.t000-n.de/t.behrendt/k_deploy_workflows/.gitea/actions/extract-namespace-from-repo-name@v0 - id: namespace - with: - repo: ${{ github.repository }} - uses: azure/setup-kubectl@v4 - - uses: azure/setup-helm@v4 - uses: azure/k8s-set-context@v4 with: method: kubeconfig kubeconfig: ${{ secrets.KUBECONFIG }} - - name: Set restic backup secret - uses: azure/k8s-create-secret@v5 - with: - namespace: ${{ steps.namespace.outputs.namespace }} - secret-name: backupsidecar-secret - secret-type: generic - data: | - { - "restic_password": "${{ secrets.RESTIC_PASSWORD }}", - "restic_rest_username": "${{ secrets.RESTIC_REST_USERNAME }}", - "restic_rest_password": "${{ secrets.RESTIC_REST_PASSWORD }}", - "gotify_token": "${{ secrets.GOTIFY_TOKEN }}" - } - name: Deploy uses: azure/k8s-deploy@v5.0.4 with: action: deploy manifests: "k8s/" strategy: basic - namespace: ${{ steps.namespace.outputs.namespace }} - - name: Deploy helm - uses: helmfile/helmfile-action@v2 - with: - helmfile-args: apply + server-side: true diff --git a/.gitea/workflows/validate.yaml b/.gitea/workflows/validate.yaml index 001f84b..7d8e50d 100644 --- a/.gitea/workflows/validate.yaml +++ b/.gitea/workflows/validate.yaml @@ -10,12 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: https://gitea.t000-n.de/t.behrendt/k_deploy_workflows/.gitea/actions/extract-namespace-from-repo-name@v0 - id: namespace - with: - repo: ${{ github.repository }} - uses: azure/setup-kubectl@v4 - - uses: azure/setup-helm@v4 - uses: azure/k8s-set-context@v4 with: method: kubeconfig @@ -23,10 +18,6 @@ jobs: - name: Validate uses: azure/k8s-lint@v3 with: - namespace: ${{ steps.namespace.outputs.namespace }} lintType: dryrun manifests: "k8s/" - - name: Validate Helm - uses: helmfile/helmfile-action@v2.0.5 - with: - helmfile-args: diff + server-side: true -- 2.49.1 From 29d68cfee90b2a750f37bd78c7033365b116cd3a Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 26 Sep 2025 21:00:22 +0200 Subject: [PATCH 2/6] remove template namespace --- k8s/10_namespace.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 k8s/10_namespace.yaml diff --git a/k8s/10_namespace.yaml b/k8s/10_namespace.yaml deleted file mode 100644 index badbdd5..0000000 --- a/k8s/10_namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: -- 2.49.1 From ca360ba39311c1ce618f9862eb8c69ea6a7f584a Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 26 Sep 2025 21:00:27 +0200 Subject: [PATCH 3/6] add nodes --- k8s/11_labels_k3sh0.yaml | 7 +++++++ k8s/12_labels_k3sh1.yaml | 7 +++++++ k8s/13_labels_k3sh2.yaml | 7 +++++++ k8s/14_labels_k3sh3.yaml | 7 +++++++ 4 files changed, 28 insertions(+) create mode 100644 k8s/11_labels_k3sh0.yaml create mode 100644 k8s/12_labels_k3sh1.yaml create mode 100644 k8s/13_labels_k3sh2.yaml create mode 100644 k8s/14_labels_k3sh3.yaml diff --git a/k8s/11_labels_k3sh0.yaml b/k8s/11_labels_k3sh0.yaml new file mode 100644 index 0000000..f5153ff --- /dev/null +++ b/k8s/11_labels_k3sh0.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Node +metadata: + name: k3sh0 + labels: + de.t000-n.net.class: "fast" + de.t000-n.net.bw: "10g" diff --git a/k8s/12_labels_k3sh1.yaml b/k8s/12_labels_k3sh1.yaml new file mode 100644 index 0000000..d2de235 --- /dev/null +++ b/k8s/12_labels_k3sh1.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Node +metadata: + name: k3sh1 + labels: + de.t000-n.net.class: "fast" + de.t000-n.net.bw: "10g" diff --git a/k8s/13_labels_k3sh2.yaml b/k8s/13_labels_k3sh2.yaml new file mode 100644 index 0000000..63b8caf --- /dev/null +++ b/k8s/13_labels_k3sh2.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Node +metadata: + name: k3sh2 + labels: + de.t000-n.net.class: "fast" + de.t000-n.net.bw: "10g" diff --git a/k8s/14_labels_k3sh3.yaml b/k8s/14_labels_k3sh3.yaml new file mode 100644 index 0000000..90f619b --- /dev/null +++ b/k8s/14_labels_k3sh3.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Node +metadata: + name: k3sh3 + labels: + de.t000-n.net.class: "slow" + de.t000-n.net.bw: "1g" -- 2.49.1 From ba272705e461f809c9f4dbf78d9b84e6d9fcba5a Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 26 Sep 2025 21:03:36 +0200 Subject: [PATCH 4/6] adjust ci move away from azure kubectl --- .gitea/workflows/deploy.yaml | 8 ++------ .gitea/workflows/validate.yaml | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 35bd5a2..87e679a 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -33,9 +33,5 @@ jobs: method: kubeconfig kubeconfig: ${{ secrets.KUBECONFIG }} - name: Deploy - uses: azure/k8s-deploy@v5.0.4 - with: - action: deploy - manifests: "k8s/" - strategy: basic - server-side: true + run: | + kubectl apply --server-side --field-manager=t000-n -f k8s/ diff --git a/.gitea/workflows/validate.yaml b/.gitea/workflows/validate.yaml index 7d8e50d..e69c0f9 100644 --- a/.gitea/workflows/validate.yaml +++ b/.gitea/workflows/validate.yaml @@ -16,8 +16,5 @@ jobs: method: kubeconfig kubeconfig: ${{ secrets.KUBECONFIG }} - name: Validate - uses: azure/k8s-lint@v3 - with: - lintType: dryrun - manifests: "k8s/" - server-side: true + run: | + kubectl apply --server-side --field-manager=t000-n --dry-run=server -f k8s/ -- 2.49.1 From 43b4d8798d2620bfb895f395ae92ffabbe6b2b8a Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 26 Sep 2025 21:05:35 +0200 Subject: [PATCH 5/6] drop renovate config, let renovate handle it --- renovate.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 renovate.json diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 3b225d7..0000000 --- a/renovate.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "kubernetes": { - "fileMatch": ["^k8s/3.*\\.yaml$"] - } -} -- 2.49.1 From 921620dc753fccbebe3722ca8aba11c54f8b7acc Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Fri, 26 Sep 2025 21:08:20 +0200 Subject: [PATCH 6/6] add docs --- README.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 64d5f1d..290be74 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,3 @@ -Template DoDos: +# Kubernetes Cluster Configuration -- Add KUBECONFIG secret to your repo -- Place your k8s files in ./k8s/ -- Replace \ with the name of the service -- Replace \ with the URL of the service -- Replace \ with the authentication method used -- Replace \ with the namespace where the service is deployed in .github/workflows/deploy.yaml -- Provide a screenshot of the service in action in ./screenshot.png - -# Kubernetes Deployment for \ - -Deployed to: \ - -Authentication: \ - -![Screenshot](screenshot.png) +This repository contains Kubernetes node label configurations for cluster management. -- 2.49.1