mirror of https://github.com/k3s-io/k3s
Upload kubeconfig to master metadata in tests.
Till a few days ago, it was possible to ssh into master and access cluster via insecure master port. Now, the master insecure port has been disabled, we're not able to do that anymore. This PR aims to fix that by uploading the kubeconfig to the master metadata during cluster setup in tests.k3s-v1.15.3
parent
4884873160
commit
7e7570d6ff
|
@ -525,3 +525,5 @@ WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=win1809:NoSche
|
||||||
GCE_PRIVATE_CLUSTER="${KUBE_GCE_PRIVATE_CLUSTER:-false}"
|
GCE_PRIVATE_CLUSTER="${KUBE_GCE_PRIVATE_CLUSTER:-false}"
|
||||||
|
|
||||||
ETCD_LISTEN_CLIENT_IP=0.0.0.0
|
ETCD_LISTEN_CLIENT_IP=0.0.0.0
|
||||||
|
|
||||||
|
GCE_UPLOAD_KUBCONFIG_TO_MASTER_METADATA=true
|
||||||
|
|
|
@ -3016,6 +3016,11 @@ function check-cluster() {
|
||||||
|
|
||||||
# ensures KUBECONFIG is set
|
# ensures KUBECONFIG is set
|
||||||
get-kubeconfig-basicauth
|
get-kubeconfig-basicauth
|
||||||
|
|
||||||
|
if [[ ${GCE_UPLOAD_KUBCONFIG_TO_MASTER_METADATA:-} == "true" ]]; then
|
||||||
|
gcloud compute instances add-metadata "${MASTER_NAME}" --zone="${ZONE}" --metadata-from-file="kubeconfig=${KUBECONFIG}" || true
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "${color_green}Kubernetes cluster is running. The master is running at:"
|
echo -e "${color_green}Kubernetes cluster is running. The master is running at:"
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue