From 5061dc5bb5c9aaba8fcfb3cb06404ada084a1908 Mon Sep 17 00:00:00 2001 From: Dale Smith Date: Thu, 22 Dec 2022 16:06:07 +1300 Subject: [PATCH] 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 --- .../kubernetes/fragments/configure-kubernetes-master.sh | 1 + .../kubernetes/fragments/configure-kubernetes-minion.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh b/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh index f2a21c9352..c4a1f8e6ec 100644 --- a/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh +++ b/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh @@ -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}" diff --git a/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh b/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh index ca907c2be5..23bd33a650 100644 --- a/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh +++ b/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh @@ -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}"