forked from kotalco/kotal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
multi.sh
executable file
·48 lines (40 loc) · 1.64 KB
/
multi.sh
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
42
43
44
45
46
47
48
#!/bin/sh
set -e
if ! docker info > /dev/null 2>&1; then
echo "Docker isn't running"
echo "Start docker, then try again!"
exit 1
fi
# build manager image once
echo "Building docker image"
make docker-build
for VERSION in '1.19.11' '1.20.7' '1.21.1' '1.22.4' '1.23.0'
do
echo "Testing Kotal operator in kubernetes v$VERSION"
# start Kubernetes in Docker with this kubernetes version
echo "Creating cluster"
kind create cluster --image=kindest/node:v${VERSION}
# install cert-manager
echo "Installing cert manager"
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.3/cert-manager.yaml
# load image and deploy manifests
echo "⏳ Waiting for cert manager to be up and running"
sleep 5
kubectl wait -n cert-manager --for=condition=available deployments/cert-manager --timeout=600s
kubectl wait -n cert-manager --for=condition=available deployments/cert-manager-cainjector --timeout=600s
kubectl wait -n cert-manager --for=condition=available deployments/cert-manager-webhook --timeout=600s
echo "🚀 Cert manager is up and running"
echo "Installing Kotal custom resources"
echo "Deploying Kotal controller manager"
make kind
echo "⏳ Waiting for kotal controller manager to be up and running"
kubectl wait -n kotal --for=condition=available deployments/controller-manager --timeout=600s
echo "🚀 Kotal is up and running"
echo "🔥 Running tests"
# test against image
USE_EXISTING_CLUSTER=true make test
# delete cluster
echo "🎉 All tests has been passed"
echo "🔥 Deleting kubernetes cluster v$VERSION"
kind delete cluster
done