-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·42 lines (34 loc) · 902 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·42 lines (34 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
set -xe
echo "$KUBE_CONFIG" | base64 -d > /tmp/kube_config
export KUBECONFIG=/tmp/kube_config
if [ -z ${KUBECTL_VERSION} ] ; then
echo "Using kubectl version: $(kubectl version --client --short)"
else
echo "Installing kubectl version: $KUBECTL_VERSION"
rm /usr/local/bin/kubectl
case $KUBECTL_VERSION in
1.21)
KUBECTL_VERSION="1.21.14"
;;
1.22)
KUBECTL_VERSION="1.22.17"
;;
1.23)
KUBECTL_VERSION="1.23.17"
;;
1.24)
KUBECTL_VERSION="1.24.11"
;;
1.25)
KUBECTL_VERSION="1.25.7"
;;
1.26)
KUBECTL_VERSION="1.26.2"
;;
esac
curl -LO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin/
fi
sh -c "$*"