Allow fetching bootstrap-kubeconfig from VM metadata

pull/8/head
Andrew Lytvynov 2018-05-03 11:32:18 -07:00
parent 0a567f0990
commit 77c13d6dc7
1 changed files with 3 additions and 0 deletions

View File

@ -914,6 +914,9 @@ contexts:
name: service-account-context
current-context: service-account-context
EOF
elif [[ "${FETCH_BOOTSTRAP_KUBECONFIG:-false}" == "true" ]]; then
echo "Fetching kubelet bootstrap-kubeconfig file from metadata"
get-metadata-value "instance/attributes/bootstrap-kubeconfig" >/var/lib/kubelet/bootstrap-kubeconfig
else
echo "Fetching kubelet kubeconfig file from metadata"
get-metadata-value "instance/attributes/kubeconfig" >/var/lib/kubelet/kubeconfig