From e1412a414677f5dc14d3e03754f34961e439783c Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 29 Oct 2020 12:39:34 +0100 Subject: Fixing influxdb telegraf on itself, Added complete setup.sh script --- setup.sh | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) (limited to 'setup.sh') diff --git a/setup.sh b/setup.sh index ab15a4f..d0034b8 100755 --- a/setup.sh +++ b/setup.sh @@ -1,14 +1,36 @@ #!/bin/sh -build_image () { - echo "=============================================== BUILDING $1" - docker build -t "$1-service" "srcs/$1" - echo +[ "$1" = -u ] && update_only=yes + +log () { + printf "=============================================== " + echo "$1" } -create_service () { - echo "=============================================== CREATING SERVICE $1" - kubectl apply -f "srcs/$1/$1.yaml" +if [ -z "$update_only" ] +then + minikube delete + minikube start --driver=virtualbox + + eval $(minikube docker-env) + + log "SETTING UP metallb" + minikube addons enable metallb + # https://metallb.universe.tf/installation/#preparation + kubectl get configmap kube-proxy -n kube-system -o yaml | \ + sed -e 's/strictARP: false/strictARP: true/' -e 's/mode: ""/mode: "ipvs"/' | \ + kubectl apply -f - -n kube-system + # https://metallb.universe.tf/installation/#installation-by-manifest + kubectl apply -f 'https://raw.githubusercontent.com/metallb/metallb/v0.9.4/manifests/namespace.yaml' + kubectl apply -f 'https://raw.githubusercontent.com/metallb/metallb/v0.9.4/manifests/metallb.yaml' + kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)" + # metallb config + kubectl apply -f srcs/metallb-config.yaml +fi + +build_image () { + log "BUILDING $1" + docker build -t "$1-service" "srcs/$1" echo } @@ -20,9 +42,11 @@ build_image mysql build_image grafana build_image influxdb -# minikube start -# eval $(minikube docker-env) - +create_service () { + log "CREATING SERVICE $1" + kubectl apply -f "srcs/$1/$1.yaml" + echo +} create_service ftps create_service nginx @@ -32,4 +56,8 @@ create_service mysql create_service grafana create_service influxdb -# minikube dashboard +if [ -z "$update_only" ] +then + log "LAUCHING dashboard" + minikube dashboard +fi -- cgit