-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I've been testing and developing an ansible operator locally, and I have control over the versions of python packages installed on my device. Locally, I ran into the issue described here and here. The suggested workaround is to downgrade the kubernetes + openshift pip packages. Locally, I downgraded to 0.11.2 of the openshift client as this is the min version in the installation guide.
I've now deployed the operator to OpenShift v4.7.12 and have run into the same issue which I'm having trouble working around. The package versions set in this file don't work for me and I'm not able to change them.
That said, I don't think that trying to change the package versions is a good idea; I assume using k8s module in an ansible operator is a really common use case, so must assume that the version of the packages in the operator-sdk image are correct and work for others and I'm missing some step to get around this issue.
The operator runs fine atop OpenShift with image quay.io/operator-framework/ansible-operator:v1.5.0
. I can see the version of the openshift python client is 0.10.3 in this image. The behaviour described above began in image ansible-operator:1.6.0 which includes openshift python client 0.12.0.
It might be trivial to fix, by setting K8S_AUTH_KUBECONFIG
but I'm not sure what this would be set to. If there's any docs on how the k8s auth works in the ansible operator I'd be interested.
What did you expect to see?
I expected the operator to behave as it does when running ansible-operator run local
on my device - admittedly using a version of the openshift python client which doesn't contain the issue described in the links above. I did not try operator-sdk up local
(assume this would have resulted in the same error).
What did you see instead? Under which circumstances?
I run into this error, all K8s module tasks fail:
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f21dbbdd670>: Failed to establish a new connection: [Errno 111] Connection refused'))
Environment
Operator type:
/language ansible
Kubernetes cluster type:
OpenShift 4.7.12
$ operator-sdk version
operator-sdk version: "v1.9.0", commit: "205e0a0c2df0715d133fbe2741db382c9c75a341", kubernetes version: "1.20.2", go version: "go1.16.5", GOOS: "darwin", GOARCH: "amd64"
ansible-operator image
quay.io/operator-framework/ansible-operator:v1.9.0
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0+df9c838", GitCommit:"df9c8387b2dc2308da01706ff89982c6b7ad9c48", GitTreeState:"clean", BuildDate:"2021-05-15T22:35:16Z", GoVersion:"go1.15.7", Compiler:"gc", Platform:"linux/amd64"}
Possible Solution
Downgrading packages in the operator-sdk base image.
Setting kube config location in ansible role.
Sticking to an older version of ansible-operator (1.5.0).