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

Dockerized apb can't create/read registries.json #142

Closed
aliok opened this issue Nov 21, 2018 · 3 comments
Closed

Dockerized apb can't create/read registries.json #142

aliok opened this issue Nov 21, 2018 · 3 comments

Comments

@aliok
Copy link

aliok commented Nov 21, 2018

Coming here from ansibleplaybookbundle/ansible-playbook-bundle#321

I am trying to make the apb tool working with OpenShift 3.11. I was told in ansibleplaybookbundle/ansible-playbook-bundle#321 that there is a new apb tool now and the old one won't work with the OKD 3.11.

Followed the instructions.

  1. Start up cluster and give permissions to developer user
oc cluster up
oc login -u system:admin
oc cluster add service-catalog
oc cluster add automation-service-broker
oc cluster add template-service-broker
oc whoami
oc login -u system:admin && oc adm policy add-cluster-role-to-user access-asb-role developer && oc adm policy add-cluster-role-to-user cluster-admin developer && oc login -u developer
  1. Create apb script based on the instructions here: https://github.com/automationbroker/apb/blob/master/docs/apb_cli.md#running-from-a-container

  2. Switch to nightly because stable and canary points to old apb. See Containerized apb doesn't work with OKD 3.11 ansibleplaybookbundle/ansible-playbook-bundle#321

  3. Execute apb version:

[aliok@localhost metrics-apb]$ apb version
Running APB image: docker.io/ansibleplaybookbundle/apb-tools:nightly
level=warning msg="Didn't find config file /.apb/registries.json, creating."
level=error msg="open /.apb/registries.json: no such file or directory"
  1. Execute any apb command, will see the same messages as above.

registries.json is not really created.
Created that file manually but result is the same.

Env

$ oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://127.0.0.1:8443
kubernetes v1.11.0+d4cacc0
$ docker images | grep apb
ansibleplaybookbundle/apb-tools                       nightly             30bae8f2e18b        5 days ago          365M
$ docker images | grep broker
openshift/origin-template-service-broker              v3.11               6a8e44174040        14 hours ago        328MB
automationbroker/automation-broker-apb                v3.11               180cc25d3de3        3 weeks ago         626MB
ansibleplaybookbundle/origin-ansible-service-broker   v3.11               9fbc4d964506        3 weeks ago         535MB
@dymurray
Copy link
Contributor

@aliok It looks to me like you are running into an issue that has been documented in bugzilla but never made it to the upstream docs: https://bugzilla.redhat.com/show_bug.cgi?id=1615786#c1.

Looks like you need to mkdir -p ~/.apb and then change your alias to run:

docker run -it --rm --privileged -v $PWD:/mnt -v $HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.apb:/.apb -u $UID docker.io/ansibleplaybookbundle/apb-tools:nightly

I apologize... I don't use the containerized version so I didn't notice these out of date docs. I will update these today, but for now I would do:

$ mkdir -p ~/.apb
$ alias apb=docker run -it --rm --privileged -v $PWD:/mnt -v $HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.apb:/.apb -u $UID docker.io/ansibleplaybookbundle/apb-tools:nightly

and verify that apb version works.

@aliok
Copy link
Author

aliok commented Nov 29, 2018

Thanks for the reply.
I haven't tried this yet but I will let you know once I try it.

@jmrodri
Copy link
Contributor

jmrodri commented Mar 25, 2020

@aliok thank you for submitting this issue. The apb tool has been deprecated for the new Operators model. Please consider using Operator SDK (https://github.com/operator-framework/operator-sdk/) and building an Operator instead of an APB.

@jmrodri jmrodri closed this as completed Mar 25, 2020
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

3 participants