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

Update scripts to use the broker apb #891

Merged
merged 4 commits into from Apr 24, 2018

Conversation

djzager
Copy link
Member

@djzager djzager commented Apr 12, 2018

Update scripts that deploy the broker to use the automation-broker-apb.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 12, 2018
@djzager djzager changed the title [wip] Update scripts to use the broker apb Update scripts to use the broker apb Apr 12, 2018
@djzager
Copy link
Member Author

djzager commented Apr 12, 2018

Testing for Kubernetes

$ minikube start
Starting local Kubernetes v1.10.0 cluster...

$ helm init
...
Happy Helming!

$ kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
clusterrolebinding "tiller-cluster-admin" created

$ helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com
"svc-cat" has been added to your repositories

$ helm install svc-cat/catalog --name service --namespace=kube-service-catalog
NAME:   service
LAST DEPLOYED: Thu Apr 12 15:41:24 2018
NAMESPACE: kube-service-catalog
STATUS: DEPLOYED
...

$ ./scripts/run_latest_k8s_build.sh
========================================================================
                       RUN_LATEST_K8s_BUILD
========================================================================

 This script expects a running kubernetes cluster and a service-catalog.

 Setup minikube: https://kubernetes.io/docs/getting-started-guides/minikube/
 Setup service-catalog: https://github.com/kubernetes-incubator/service-catalog/blob/master/docs/install.md#helm

========================================================================

Starting the Ansible Service Broker
namespace "ansible-service-broker" created
serviceaccount "automation-broker-apb" created
clusterrolebinding "automation-broker-apb" created
If you don't see a command prompt, try pressing enter.
...

$  svcat get classes
          NAME                     DESCRIPTION                           UUID
+-----------------------+--------------------------------+----------------------------------+
  dh-pyzip-demo-apb       Python Zip Demo APB              0e991006d21029e47abe71acc255e807
                          Implementation
  dh-eclipse-che-apb      Eclipse Che                      1882ffca5d72b1084e9107e3485f5066
...

Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

Requesting changes because I actually just have questions but thats not an option :)

Overall this is a big 👍 from me!


create-broker-resource
kubectl create ns $BROKER_NAMESPACE
kubectl create serviceaccount $APB_NAME --namespace $BROKER_NAMESPACE
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we delete this svcacct after this runs?

Also could this just run as the user running the script? do we want to do this extra work?

-p NAMESPACE=ansible-service-broker \
$VARS -f - | oc create -f -
# Use the automation-broker-apb to deploy the broker
oc create serviceaccount $APB_NAME --namespace $BROKER_NAMESPACE
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as below re: do we need the service account

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 actually was smart and delete that stuff in this script but forgot to add that to the k8s version.

Ref: https://github.com/openshift/ansible-service-broker/pull/891/files#diff-34011cced263e7ac1afc542ee01bf933R101

exit
fi
oc delete pod -n $BROKER_NAMESPACE $APB_NAME
oc delete clusterrolebinding $APB_NAME
oc delete serviceaccount $APB_NAME
Copy link
Contributor

Choose a reason for hiding this comment

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

I think your going to want to specify the namespace for this deletion as well.

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.

ACK, the regex is probably okay don't bother trying to fix it.


version=$(oc version | head -1)
client_version=$(echo $version | egrep -o 'v[0-9]+(\.[0-9]+)+' | tr -d v.)
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that the third number in the version can never be more than 9? i.e. v3.9.10-alpha.0+221863f-734 because that will fail the check we have for $client_version. It will consider 3.9.10 to be greater than 3.10.0 which is wrong.

$ version="oc v3.9.10-alpha.0+221863f-734"
$ echo $version | egrep -o 'v[0-9]+(\.[0-9]+)+' | tr -d v.
3910

Not a blocker but something to remember if it breaks in the future.

@rthallisey rthallisey merged commit f0e8701 into openshift:master Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants