Remove temp DNS resolver fix

This PS adopts DNS resolver fix from this osh-infra project:

https: //
Change-Id: Ie4a27422dbc9c71681c44635547f8b3a89aa6e45
This commit is contained in:
Sergiy Markin 2024-03-29 20:45:52 +00:00
parent 6e89848cc1
commit 65e5a5d3e5
1 changed files with 1 additions and 10 deletions

View File

@ -45,26 +45,17 @@ EOF
kubectl apply -f /tmp/${NAMESPACE}-ns.yaml
# DNS resolve temp fix
cat << EOF | sudo tee /etc/resolv.conf > /dev/null
search svc.cluster.local cluster.local
options ndots:5 timeout:1 attempts:1
# CoreDNS version upgrade
kubectl set image deployment coredns -n kube-system "${COREDNS_VERSION}"
kubectl rollout restart -n kube-system deployment/coredns
kubectl rollout status --watch --timeout=300s -n kube-system deployment/coredns
# Add control-plane.minikube.internal host resord into CodeDNS
HOSTIP=$(hostname -I| awk '{print $1}')
kubectl get configmap coredns -n kube-system -o json | jq -r "{data: .data}" > "${PATCH}"
sed -i "s;forward . /etc/resolv.conf {\\\n max_concurrent 1000\\\n }\\\n;forward . /etc/resolv.conf {\\\n }\\\n hosts {\\\n $HOSTIP control-plane.minikube.internal\\\n fallthrough\\\n }\\\n;" "${PATCH}"
sed -i "s;forward . {\\\n max_concurrent 1000\\\n }\\\n;forward . {\\\n max_concurrent 1000\\\n }\\\nhosts {\\\n $HOSTIP control-plane.minikube.internal\\\n fallthrough\\\n }\\\n;" "${PATCH}"
kubectl patch configmap coredns -n kube-system --patch-file "${PATCH}"
rm -f "${PATCH}"
kubectl rollout restart -n kube-system deployment/coredns