This message was deleted.
# k3d
a
This message was deleted.
b
I needed to send the right info to the cattle-system agents so that I could get kubectl
Copy code
$ 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}\"
                 }
             ]
         }
     }
 }
}"