Skip to content

Commit e6e265b

Browse files
add kubectl 1.23
1 parent 223ef44 commit e6e265b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RUN apk update && apk add curl
44

55
RUN export ARCH=$([[ "$(uname -m)" == "aarch64" ]] && echo "arm64" || echo "amd64") && \
66
mkdir -p /tmp/kubectl-versions && cd /tmp/kubectl-versions \
7+
curl -o kubectl1.23 -L https://storage.googleapis.com/kubernetes-release/release/v1.23.0/bin/linux/${ARCH}/kubectl && \
78
curl -o kubectl1.22 -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/${ARCH}/kubectl && \
89
curl -o kubectl1.21 -L https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/${ARCH}/kubectl && \
910
curl -o kubectl1.20 -L https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/${ARCH}/kubectl && \
@@ -22,6 +23,8 @@ RUN export ARCH=$([[ "$(uname -m)" == "aarch64" ]] && echo "arm64" || echo "amd6
2223

2324
FROM debian:bullseye-slim
2425

26+
RUN apt-get update -y && apt-get install busybox -y && ln -s /bin/busybox /usr/bin/[[
27+
2528
RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu
2629

2730
#RUN apt update && apt upgrade && apt install bash # THIS IS NOT REQUIRED. BASH IS ALREADY INCLUDED IN BULLSEYE

cf-deploy-kubernetes.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fi
4242
if [[ -n "${SERVER_VERSION}" ]]; then
4343
# Statically define SERVER_VERSION from variable override
4444
echo "Statically defined version: ${SERVER_VERSION}"
45-
# Assign kubectl version
45+
# Assign kubectl version
4646
echo "Setting kubectl to version 1.${SERVER_VERSION}"
4747
cp -f "/usr/local/bin/kubectl1.${SERVER_VERSION}" /usr/local/bin/kubectl 2>/dev/null
4848
else
@@ -58,7 +58,8 @@ else
5858
if (( "$SERVER_VERSION" == "19" )); then cp -f /usr/local/bin/kubectl1.19 /usr/local/bin/kubectl; fi 2>/dev/null
5959
if (( "$SERVER_VERSION" == "20" )); then cp -f /usr/local/bin/kubectl1.20 /usr/local/bin/kubectl; fi 2>/dev/null
6060
if (( "$SERVER_VERSION" == "21" )); then cp -f /usr/local/bin/kubectl1.21 /usr/local/bin/kubectl; fi 2>/dev/null
61-
if (( "$SERVER_VERSION" >= "22" )); then cp -f /usr/local/bin/kubectl1.22 /usr/local/bin/kubectl; fi 2>/dev/null
61+
if (( "$SERVER_VERSION" == "22" )); then cp -f /usr/local/bin/kubectl1.22 /usr/local/bin/kubectl; fi 2>/dev/null
62+
if (( "$SERVER_VERSION" >= "23" )); then cp -f /usr/local/bin/kubectl1.23 /usr/local/bin/kubectl; fi 2>/dev/null
6263
[ ! -f "${deployment_file}" ] && echo "Couldn't find $deployment_file file at $(pwd)" && exit 1;
6364
fi
6465

@@ -77,18 +78,23 @@ if [[ -n "${KUBE_CTL_TEST_VERSION}" ]]; then
7778
fatal "Version Mismatch!!!"
7879
exit 1
7980
fi
80-
fi
81+
fi
8182

8283
DEPLOYMENT_FILE=${deployment_file}-$(date '+%y-%m-%d_%H-%M-%S').yml
8384
$(dirname $0)/template.sh "$deployment_file" > "$DEPLOYMENT_FILE" || fatal "Failed to apply deployment template on $deployment_file"
8485

86+
if (( "$SERVER_VERSION" <= "17" )); then
87+
dry_run_value=true
88+
else
89+
dry_run_value=client
90+
fi
8591

8692
echo -e "\n\n---> Kubernetes objects to deploy in $deployment_file :"
8793
KUBECTL_OBJECTS=/tmp/deployment.objects
8894
kubectl $KUBECTL_ACTION \
8995
--context "${KUBECONTEXT}" \
9096
--namespace "${KUBERNETES_NAMESPACE}" \
91-
--dry-run \
97+
--dry-run=${dry_run_value} \
9298
-f "$DEPLOYMENT_FILE" \
9399
-o go-template \
94100
--template '{{ if .items }}{{ range .items }}{{ printf "%-30s%-50s\n" .kind .metadata.name}}{{end}}{{else}}{{ printf "%-30s%-50s\n" .kind .metadata.name}}{{end}}' \

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 16.2.0
1+
version: 16.2.1

0 commit comments

Comments
 (0)