geerlingguy / ansible-for-kubernetes

Ansible and Kubernetes examples from Ansible for Kubernetes Book
https://www.ansibleforkubernetes.com
MIT License
684 stars 313 forks source link

`minikube service` prevents Ansible playbook from showing URL and finishing #105

Open Xaeco opened 2 years ago

Xaeco commented 2 years ago

Page 53 in

Chapter 2 - Automation brings DevOps bliss

Running the playbook

$ ansible-playbook -i inventory main.yml

locks up at this step:

TASK [Expose Hello Go on the host via Minikube] 

when running it outside of Ansible it shows its intentionally holding the process there until you are done with it.

$ minikube service hello-go --url=true --interval=1
šŸƒ  Starting tunnel for service hello-go.
|-----------|----------|-------------|------------------------|
| NAMESPACE |   NAME   | TARGET PORT |          URL           |
|-----------|----------|-------------|------------------------|
| default   | hello-go |             | http://127.0.0.1:46029 |
|-----------|----------|-------------|------------------------|
http://127.0.0.1:46029
ā—  Because you are using a Docker driver on linux, the terminal needs to be open to run it.
^Cāœ‹  Stopping tunnel for service hello-go.
geerlingguy commented 2 years ago

I believe the behavior changed since I originally wrote that bit, so I'll need to update this.

Xaeco commented 2 years ago

I was tempted to find a solution but my experience with minikube is about 24hrs and I want to continue the book before betting too sidetracked šŸ˜Š

geerlingguy commented 2 years ago

Heh, well I appreciate you leaving notes here, so those who bump into the same issues have a place to find an answer until I get the book updated!

lucas-homer commented 1 year ago

Working through the book now and it works if I remove the --url=true flag, though it pops open the browser for me and still doesn't actually log out the url. With the url flag it was basically hanging on that step and not actually exposing the service on the host. Minor thing for the most part. Thanks for the awesome resource @geerlingguy !