Update hack/create-cluster.sh
Co-authored-by: Kevin Wang <kevinwzf0126@gmail.com>
This commit is contained in:
parent
6df7f16ee3
commit
bd1d7d6129
|
@ -34,6 +34,6 @@ kind create cluster --name "${CLUSTER_NAME}" --kubeconfig="${KUBECONFIG}" --wait
|
|||
kubectl config rename-context "kind-${CLUSTER_NAME}" "${CLUSTER_NAME}" --kubeconfig="${KUBECONFIG}"
|
||||
|
||||
# Kind cluster uses `127.0.0.1` as kube-apiserver endpoint by default, thus kind clusters can't reach each other.
|
||||
# So we need to update endpoint with docker IP.
|
||||
# So we need to update endpoint with container IP.
|
||||
docker_ip=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "${CLUSTER_NAME}-control-plane")
|
||||
kubectl config set-cluster "${CLUSTER_NAME}" --server="https://${docker_ip}:6443" --kubeconfig="${KUBECONFIG}"
|
||||
|
|
Loading…
Reference in New Issue