feat: add node labels (#1)
Reviewed-on: #1 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #1.
This commit is contained in:
@@ -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,18 @@ 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
|
||||
run: |
|
||||
kubectl apply --server-side --field-manager=t000-n -f k8s/
|
||||
|
||||
@@ -10,23 +10,11 @@ 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
|
||||
kubeconfig: ${{ secrets.KUBECONFIG }}
|
||||
- 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
|
||||
run: |
|
||||
kubectl apply --server-side --field-manager=t000-n --dry-run=server -f k8s/
|
||||
|
||||
18
README.md
18
README.md
@@ -1,17 +1,3 @@
|
||||
Template DoDos:
|
||||
# Kubernetes Cluster Configuration
|
||||
|
||||
- Add KUBECONFIG secret to your repo
|
||||
- Place your k8s files in ./k8s/
|
||||
- Replace \<service\> with the name of the service
|
||||
- Replace \<url\> with the URL of the service
|
||||
- Replace \<auth\> with the authentication method used
|
||||
- Replace \<namespace\> 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 \<service\>
|
||||
|
||||
Deployed to: \<url\>
|
||||
|
||||
Authentication: \<auth\>
|
||||
|
||||

|
||||
This repository contains Kubernetes node label configurations for cluster management.
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: <namespace>
|
||||
7
k8s/11_labels_k3sh0.yaml
Normal file
7
k8s/11_labels_k3sh0.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Node
|
||||
metadata:
|
||||
name: k3sh0
|
||||
labels:
|
||||
de.t000-n.net.class: "fast"
|
||||
de.t000-n.net.bw: "10g"
|
||||
7
k8s/12_labels_k3sh1.yaml
Normal file
7
k8s/12_labels_k3sh1.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Node
|
||||
metadata:
|
||||
name: k3sh1
|
||||
labels:
|
||||
de.t000-n.net.class: "fast"
|
||||
de.t000-n.net.bw: "10g"
|
||||
7
k8s/13_labels_k3sh2.yaml
Normal file
7
k8s/13_labels_k3sh2.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Node
|
||||
metadata:
|
||||
name: k3sh2
|
||||
labels:
|
||||
de.t000-n.net.class: "fast"
|
||||
de.t000-n.net.bw: "10g"
|
||||
7
k8s/14_labels_k3sh3.yaml
Normal file
7
k8s/14_labels_k3sh3.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Node
|
||||
metadata:
|
||||
name: k3sh3
|
||||
labels:
|
||||
de.t000-n.net.class: "slow"
|
||||
de.t000-n.net.bw: "1g"
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"kubernetes": {
|
||||
"fileMatch": ["^k8s/3.*\\.yaml$"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user