ansibleplaybookbundle / ansible-playbook-bundle

THIS REPO IS MIGRATING: https://github.com/automationbroker/apb
GNU General Public License v2.0
140 stars 70 forks source link

apb does not appear in "apb list" after "apb push -o" #180

Closed rwsu closed 6 years ago

rwsu commented 6 years ago

My environment was setup using this guide: https://github.com/openshift/ansible-service-broker#getting-started-with-the-ansible-service-broker

[root@localhost my-test-apb]# oc status
oc v3.7.0+7ed6862
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://172.17.0.1.nip.io:8443
openshift v3.7.0+7ed6862
kubernetes v1.7.6+a08f5eeb62

I went through the steps under "Using apb init" in https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/blob/master/docs/getting_started.md. But "apb list" doesn't show dh-my-test-apb. Only the default apbs.

[root@localhost my-test-apb]# apb push -o
version: 1.0
name: my-test-apb
description: This is a sample application generated by apb init
bindable: False
async: optional
metadata:
  displayName: my-test
plans:
  - name: default
    description: This default plan deploys my-test-apb
    free: True
    metadata: {}
    parameters: []
Found registry IP at: 172.30.1.1:5000
Building image with the tag: 172.30.1.1:5000/openshift/my-test-apb
Successfully pushed image: 172.30.1.1:5000/openshift/my-test-apb
https://asb-1338-ansible-service-broker.172.17.0.1.nip.io/ansible-service-broker
Successfully bootstrapped Ansible Service Broker
Successfully relisted the Service Catalog
[root@localhost my-test-apb]# apb list
ID                                NAME                   DESCRIPTION                                                                                                                                                                
ca91b61da8476984f18fc13883ae2fdb  dh-etherpad-apb        Note taking web application                                                                                                                                                
ab24ffd54da0aefdea5277e0edce8425  dh-hastebin-apb        This is a sample application generated by apb init                                                                                                                         
9f7da06f179b895a8ee5f9a3ce4af7ef  dh-hello-world-apb     deploys hello-world web application                                                                                                                                        
b43a4272a6efcaaa3e0b9616324f1099  dh-hello-world-db-apb  A sample APB which deploys Hello World Database                                                                                                                            
f4509733ca0636df3d69b6af53260160  dh-jenkins-apb         Jenkins service with optional persistent storage and S2I build                                                                                                             
6df7afbd132c094704b4a8bfd44378c0  dh-manageiq-apb        ManageIQ                                                                                                                                                                   
67042296c7c95e84142f21f58da2ebfe  dh-mariadb-apb         Mariadb apb implementation                                                                                                                                                 
f6c4486b7fb0cdac4b58e193607f7011  dh-mediawiki-apb       Mediawiki apb implementation                                                                                                                                               
ddd528762894b277001df310a126d5ad  dh-mysql-apb           Software Collections MySQL APB                                                                                                                                             
135bd0df0401e2fdd52fd136935014fb  dh-nginx-apb           An open source reverse proxy web server                                                                                                                                    
1dda1477cace09730bd8ed7a6505607e  dh-postgresql-apb      SCL PostgreSQL apb implementation                                                                                                                                          
0e991006d21029e47abe71acc255e807  dh-pyzip-demo-apb      Python Zip Demo APB Implementation                                                                                                                                         
693cb128e68365830c913631300deac0  dh-pyzip-demo-db-apb   Python Zip Demo Database APB Implementation                                                                                                                                
c65fbd4e701cb71d74fd2cc35e14432b  dh-rds-postgres-apb    Managed relational database service with a choice of six popular database engines.  Set up, operate, and scale a relational database in the cloud with just a few clicks.  
ba9c2d4db404ce97111bea80225de968  dh-rocketchat-apb      This APB deploys RocketChat backed by MongoDB                                                                                                                              
eebf92c7670f30007a4b8db3a8166d5c  dh-thelounge-apb       This is a sample application generated by apb init                                                                                                                         
a946a139a9308a59bf642ac52b4ba317  dh-wordpress-ha-apb    High Availability Wordpress APB    
rthallisey commented 6 years ago

I'm wondering if either the broker or the catalog did not properly process the request. Can you post the result of kubectl get clusterserviceclass -o yaml | grep my-test-apb

matzew commented 6 years ago

@rthallisey I have the same probem,

and the command returns nothing

rwsu commented 6 years ago

Same here, the command returns nothing.

dymurray commented 6 years ago

Can you please paste your broker config? oc get configmap broker-config ansible-service-broker -o yaml -n ansible-service-broker

