This commit is contained in:
Adolfo Delorenzo 2021-07-06 21:05:07 -06:00
parent f7106da0ab
commit 555c97600c
2 changed files with 10 additions and 7 deletions

View File

@ -47,14 +47,17 @@
#Get the admin JWT token
#http POST :9000/api/auth Username="portainer" Password="portainer1234"
#jwt=`http POST :9000/api/auth Username="portainer" Password="portainer1234" | jq '.jwt' | sed 's/^.//' | sed 's/.$//'`
jwt=`http POST :9000/api/auth Username="portainer" Password="portainer1234" | jq '.jwt' | sed 's/^.//' | sed 's/.$//'`
#Add local Docker endpoint
#http --form POST :9000/api/endpoints \
#"Authorization: Bearer $jwt" \
#Name="docker" EndpointCreationType=1
http --form POST :9000/api/endpoints \
"Authorization: Bearer $jwt" \
Name="docker" EndpointCreationType=1
#Get mapped 30778 port from control-plane
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:30778" EndpointCreationType=2 TLS="true" TLSSkipVerify="true" TLSSkipClientVerify="true"
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"

Binary file not shown.