-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·58 lines (44 loc) · 1.69 KB
/
setup.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
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
#create k3s cluster
k3d create
k3d ls
#wait for cluster to initialize before grabbing config
sleep 5
export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
#insert gcr access token for image pull
kubectl --namespace=default create secret docker-registry registry-secret \
--docker-server=https://eu.gcr.io \
--docker-password="$(gcloud auth print-access-token)" \
--docker-username=oauth2accesstoken \
kubectl create namespace auth
kubectl --namespace=auth create secret docker-registry registry-secret \
--docker-server=https://eu.gcr.io \
--docker-password="$(gcloud auth print-access-token)" \
--docker-username=oauth2accesstoken \
#wait for service account to come online
sleep 15
kubectl get serviceaccounts
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "registry-secret"}]}'
echo "account patched"
sleep 10
#TODO We don't use helm/traefik, so remove:
kubectl delete -n kube-system helmcharts traefik
kubectl apply -f local-manifest.yaml
kubectl apply -f redis-manifest.yaml
kubectl apply -f ambassador-rbac.yaml
kubectl apply -f api-auth-manifest.yaml
#kubectl create namespace auth
#TODO push configmaps
#TODO push ratelimiting
#TODO push backend services as required
sleep 5
kubectl get pods --all-namespaces
echo "This may take a while, you may want to run '$ watch -n 5 KUBECONFIG=\"$(k3d get-kubeconfig --name=\'k3s-default\')\" kubectl get pods --all-namespaces' "
sleep 120
kubectl get pods --all-namespaces
echo "waiting to delete"
read -p "$*"
kubectl get pods --all-namespaces
k3d delete