set config with a cluster name which contains 'kind' prefix. (#38)
This commit is contained in:
parent
b6d49901d5
commit
520b8d3397
|
@ -26,7 +26,7 @@ if [[ -z "${KUBECONFIG}" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# TODO(RainbowMango): pin kind version and install automatically.
|
||||
# TODO(RainbowMango): pin kind version(v0.9.0) and install automatically.
|
||||
kind create cluster --name "${CLUSTER_NAME}" --kubeconfig="${KUBECONFIG}" --wait=120s
|
||||
|
||||
# Kind cluster's context name contains a "kind-" prefix by default.
|
||||
|
@ -36,4 +36,4 @@ kubectl config rename-context "kind-${CLUSTER_NAME}" "${CLUSTER_NAME}" --kubecon
|
|||
# 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 container IP.
|
||||
container_ip=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "${CLUSTER_NAME}-control-plane")
|
||||
kubectl config set-cluster "${CLUSTER_NAME}" --server="https://${container_ip}:6443" --kubeconfig="${KUBECONFIG}"
|
||||
kubectl config set-cluster "kind-${CLUSTER_NAME}" --server="https://${container_ip}:6443" --kubeconfig="${KUBECONFIG}"
|
||||
|
|
Loading…
Reference in New Issue