Skip to content

Commit 7e7570d

Browse files
committed
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.
1 parent 4884873 commit 7e7570d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cluster/gce/config-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,5 @@ WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=win1809:NoSche
525525
GCE_PRIVATE_CLUSTER="${KUBE_GCE_PRIVATE_CLUSTER:-false}"
526526

527527
ETCD_LISTEN_CLIENT_IP=0.0.0.0
528+
529+
GCE_UPLOAD_KUBCONFIG_TO_MASTER_METADATA=true

cluster/gce/util.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,6 +3016,11 @@ function check-cluster() {
30163016

30173017
# ensures KUBECONFIG is set
30183018
get-kubeconfig-basicauth
3019+
3020+
if [[ ${GCE_UPLOAD_KUBCONFIG_TO_MASTER_METADATA:-} == "true" ]]; then
3021+
gcloud compute instances add-metadata "${MASTER_NAME}" --zone="${ZONE}" --metadata-from-file="kubeconfig=${KUBECONFIG}" || true
3022+
fi
3023+
30193024
echo
30203025
echo -e "${color_green}Kubernetes cluster is running. The master is running at:"
30213026
echo

0 commit comments

Comments
 (0)