k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
27.99k stars 2.34k forks source link

[Release-1.28] - Support for NodeExternalDNS #10857

Open brandond opened 1 month ago

brandond commented 1 month ago

Backport fix for Support for NodeExternalDNS

VestigeJ commented 3 weeks ago

Environment Details

Reproduced using VERSION= Validated using COMMIT=4fc38646d3d7eb61995b0edb49f9255dc7af3a6a

Infrastructure

Node(s) CPU architecture, OS, and version:

Linux 6.4.0-150600.23.17-default x86_64 GNU/Linux PRETTY_NAME="SUSE Linux Enterprise Server 15 SP6"

Cluster Configuration:

NAME               STATUS   ROLES                       AGE     VERSION
ip-4-4-4-205       Ready    control-plane,etcd,master   8m24s   v1.28.14+k3s-4fc38646

Config.yaml:

node-external-ip: 4.4.4.205
token: YOUR_TOKEN_HERE
write-kubeconfig-mode: 644
debug: true
cluster-init: true
node-external-dns:
- cloudflare.com
- google.com
- arc.k3s.com

Reproduction

``` $ curl https://get.k3s.io --output install-"k3s".sh $ sudo chmod +x install-"k3s".sh $ sudo groupadd --system etcd && sudo useradd -s /sbin/nologin --system -g etcd etcd $ sudo modprobe ip_vs_rr $ sudo modprobe ip_vs_wrr $ sudo modprobe ip_vs_sh $ sudo printf "on_oovm.panic_on_oom=0 \nvm.overcommit_memory=1 \nkernel.panic=10 \nkernel.panic_ps=1 \nkernel.panic_on_oops=1 \n" > ~/90-kubelet.conf $ sudo cp 90-kubelet.conf /etc/sysctl.d/ $ sudo systemctl restart systemd-sysctl $ COMMIT=4fc38646d3d7eb61995b0edb49f9255dc7af3a6a $ sudo INSTALL_K3S_COMMIT=$COMMIT INSTALL_K3S_EXEC=server ./install-k3s.sh $ k apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml $ kgp dnsutils $ kgn -o yaml | grep -i dns $ k3s -v $ k exec -it dnsutils -- nslookup -debug cloudflare.com > cloudflare $ k exec -it dnsutils -- nslookup -debug google.com > google $ k exec -it dnsutils -- nslookup -debug arc.k3s.com > arc ``` **Results:** $ kgn -o yaml | grep -i dns ``` k3s.io/node-args: '["server","--node-external-ip","4.4.4.205","--token","********","--write-kubeconfig-mode","644","--debug","true","--cluster-init","true","--node-external-dns","cloudflare.com","--node-external-dns","google.com","--node-external-dns","arc.k3s.com"]' ```