This commit is contained in:
Adolfo Delorenzo 2021-07-06 22:36:20 -06:00
parent bac3c75a95
commit 6d827f858b

View File

@ -35,7 +35,7 @@ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /va
usermod -aG docker portainer usermod -aG docker portainer
#Start minikube #Start minikube
sudo -u portainer minikube start --driver=docker --ports=":30778" --ports=":9001" sudo -u portainer minikube start --nodes 3 --driver=docker --ports=":30778" --ports=":9001"
#Add the metrics server to the minikube cluster #Add the metrics server to the minikube cluster
sudo -u portainer minikube addons enable metrics-server sudo -u portainer minikube addons enable metrics-server
@ -57,10 +57,11 @@ http --form POST :9000/api/endpoints \
Name="docker" EndpointCreationType=1 Name="docker" EndpointCreationType=1
#Get mapped 30778 port from control-plane #Get mapped 30778 port from control-plane
sleep 5 jwt=`http POST :9000/api/auth Username="portainer" Password="portainer1234" | jq '.jwt' | sed 's/^.//' | sed 's/.$//'`
port=`docker port minikube | grep 30778 | head -1 | awk '$1=$1' FS=":" OFS=" " | awk '{ print $4 }'` port=`docker port minikube | grep 30778 | head -1 | awk '$1=$1' FS=":" OFS=" " | awk '{ print $4 }'`
#Add local Kubernetes endpoint #Add local Kubernetes endpoint
sleep 20
sudo -u portainer http --form POST :9000/api/endpoints \ sudo -u portainer http --form POST :9000/api/endpoints \
"Authorization: Bearer $jwt" \ "Authorization: Bearer $jwt" \
Name="kubernetes" URL="tcp://10.0.2.8:$port" \ Name="kubernetes" URL="tcp://10.0.2.8:$port" \