I think you are missing the configuration for the local_openshift registry config.

rthallisey commented 6 years ago

Back from the holiday break :). Are you still seeing this @rwsu or @matzew ?

rwsu commented 6 years ago

I'm seeing a different problem during push:

Found registry IP at: 172.30.1.1:5000 Building image with the tag: 172.30.1.1:5000/openshift/tripleo-k8s-mariadb Successfully pushed image: 172.30.1.1:5000/openshift/tripleo-k8s-mariadb https://asb-1338-ansible-service-broker.172.17.0.1.nip.io/ansible-service-broker Error: Attempt to bootstrap Broker returned status: 503 Unable to bootstrap Ansible Service Broker.

pb82 commented 6 years ago

I'm having the same problem. apb build and apb push -o seem to work fine but the apb is not listed afterwards and also not visible in the service catalog. @matzew @rwsu have you been able to find a fix?

@dymurray running oc get configmap broker-config ansible-service-broker -o yaml -n ansible-service-broker show a config map for broker-config, but returns Error from server (NotFound): configmaps "ansible-service-broker" not found for ansible-service-broker. So it looks like i'm missing some configuration?

broker-config did not have a registry entry for local_openshift, so i added one (https://github.com/openshift/ansible-service-broker/blob/master/docs/config.md#local-openshift-registry) but i still can't see the apb.

Any ideas?

pb82 commented 6 years ago

@rwsu regarding the 503 error, can you try to check the asb pod in the ansible-service-broker project in Openshift? Your user should be able to open it from the web console. Is the pod running or are there any errors in it's log?

dymurray commented 6 years ago

@pb82 It sounds like you might need to redeploy the ASB pod after editing the configmap. Your error above is my fault, the command should just read oc get configmap broker-config -n ansible-service-broker -o yaml. It was looking for a configmap named ansible-service-broker which doesn't exist. Does redeploying the ASB pod help? That will attempt to bootstrap the images in the openshift namespace which apb push -o prepared for us.

pb82 commented 6 years ago

@dymurray I didn't try redeploying yet but i ran apb bootstrap. That didn't help. However after adding the local registry config i now see an error in the logs of the ansible-service-broker when i push:

 [ERROR] - unable to retrieve image names for registry localregistry - User "system:serviceaccount:ansible-service-broker:asb" cannot list images.image.openshift.io at the cluster scope: User "system:serviceaccount:ansible-service-broker:asb" cannot list all images.image.openshift.io in the cluster (get images)

For now i'm just pushing my apbs to dockerhub, that works fine. But it would be nice to use the local registry.

dymurray commented 6 years ago

@pb82 You definitely need to redepoy the ASB pod or else it won't pick up on the changes to broker-config. You also need to be logged in as a user who has cluster-admin access. Right now you are logged in as the asb service account (probably because you just ran the script to deploy the broker). First, log in as an admin user (not system:admin because it doesn't have a token) and then redeploy the broker pod: oc deploy --latest asb (in broker namespace). Then do apb push -o and you should see the image there.

pb82 commented 6 years ago

@dymurray Ok, will give it a try later today and add the results here

rthallisey commented 6 years ago

@rwsu @pb82 let us know if you're still hitting this, but I think the the master branch has the fix.

rwsu commented 6 years ago

@rthallisey, does https://raw.githubusercontent.com/openshift/ansible-service-broker/master/scripts/run_latest_build.sh pickup the latest change on master?

I still don't see the apb listed. "apb push -o" returns

Found registry IP at: 172.30.1.1:5000 Building image with the tag: 172.30.1.1:5000/openshift/tripleo-k8s-mariadb Successfully pushed image: 172.30.1.1:5000/openshift/tripleo-k8s-mariadb Contacting the ansible-service-broker at: https://asb-1338-ansible-service-broker.172.17.0.1.nip.io/ansible-service-broker/ansible-service-broker/v2/bootstrap Error: Attempt to bootstrap Broker returned status: 404 Unable to bootstrap Ansible Service Broker.

rthallisey commented 6 years ago

@rwsu yes, that runs the latest broker.

Try and update your apb tool to master. There were a few changes recently and master should fix the .../ansible-service-broker/ansible-service-broker/... double name. Also -o isn't needed anymore in master. The default with no param is now to push to the openshift registry.

Let me know if that fixes it.

rwsu commented 6 years ago

@rthallisey, I see a different error now. Please see https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/issues/212. Thanks.

rthallisey commented 6 years ago

@rwsu ok I'll have a look