mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 10:02:56 +01:00
Add kubectl install script
This commit is contained in:
parent
a0317aa98d
commit
5cd81e9b3c
1 changed files with 21 additions and 0 deletions
21
scripts/install-kubectl
Executable file
21
scripts/install-kubectl
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -xeou pipefail
|
||||
|
||||
KUBECTL_VERSION=${1}
|
||||
KUBECTL_DOWNLOAD_URL="https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64"
|
||||
|
||||
apt-get update
|
||||
apt-get -y install curl
|
||||
|
||||
curl -fsSL "${KUBECTL_DOWNLOAD_URL}/kubectl" -o kubectl
|
||||
curl -fsSL "${KUBECTL_DOWNLOAD_URL}/kubectl.sha256" -o kubectl.sha256
|
||||
echo "$(cat kubectl.sha256) kubectl" | sha256sum -c -
|
||||
|
||||
chmod +x kubectl
|
||||
mv kubectl /usr/local/bin/kubectl
|
||||
|
||||
rm kubectl.sha256
|
||||
apt-get -yq autoremove
|
||||
apt-get clean -yqq
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
Loading…
Add table
Add a link
Reference in a new issue