aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-minimal-onap/tools/get_kubectl.sh
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-11-29 15:15:51 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2019-12-18 07:29:23 +0000
commit216bd6a4870c680555d586f0010a633d5fa15700 (patch)
treec5372dd04226259bd4049a29ecb7d6a24dd8788c /bootstrap/vagrant-minimal-onap/tools/get_kubectl.sh
parent83040dff44e13c08a73a78c98ae64d7812fc3b6e (diff)
Import Vagrant environment from test/security/k8s
Infrastructure mockup has been previously set up for CIS guidelines checking. Empty Kubernetes cluster was sufficient for that purpose. It will be adjusted to satisfy minimal ONAP requirements and should eventually supersede previous testing environment. Issue-ID: ONAPARC-537 Change-Id: Iada29d86642b8a5513e9d1bbd895db2094ad12b9 Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'bootstrap/vagrant-minimal-onap/tools/get_kubectl.sh')
-rwxr-xr-xbootstrap/vagrant-minimal-onap/tools/get_kubectl.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/bootstrap/vagrant-minimal-onap/tools/get_kubectl.sh b/bootstrap/vagrant-minimal-onap/tools/get_kubectl.sh
new file mode 100755
index 000000000..752c286c2
--- /dev/null
+++ b/bootstrap/vagrant-minimal-onap/tools/get_kubectl.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+#
+# @file test/security/k8s/tools/dublin/get_kubectl.sh
+# @author Pawel Wieczorek <p.wieczorek2@samsung.com>
+# @brief Utility for obtaining kubectl tool
+#
+
+# Dependencies:
+# wget
+# coreutils
+#
+# Privileges:
+# Script expects to be run with administrative privileges for accessing /usr/local/bin
+#
+# Usage:
+# # ./get_kubectl.sh [VERSION [ARCH [SYSTEM]]]
+#
+
+# Constants
+BINARY='kubectl'
+INSTALL_DIR='/usr/local/bin/'
+
+DEFAULT_VERSION='v1.13.5'
+DEFAULT_ARCH='amd64'
+DEFAULT_SYSTEM='linux'
+
+# Variables
+VERSION="${1:-$DEFAULT_VERSION}"
+ARCH="${2:-$DEFAULT_ARCH}"
+SYSTEM="${3:-$DEFAULT_SYSTEM}"
+
+URL="https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/${SYSTEM}/${ARCH}/${BINARY}"
+
+
+# Prerequistes
+wget "$URL"
+chmod +x "$BINARY"
+
+# Installation
+mv "$BINARY" "$INSTALL_DIR"