diff options
| -rw-r--r-- | grafana.db | bin | 1105920 -> 0 bytes | |||
| -rwxr-xr-x | setup.sh | 50 | ||||
| -rw-r--r-- | srcs/influxdb/telegraf.conf | 2 |
3 files changed, 40 insertions, 12 deletions
diff --git a/grafana.db b/grafana.db Binary files differdeleted file mode 100644 index 1f2d379..0000000 --- a/grafana.db +++ /dev/null @@ -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 diff --git a/srcs/influxdb/telegraf.conf b/srcs/influxdb/telegraf.conf index fef7cb1..019cc2b 100644 --- a/srcs/influxdb/telegraf.conf +++ b/srcs/influxdb/telegraf.conf @@ -14,7 +14,7 @@ [[outputs.influxdb]] - urls = ["http://influxdb-service:8086"] + urls = ["http://localhost:8086"] database = "influxdb" [[inputs.cpu]] |
