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

Use origin-ansible-service-broker docker image #371

Merged
merged 2 commits into from Aug 16, 2017

Conversation

djzager
Copy link
Member

@djzager djzager commented Aug 15, 2017

Make it so the broker template and project documentation refer to the origin-ansible-service-broker docker image.

It is annoying for the run_latest_build script to cat the broker k8s
object to a file and then use `oc create` when it could just pipe
directly.
A majority of the work to make the change from
ansible-service-broker to origin-ansible-service-broker is taken care of
through jenkins pipelines and dockerhub automated builds. Now that those
changes are in place, this updates the relevant documentation + the
broker template that we use to reference the correct image
(`origin-ansible-service-broker`).
@djzager
Copy link
Member Author

djzager commented Aug 15, 2017

Tests

Running make build-image

➜  ansible-service-broker git:(use-origin) ✗ make build-image
cp broker build/broker
docker build -f "/home/dzager/go/src/github.com/openshift/ansible-service-broker/build"/Dockerfile-src -t docker.io/ansibleplaybookbundle/origin-ansible-service-broker:latest "/home/dzager/go/src/github.com/openshift/ansible-service-broker/build"
Sending build context to Docker daemon  31.9 MB
Step 1/13 : FROM centos:7
 ---> 328edcd84f1b
...
Step 13/13 : ENTRYPOINT entrypoint.sh
 ---> Running in ed84c84df780
 ---> 31252431f8f4
Removing intermediate container ed84c84df780
Successfully built 31252431f8f4

Remember you need to push your image before calling make deploy
    docker push docker.io/ansibleplaybookbundle/origin-ansible-service-broker:latest

Running scripts/run_latest_build.sh manually

➜  ansible-service-broker git:(use-origin) ✗ PUBLIC_IP="$(ip addr show docker0 | grep -Po 'inet \K[\d.]+')"
➜  ansible-service-broker git:(use-origin) ✗ HOSTNAME=${PUBLIC_IP}.nip.io
➜  ansible-service-broker git:(use-origin) ✗ ROUTING_SUFFIX="${HOSTNAME}"
➜  ansible-service-broker git:(use-origin) ✗ oc cluster up --image=openshift/origin --version=v3.6.0-rc.0 --service-catalog=true --routing-suffix=${ROUTING_SUFFIX} --public-hostname=${HOSTNAME}

Starting OpenShift using openshift/origin:v3.6.0-rc.0 ...
OpenShift server started.

➜  ansible-service-broker git:(use-origin) ✗ oc login -u system:admin
Logged into "https://127.0.0.1:8443" as "system:admin" using existing credentials.

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

➜  ansible-service-broker git:(use-origin) ✗ DOCKERHUB_USER="changeme"
➜  ansible-service-broker git:(use-origin) ✗ DOCKERHUB_PASS="changeme"
➜  ansible-service-broker git:(use-origin) ✗ DOCKERHUB_ORG="ansibleplaybookbundle"
➜  ansible-service-broker git:(use-origin) ✗ ENABLE_BASIC_AUTH="false"
➜  ansible-service-broker git:(use-origin) ✗ oc process -f templates/deploy-ansible-service-broker.template.yaml \
    -n ansible-service-broker \
    -p DOCKERHUB_USER="$DOCKERHUB_USER" \
    -p DOCKERHUB_PASS="$DOCKERHUB_PASS" \
    -p DOCKERHUB_ORG="$DOCKERHUB_ORG" \
    -p ENABLE_BASIC_AUTH="$ENABLE_BASIC_AUTH" | 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

➜  ansible-service-broker git:(use-origin) ✗ oc get pods -n ansible-service-broker asb-1-tgrj3 -o yaml
apiVersion: v1
kind: Pod
metadata:
...
spec:
  containers:
  - env:
    - name: BROKER_CONFIG
      value: /etc/ansible-service-broker/config.yaml
    - name: INSECURE
      value: "false"
    image: ansibleplaybookbundle/origin-ansible-service-broker:latest
    imagePullPolicy: IfNotPresent
    name: asb
    ...

@jmontleon
Copy link
Contributor

jmontleon commented Aug 15, 2017

ACK


* [Docker Hub published APBs](https://hub.docker.com/u/ansibleplaybookbundle/)

Image [tags](https://hub.docker.com/r/ansibleplaybookbundle/ansible-service-broker/tags):
Image [tags](https://hub.docker.com/r/ansibleplaybookbundle/origin-ansible-service-broker/tags):
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to contributing changes

@@ -1,7 +1,7 @@
REGISTRY ?= docker.io
ORG ?= ansibleplaybookbundle
TAG ?= latest
BROKER_IMAGE ?= $(REGISTRY)/$(ORG)/ansible-service-broker
BROKER_IMAGE ?= $(REGISTRY)/$(ORG)/origin-ansible-service-broker
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we'll need to make this a variable in case we need to make this ose- one day.

@@ -6,7 +6,7 @@ The following are the configurable parameters that you can set for deploying the
Name | Default Value | Description
---|---|---
PROJECT | ansible-service-broker | Project Namespace
BROKER_IMAGE | ansibleplaybookbundle/ansible-service-broker:latest| Container Image to use for Ansible Service Broker in format of imagename:tag
BROKER_IMAGE | ansibleplaybookbundle/origin-ansible-service-broker:latest| Container Image to use for Ansible Service Broker in format of imagename:tag
Copy link
Contributor

Choose a reason for hiding this comment

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

good

@@ -88,7 +88,7 @@ fi

ASB_ROUTE=`oc get routes | grep ansible-service-broker | awk '{print $2}'`

cat <<EOF > ansible-service-broker.broker
cat <<EOF | oc create -f -
Copy link
Contributor

Choose a reason for hiding this comment

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

❗️ good optimization

@@ -201,7 +201,7 @@ parameters:
- description: Container Image to use for Ansible Service Broker in format of imagename:tag
displayname: Ansible Service Broker Image
name: BROKER_IMAGE
value: ansibleplaybookbundle/ansible-service-broker:latest
value: ansibleplaybookbundle/origin-ansible-service-broker:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

hopefully, this doesn't have to be swapped out for ose- later. I think we're ok for now.

@jmrodri jmrodri merged commit 4da8350 into openshift:master Aug 16, 2017
@jmrodri
Copy link
Contributor

jmrodri commented Aug 16, 2017

@djzager thanks for the test plan!

@djzager
Copy link
Member Author

djzager commented Aug 16, 2017

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

Successfully merging this pull request may close these issues.

None yet

3 participants