adamant-kite-43734
08/05/2020, 3:03 AMbitter-hairdresser-7812
09/04/2020, 3:41 PM$ cat patch_cattle-system.sh
# <https://github.com/rancher/rancher/issues/18832#issuecomment-547728856>
RANCHER_SERVER_HOSTNAME=rancher.localdev
RANCHER_SERVER_IP=127.0.0.1
kubectl -n cattle-system patch deployments cattle-cluster-agent --patch "{
\"spec\": {
\"template\": {
\"spec\": {
\"hostAliases\": [
{
\"hostnames\":
[
\"${RANCHER_SERVER_HOSTNAME}\"
],
\"ip\": \"${RANCHER_SERVER_IP}\"
}
]
}
}
}
}"
kubectl -n cattle-system patch daemonsets cattle-node-agent --patch "{
\"spec\": {
\"template\": {
\"spec\": {
\"hostAliases\": [
{
\"hostnames\":
[
\"${RANCHER_SERVER_HOSTNAME}\"
],
\"ip\": \"${RANCHER_SERVER_IP}\"
}
]
}
}
}
}"