-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·49 lines (41 loc) · 1.71 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
#!/bin/bash
# Environment variable
METALLB_VER='v0.9.6'
sudo chmod -R 777 ~/.minikube
sudo chmod -R 777 ~/.kube
minikube stop
minikube delete
minikube start --driver=docker
# Configure environment to use minikube’s Docker daemon
eval $(minikube docker-env)
# Build docker images from Dockerfile
docker build -t nginx:ysaito ./srcs/nginx
docker build -t mysql:ysaito ./srcs/mysql
docker build -t phpmyadmin:ysaito ./srcs/phpmyadmin
docker build -t wordpress:ysaito ./srcs/wordpress
docker build -t ftps:ysaito ./srcs/ftps
docker build -t influxdb:ysaito ./srcs/influxdb
docker build -t grafana:ysaito ./srcs/grafana
# Create secret
kubectl create secret generic influxdb-creds \
--from-literal=INFLUXDB_DATABASE=telegraf \
--from-literal=INFLUXDB_USERNAME=admin42 \
--from-literal=INFLUXDB_PASSWORD=admin42 \
--from-literal=INFLUXDB_HOST=influxdb-svc
kubectl create secret generic grafana-creds \
--from-literal=GF_SECURITY_ADMIN_USER=admin42 \
--from-literal=GF_SECURITY_ADMIN_PASSWORD=admin42
# Create objects
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/${METALLB_VER}/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/${METALLB_VER}/manifests/metallb.yaml
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
kubectl apply -f ./srcs/yamls/metallb-config.yaml
kubectl apply -f ./srcs/yamls/nginx.yaml
kubectl apply -f ./srcs/yamls/mysql.yaml
kubectl apply -f ./srcs/yamls/phpmyadmin.yaml
kubectl apply -f ./srcs/yamls/wordpress.yaml
kubectl apply -f ./srcs/yamls/ftps.yaml
kubectl apply -f ./srcs/yamls/influxdb.yaml
kubectl apply -f ./srcs/yamls/grafana.yaml
# Open Kubernetes Dashboard
minikube dashboard