Merge pull request #64292 from awly/gce-pull-exec-plugin

Automatic merge from submit-queue (batch tested with PRs 64582, 64292). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Pull gke-exec-auth-plugin binary on Nodes

If the plugin URL is set and VM is not master, pull the plugin binary.

**What this PR does / why we need it**: implement deployment of https://github.com/kubernetes/cloud-provider-gcp/tree/master/cmd/gke-exec-auth-plugin on Node VMs.

**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2018-05-31 19:04:03 -07:00
committed by GitHub

View File

@@ -264,6 +264,18 @@ runtime-endpoint: ${CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/dockershim.sock}
EOF
}
function install-exec-auth-plugin {
if [[ ! "${EXEC_AUTH_PLUGIN_URL:-}" ]]; then
return
fi
local -r plugin_url="${EXEC_AUTH_PLUGIN_URL}"
local -r plugin_sha1="${EXEC_AUTH_PLUGIN_SHA1}"
echo "Downloading gke-exec-auth-plugin binary"
download-or-bust "${plugin_sha1}" "${plugin_url}"
mv "${KUBE_HOME}/gke-exec-auth-plugin" "${KUBE_BIN}"
}
function install-kube-manifests {
# Put kube-system pods manifests in ${KUBE_HOME}/kube-manifests/.
local dst_dir="${KUBE_HOME}/kube-manifests"
@@ -403,6 +415,10 @@ function install-kube-binary-config {
# Install crictl on each node.
install-crictl
if [[ "${KUBERNETES_MASTER:-}" == "false" ]]; then
install-exec-auth-plugin
fi
# Clean up.
rm -rf "${KUBE_HOME}/kubernetes"
rm -f "${KUBE_HOME}/${server_binary_tar}"