Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'docker_* tasks' conflicts with minikube environment from chapter 2. #92

Open
gimballock opened this issue Mar 5, 2021 · 5 comments

Comments

@gimballock
Copy link

If using the same shell env from chapter 2 where we ran:

$ minikube docker-env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://127.0.0.1:55002"
export DOCKER_CERT_PATH="/Users/eprice/.minikube/certs"
export MINIKUBE_ACTIVE_DOCKERD="minikube"
# To point your shell to minikube's docker-daemon, run:
# eval $(minikube -p minikube docker-env)
$ eval $(minikube docker-env)

Then I get errors with 'docker_image' and 'docker_container' like this:

TASK [Ensure Docker registry image is present.] *************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Error connecting: Error while fetching server API version: HTTPSConnectionPool(host='127.0.0.1', port=55002): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10bf36970>: Failed to establish a new connection: [Errno 61] Connection refused'))"}

To get around this I have to either use a new shell or run the following:

$ minikube docker-env -u
unset DOCKER_TLS_VERIFY;
unset DOCKER_HOST;
unset DOCKER_CERT_PATH;
unset MINIKUBE_ACTIVE_DOCKERD;
$ eval $(minikube docker-env -u)

@typ-ex
Copy link

typ-ex commented Mar 8, 2021

Here's what I've found

#88

@gimballock
Copy link
Author

After downgrading kubernetes and openshift python packages and restarting minikube I still see the same issue.

$ pip3 list
Package             Version
------------------- ---------
-ubernetes          11.0.0
...
docker-py           1.10.6
docker-pycreds      0.4.0
...
kubernetes          11.0.0
...
openshift           0.11.2
...

$ minikube stop
$ minikube start
😄  minikube v1.17.1 on Darwin 11.2.1
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🔄  Restarting existing docker container for "minikube" ...
🐳  Preparing Kubernetes v1.20.2 on Docker 20.10.2 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass

❗  /usr/local/bin/kubectl is version 1.18.6, which may have incompatibilites with Kubernetes 1.20.2.
    ▪ Want kubectl v1.20.2? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

$ ansible-playbook -i inventory main.yml
...
TASK [Create and start the build container.]
...
"msg": "Error connecting: Error while fetching server API version: HTTPSConnectionPool(host='127.0.0.1', port=55002): Max retries exceeded with url: /version (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:1123)')))"

@typ-ex
Copy link

typ-ex commented Mar 10, 2021

Sorry, I should have read the error more. What version of python are you using?

@gimballock
Copy link
Author

Sorry for the delay, Python 3.9.2

@typ-ex
Copy link

typ-ex commented Mar 11, 2021

I think what's happening is that you have the incorrect python compatibility with docker, or at least that is a part of it

Given this ticket, which I'm surprised you didn't get this error

ansible/ansible#60748

Uninstall docker-py, and run pip3 install docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants