This commit is contained in:
Adolfo Delorenzo 2021-07-06 22:10:35 -06:00
parent 0b63834065
commit a6aaba159b
1 changed files with 6 additions and 2 deletions

View File

@ -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"