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

Put the broker creation inside deploy template #410

Merged
merged 1 commit into from Aug 30, 2017

Conversation

djzager
Copy link
Member

@djzager djzager commented Aug 29, 2017

Update the broker template we use in this project (and in catasb) to
include the creation of the broker resource for the service catalog.
Also, update scripts that would attempt to create a broker that already
exists.

@djzager
Copy link
Member Author

djzager commented Aug 29, 2017

oc cluster up:

➜  ansible-service-broker git:(broker-in-template) oc cluster up --image=openshift/origin --version=v3.6.0 --service-catalog=true --routing-suffix=${ROUTING_SUFFIX} --public-hostname=${HOSTNAME}
Starting OpenShift using openshift/origin:v3.6.0 ...
OpenShift server started.

The server is accessible via web console at:
    https://172.17.0.1.nip.io:8443
...

Create the broker resources via template:

➜  ansible-service-broker git:(broker-in-template) oc new-project ansible-service-broker
Now using project "ansible-service-broker" on server "https://127.0.0.1:8443".

➜  ansible-service-broker git:(broker-in-template) oc process -f templates/deploy-ansible-service-broker.template.yaml -n ansible-service-broker \
-p DOCKERHUB_USER="changeme" \
-p DOCKERHUB_PASS="changeme" \
-p DOCKERHUB_ORG="ansibleplaybookbundle" \
-p ENABLE_BASIC_AUTH="false" | oc create -f -
service "asb" created
serviceaccount "asb" created
clusterrolebinding "asb" created
route "asb-1338" created
persistentvolumeclaim "etcd" created
deploymentconfig "asb" created
secret "asb-auth-secret" created
configmap "broker-config" created
broker "ansible-service-broker" created

Get the broker:

➜  ansible-service-broker git:(broker-in-template) oc get brokers ansible-service-broker -o yaml
apiVersion: servicecatalog.k8s.io/v1alpha1
kind: Broker
metadata:
  creationTimestamp: 2017-08-29T14:07:30Z
  finalizers:
  - kubernetes-incubator/service-catalog
  name: ansible-service-broker
  resourceVersion: "21"
  selfLink: /apis/servicecatalog.k8s.io/v1alpha1/brokersansible-service-broker
  uid: 651b9f17-8cc3-11e7-a7d5-0242ac110005
spec:
  authInfo:
    basicAuthSecret:
      name: asb-auth-secret
      namespace: ansible-service-broker
  url: https://asb-1338-ansible-service-broker.172.17.0.1.nip.io
status:
  conditions:
  - lastTransitionTime: 2017-08-29T14:07:48Z
    message: Successfully fetched catalog entries from broker.
    reason: FetchedCatalog
    status: "True"
    type: Ready

Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, I had a question so marking as request changes.

@@ -8,6 +8,8 @@ DOCKERHUB_ORG=$3

# can be overridden via my_local_dev_vars
PROJECT=${ASB_PROJECT}
ASB_SCHEME="https"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we need this? what's the case where this is http?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When rcm we use a different scheme http. I could actually remove this since it is the default in the template.

metadata:
name: ansible-service-broker
spec:
url: ${ASB_SCHEME}://asb-1338-ansible-service-broker.${ROUTING_SUFFIX}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why didn't we just make the entire url a variable? and default it to https://asb-1338-ansible-service-broker.172.17.0.1.nip.io? I must be missing some critical information.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it this way to match up with asb_scheme and openshift_routing_suffix from catasb.

@@ -198,7 +198,29 @@ objects:
- type: basic
enabled: ${ENABLE_BASIC_AUTH}

- apiVersion: servicecatalog.k8s.io/v1alpha1
kind: Broker
# kind: ServiceBroker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra comment

Update the broker template we use in this project (and in catasb) to
include the creation of the broker resource for the service catalog.
Also, update scripts that would attempt to create a broker that already
exists.
@shawn-hurley shawn-hurley merged commit 4e98b3b into openshift:master Aug 30, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants