-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·54 lines (46 loc) · 1.97 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
#!/bin/sh
# **************************************************************************** #
# #
# ::: :::::::: #
# setup.sh :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lrocca <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/04/14 15:05:33 by lrocca #+# #+# #
# Updated: 2021/04/14 15:05:33 by lrocca ### ########.fr #
# #
# **************************************************************************** #
if [[ "$1" == "dashboard" ]] || [[ "$1" == "purge" ]] || [[ "$1" == "reset" ]] \
|| [[ "$1" == "reload" ]]; then
./srcs/.scripts/$1.sh
exit
fi
apply="kubectl apply -f"
deploy() {
docker build -t ft-services/$1 ./srcs/$1
$apply ./srcs/$1/$1.yaml
}
# metallb
# https://metallb.universe.tf/installation/
## enable strict arp mode
kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e "s/strictARP: false/strictARP: true/" | \
$apply - -n kube-system
## install by manifest
$apply https://raw.githubusercontent.com/metallb/metallb/v0.9.6/manifests/namespace.yaml
$apply https://raw.githubusercontent.com/metallb/metallb/v0.9.6/manifests/metallb.yaml
### On first install only
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
## apply metallb configuration
# $apply ./srcs/tls.yaml
$apply ./srcs/metallb.yaml
deploy mysql
deploy nginx
deploy wordpress
deploy phpmyadmin
deploy telegraf
deploy grafana
deploy influxdb
deploy ftps
sleep 3
kubectl exec -it `kubectl get pods | grep mysql | tr ' ' '\n' | head -n 1` -- sh /tmp/undump.sh