sigs.k8s.io/cluster-api-provider-azure@v1.17.0/templates/flavors/private/patches/apiserver-host-dns.yaml (about) 1 apiVersion: controlplane.cluster.x-k8s.io/v1beta1 2 kind: KubeadmControlPlane 3 metadata: 4 name: "${CLUSTER_NAME}-control-plane" 5 spec: 6 kubeadmConfigSpec: 7 preKubeadmCommands: 8 # this is a workaround for the hairpin routing problem with internal load balancers. 9 # the first control plane needs to route to itself for kubeadm init to succeed. 10 # TODO: keep only /run/kubeadm/kubeadm.yaml for v1beta1 11 - if [ -f /tmp/kubeadm.yaml ] || [ -f /run/kubeadm/kubeadm.yaml ]; then echo '127.0.0.1 apiserver.${CLUSTER_NAME}.capz.io apiserver' >> /etc/hosts; fi 12 postKubeadmCommands: 13 # TODO: keep only /run/kubeadm/kubeadm.yaml for v1beta1 14 # any additional control planes need to route to the load balancer to check the health of the api server before kubeadm join. 15 # after the control plane has joined the cluster, it should route to itself to reach the apiserver. 16 - if [ -f /tmp/kubeadm-join-config.yaml ] || [ -f /run/kubeadm/kubeadm-join-config.yaml ]; then echo '127.0.0.1 apiserver.${CLUSTER_NAME}.capz.io apiserver' >> /etc/hosts; fi