Fix kubelet for Fedora CoreOS 36 to provide real resolvconf to containers.

In Fedora CoreOS 36 CoreDNS cannot start correctly due to a loopback issue
where /etc/resolv.conf is mounted and points to localhost.

Tested on Fedora CoreOS 35,36,37, with Docker and containerd.

https://coredns.io/plugins/loop/#troubleshooting-loops-in-kubernetes-clusters
https://fedoraproject.org/wiki/Changes/systemd-resolved#Detailed_Description

Story: 2010519
Depends-On: I3242b718e32c92942ac471bc7e182a42e803005b

Change-Id: I8106324ce71d6c22fa99e1a84b5a09743315811a
This commit is contained in:
Dale Smith 2022-12-22 16:06:07 +13:00 committed by Jake Yip
parent fbfd3ce9a3
commit 5061dc5bb5
2 changed files with 2 additions and 0 deletions

View File

@ -432,6 +432,7 @@ $ssh_cmd mkdir -p /etc/kubernetes/manifests
KUBELET_ARGS="--register-node=true --pod-manifest-path=/etc/kubernetes/manifests --hostname-override=${INSTANCE_NAME}"
KUBELET_ARGS="${KUBELET_ARGS} --pod-infra-container-image=${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}pause:3.1"
KUBELET_ARGS="${KUBELET_ARGS} --cluster_dns=${DNS_SERVICE_IP} --cluster_domain=${DNS_CLUSTER_DOMAIN}"
KUBELET_ARGS="${KUBELET_ARGS} --resolv-conf=/run/systemd/resolve/resolv.conf"
KUBELET_ARGS="${KUBELET_ARGS} --volume-plugin-dir=/var/lib/kubelet/volumeplugins"
KUBELET_ARGS="${KUBELET_ARGS} ${KUBELET_OPTIONS}"

View File

@ -246,6 +246,7 @@ mkdir -p /etc/kubernetes/manifests
KUBELET_ARGS="--pod-manifest-path=/etc/kubernetes/manifests --kubeconfig ${KUBELET_KUBECONFIG} --hostname-override=${INSTANCE_NAME}"
KUBELET_ARGS="${KUBELET_ARGS} --address=${KUBE_NODE_IP} --port=10250 --read-only-port=0 --anonymous-auth=false --authorization-mode=Webhook --authentication-token-webhook=true"
KUBELET_ARGS="${KUBELET_ARGS} --cluster_dns=${DNS_SERVICE_IP} --cluster_domain=${DNS_CLUSTER_DOMAIN}"
KUBELET_ARGS="${KUBELET_ARGS} --resolv-conf=/run/systemd/resolve/resolv.conf"
KUBELET_ARGS="${KUBELET_ARGS} --volume-plugin-dir=/var/lib/kubelet/volumeplugins"
KUBELET_ARGS="${KUBELET_ARGS} --node-labels=magnum.openstack.org/role=${NODEGROUP_ROLE}"
KUBELET_ARGS="${KUBELET_ARGS} --node-labels=magnum.openstack.org/nodegroup=${NODEGROUP_NAME}"