devstack: add convenience kubectl executable

Before this patch, devstack users had to use:

    hyperkube kubectl

instead of what k8s users are used to:

    kubectl

This patch addresses that with a simple unix shell script.

Change-Id: Ic9471443634680616a5d7675e866d3a10962b5f7
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
This commit is contained in:
Antoni S. Puimedon 2016-11-23 17:29:16 +01:00
parent f357a438d4
commit b7eefd87c7
2 changed files with 8 additions and 0 deletions

3
devstack/kubectl Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
hyperkube kubectl "$@"

View File

@ -271,6 +271,7 @@ function extract_hyperkube {
tmp_hyperkube_path="/tmp/hyperkube" tmp_hyperkube_path="/tmp/hyperkube"
tmp_loopback_cni_path="/tmp/loopback" tmp_loopback_cni_path="/tmp/loopback"
hyperkube_container="$(docker ps -aq \ hyperkube_container="$(docker ps -aq \
-f ancestor="${KURYR_HYPERKUBE_IMAGE}:${KURYR_HYPERKUBE_VERSION}" | \ -f ancestor="${KURYR_HYPERKUBE_IMAGE}:${KURYR_HYPERKUBE_VERSION}" | \
head -1)" head -1)"
@ -281,6 +282,10 @@ function extract_hyperkube {
"$KURYR_HYPERKUBE_BINARY" "$KURYR_HYPERKUBE_BINARY"
sudo install -o "$STACK_USER" -m 0555 -D "$tmp_loopback_cni_path" \ sudo install -o "$STACK_USER" -m 0555 -D "$tmp_loopback_cni_path" \
"${CNI_BIN_DIR}/loopback" "${CNI_BIN_DIR}/loopback"
# Convenience kubectl executable for development
sudo install -o "$STACK_USER" -m 555 -D "${KURYR_HOME}/devstack/kubectl" \
"$(dirname $KURYR_HYPERKUBE_BINARY)/kubectl"
} }
function prepare_kubelet { function prepare_kubelet {