@@ -52,7 +52,7 @@ function setup_arch_and_os(){
52
52
53
53
OS=$( uname | tr ' [:upper:]' ' [:lower:]' )
54
54
case " $OS " in
55
- # Minimalist GNU for Windows
55
+ # Minimalist GNU for Windows
56
56
" mingw" * ) OS=' windows' ; return ;;
57
57
esac
58
58
}
@@ -89,11 +89,11 @@ function install_kubectl() {
89
89
90
90
if ! command -v " ${KUBECTL} " & > /dev/null
91
91
then
92
- echo " WARNING: kubectl could not be found. Downloading and installing it locally..."
93
- if ! curl --fail -Lo " ${KUBECTL} " " https://dl.k8s.io/release/${version} /bin/${os} /${arch} /kubectl" ; then
94
- echo " Error: Unable to download kubectl for '${os} -${arch} '"
95
- return 1
96
- fi
92
+ echo " WARNING: kubectl could not be found. Downloading and installing it locally..."
93
+ if ! curl --fail -Lo " ${KUBECTL} " " https://dl.k8s.io/release/${version} /bin/${os} /${arch} /kubectl" ; then
94
+ echo " Error: Unable to download kubectl for '${os} -${arch} '"
95
+ return 1
96
+ fi
97
97
fi
98
98
99
99
chmod +x " ${KUBECTL} "
@@ -106,7 +106,7 @@ function install_helm() {
106
106
local arch=$2
107
107
108
108
# list of helm supported architectures
109
- local supported=" darwin-amd64\ndarwin-arm64\nlinux-386\nlinux-amd64\nlinux-arm\nlinux-arm64\nlinux-ppc64le\nlinux-s390x\nwindows-amd64"
109
+ local supported=" darwin-amd64\ndarwin-arm64\nlinux-386\nlinux-amd64\nlinux-arm\nlinux-arm64\nlinux-ppc64le\nlinux-s390x\nwindows-amd64"
110
110
check_supported_arch_and_os " ${supported} " " ${os} " " ${arch} " helm
111
111
112
112
HELM_VERSION=" v3.15.3"
@@ -115,8 +115,8 @@ function install_helm() {
115
115
then
116
116
echo " WARNING: helm could not be found. Downloading and installing it locally..."
117
117
if ! curl --fail -Lo " ./helm-${HELM_VERSION} -${os} -${arch} .tar.gz" " https://get.helm.sh/helm-${HELM_VERSION} -${os} -${arch} .tar.gz" ; then
118
- echo " Error: Unable to download helm for '${os} -${arch} '"
119
- return 1
118
+ echo " Error: Unable to download helm for '${os} -${arch} '"
119
+ return 1
120
120
fi
121
121
tar -zxvf " helm-${HELM_VERSION} -${os} -${arch} .tar.gz"
122
122
mv " ${os} -${arch} /helm" " ${HELM} "
@@ -142,8 +142,8 @@ function install_metrics_server() {
142
142
" ${HELM} " repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
143
143
" ${HELM} " repo update
144
144
" ${HELM} " upgrade --install metrics-server metrics-server/metrics-server \
145
- --set ' args={"--kubelet-insecure-tls=true"}' \
146
- --namespace kube-system --kubeconfig " ${kubeconfig} "
145
+ --set ' args={"--kubelet-insecure-tls=true"}' \
146
+ --namespace kube-system --kubeconfig " ${kubeconfig} "
147
147
" ${KUBECTL} " -n kube-system rollout status deployment metrics-server --kubeconfig " ${kubeconfig} "
148
148
}
149
149
@@ -157,7 +157,7 @@ function install_gcloud() {
157
157
158
158
# Login to gcloud
159
159
echo " ${GCLOUD_KEY} " | base64 -d > " ${GCLOUD_KEY_FILE} "
160
- " ${GCLOUD} " auth activate-service-account --key-file=" ${BINDIR} /gke_key_file.json"
160
+ " ${GCLOUD} " auth activate-service-account --key-file=" ${BINDIR} /gke_key_file.json"
161
161
" ${GCLOUD} " config set project " ${GCLOUD_PROJECT_ID} " -q
162
162
}
163
163
@@ -178,4 +178,13 @@ function wait_kyverno() {
178
178
echo " Failed to wait for kyverno deployments to be ready"
179
179
exit 1
180
180
fi
181
- }
181
+ }
182
+
183
+ function install_clusterctl() {
184
+ local os=$1
185
+ local arch=$2
186
+
187
+ curl -L " https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.5/clusterctl-${os} -${arch} " -o clusterctl
188
+ sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl
189
+ clusterctl version
190
+ }
0 commit comments