feat: add coredns (#6)
All checks were successful
All checks were successful
We had some inconsistencies with node configuration and dns hickups. This feature moves the coredns config into our software versioning system. Reviewed-on: #6 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 #6.
This commit is contained in:
@@ -10,6 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
node-labels: ${{ steps.filter.outputs.node-labels }}
|
node-labels: ${{ steps.filter.outputs.node-labels }}
|
||||||
|
coredns: ${{ steps.filter.outputs.coredns }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
@@ -20,6 +21,8 @@ jobs:
|
|||||||
filters: |
|
filters: |
|
||||||
k8s:
|
k8s:
|
||||||
- 'node-labels/**'
|
- 'node-labels/**'
|
||||||
|
coredns:
|
||||||
|
- 'coredns/**'
|
||||||
|
|
||||||
deploy-node-labels:
|
deploy-node-labels:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -35,3 +38,18 @@ jobs:
|
|||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
kubectl apply --server-side --field-manager=t000-n -f node-labels
|
kubectl apply --server-side --field-manager=t000-n -f node-labels
|
||||||
|
|
||||||
|
deploy-coredns:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: check-changes
|
||||||
|
if: ${{ needs.check-changes.outputs.coredns == 'true' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
- uses: azure/setup-kubectl@v4
|
||||||
|
- uses: azure/k8s-set-context@v4
|
||||||
|
with:
|
||||||
|
method: kubeconfig
|
||||||
|
kubeconfig: ${{ secrets.KUBECONFIG }}
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
kubectl apply -n kube-system -f coredns
|
||||||
|
|||||||
@@ -18,3 +18,16 @@ jobs:
|
|||||||
- name: Validate
|
- name: Validate
|
||||||
run: |
|
run: |
|
||||||
kubectl apply --server-side --field-manager=t000-n --dry-run=server -f node-labels
|
kubectl apply --server-side --field-manager=t000-n --dry-run=server -f node-labels
|
||||||
|
|
||||||
|
validate-coredns:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
- uses: azure/setup-kubectl@v4
|
||||||
|
- uses: azure/k8s-set-context@v4
|
||||||
|
with:
|
||||||
|
method: kubeconfig
|
||||||
|
kubeconfig: ${{ secrets.KUBECONFIG }}
|
||||||
|
- name: Validate
|
||||||
|
run: |
|
||||||
|
kubectl apply -n kube-system -f coredns
|
||||||
|
|||||||
47
coredns/coredns-config.yaml
Normal file
47
coredns/coredns-config.yaml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: coredns
|
||||||
|
namespace: kube-system
|
||||||
|
data:
|
||||||
|
Corefile: |
|
||||||
|
t00n.de:53 {
|
||||||
|
errors
|
||||||
|
forward . 192.168.0.1 192.168.0.9 192.168.0.10
|
||||||
|
cache 300
|
||||||
|
reload
|
||||||
|
}
|
||||||
|
|
||||||
|
t000-n.de:53 {
|
||||||
|
errors
|
||||||
|
forward . 192.168.0.1 192.168.0.9 192.168.0.10
|
||||||
|
cache 300
|
||||||
|
reload
|
||||||
|
}
|
||||||
|
|
||||||
|
.:53 {
|
||||||
|
errors
|
||||||
|
health
|
||||||
|
ready
|
||||||
|
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||||
|
pods insecure
|
||||||
|
fallthrough in-addr.arpa ip6.arpa
|
||||||
|
}
|
||||||
|
hosts /etc/coredns/NodeHosts {
|
||||||
|
ttl 60
|
||||||
|
reload 15s
|
||||||
|
fallthrough
|
||||||
|
}
|
||||||
|
prometheus :9153
|
||||||
|
forward . /etc/resolv.conf
|
||||||
|
cache 30
|
||||||
|
loop
|
||||||
|
reload
|
||||||
|
loadbalance
|
||||||
|
import /etc/coredns/custom/*.override
|
||||||
|
}
|
||||||
|
import /etc/coredns/custom/*.server
|
||||||
|
NodeHosts: |
|
||||||
|
192.168.0.50 k3sh0
|
||||||
|
192.168.0.51 k3sh1
|
||||||
|
192.168.0.52 k3sh2
|
||||||
Reference in New Issue
Block a user