diff --git a/first_boot.sh b/first_boot.sh index 36502dc..dbc5215 100755 --- a/first_boot.sh +++ b/first_boot.sh @@ -46,7 +46,7 @@ http POST http://localhost:9000/api/users/admin/init Username="portainer" Passwo #Add Portainer Agent to the local kind Kubernetes cluster sudo -u portainer curl -L https://downloads.portainer.io/portainer-agent-k8s-nodeport.yaml -o /home/portainer/portainer-agent-k8s.yaml; sudo -u portainer kubectl apply -f /home/portainer/portainer-agent-k8s.yaml sudo -u portainer rm /home/portainer/portainer-agent-k8s.yaml -sleep 20 +sleep 15 #Get the admin JWT token jwt=`http POST :9000/api/auth Username="portainer" Password="portainer1234" | jq '.jwt' | sed 's/^.//' | sed 's/.$//'` @@ -57,10 +57,14 @@ http --form POST :9000/api/endpoints \ Name="docker" EndpointCreationType=1 #Get mapped 30778 port from control-plane +sleep 5 port=`docker port minikube | grep 30778 | head -1 | awk '$1=$1' FS=":" OFS=" " | awk '{ print $4 }'` #Add local Kubernetes endpoint sudo -u portainer http --form POST :9000/api/endpoints \ "Authorization: Bearer $jwt" \ -Name="kubernetes" URL="tcp://10.0.2.8:$port" EndpointCreationType=2 TLS="true" TLSSkipVerify="true" TLSSkipClientVerify="true" +Name="kubernetes" URL="tcp://10.0.2.8:$port" \ +EndpointCreationType=2 \ +TLS="true" TLSSkipVerify="true" \ +TLSSkipClientVerify="true"