Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.24] Allow adding configuration to coredns .:53 block via *.override keys in coredns-custom ConfigMap #7712

Closed
brandond opened this issue Jun 8, 2023 · 1 comment
Assignees
Milestone

Comments

@brandond
Copy link
Member

brandond commented Jun 8, 2023

@ShylajaDevadiga
Copy link
Contributor

Validated using v1.24.15-rc1+k3s1

Environment Details

Infrastructure
Cloud EC2 instance

Node(s) CPU architecture, OS, and Version:
Ubuntu 22.04

Applying some custom settings for the default server block as below and restarting coredns pod

cat custom.yaml 
apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  log.override: |
    log
  custom.server: |
    why.local {
      forward . 127.0.0.1
    }

$ kubectl get configmaps --namespace=kube-system coredns-custom -o yaml
apiVersion: v1
data:
  custom.server: |
    why.local {
      forward . 127.0.0.1
    }
  log.override: |
    log
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data":{"custom.server":"why.local {\n  forward . 127.0.0.1\n}\n","log.override":"log\n"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"coredns-custom","namespace":"kube-system"}}
  creationTimestamp: "2023-06-15T22:43:06Z"
  name: coredns-custom
  namespace: kube-system
  resourceVersion: "2618"
  uid: 5991edbd-2e8f-4857-9adb-db69f166b8a8
$ kubectl delete  pod -n kube-system coredns-74448699cf-lt46z 
pod "coredns-74448699cf-lt46z" deleted
$ kubectl get pods -A
NAMESPACE     NAME                                          READY   STATUS      RESTARTS   AGE
kube-system   local-path-provisioner-597bc7dccd-f7n8s       1/1     Running     0          152m
kube-system   helm-install-traefik-crd-8x2x9                0/1     Completed   0          152m
kube-system   helm-install-traefik-bdvw8                    0/1     Completed   1          152m
kube-system   svclb-traefik-afb3f314-fs4bp                  2/2     Running     0          152m
kube-system   traefik-7467b667d9-m66ft                      1/1     Running     0          152m
kube-system   metrics-server-749b574fc-9p6bc                1/1     Running     0          152m
kube-system   svclb-nginx-loadbalancer-svc-453fd5ea-rnkb5   1/1     Running     0          148m
default       test-loadbalancer-5dc8984576-cx89t            1/1     Running     0          148m
default       test-loadbalancer-5dc8984576-khlq7            1/1     Running     0          148m
kube-system   coredns-74448699cf-h5cmf                      1/1     Running     0          9s

Validated custom config has taken effect as seen in the logs

$ kubectl logs -n kube-system pod/coredns-74448699cf-h5cmf   
.:53
why.local.:53
[INFO] plugin/reload: Running configuration SHA512 = 2e241110619e8c5ec252af702135deed1c90a4dab89bd410554347468d0c1d064fd0571098262fc611b97ef366f864627bb1c309b078c2dca755f55aae118364
CoreDNS-1.10.1
linux/amd64, go1.20, 055b2c3
[INFO] 127.0.0.1:38248 - 17065 "HINFO IN 3693267141280669377.4292237142184114153. udp 57 false 512" NXDOMAIN qr,rd,ra 132 0.013195785s

@github-project-automation github-project-automation bot moved this from To Test to Done Issue in K3s Development Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants