Skip to content

Instantly share code, notes, and snippets.

@odra
Last active July 2, 2019 07:27
Show Gist options
  • Save odra/02dae83118f3f91e92b376ae9e474a47 to your computer and use it in GitHub Desktop.
Save odra/02dae83118f3f91e92b376ae9e474a47 to your computer and use it in GitHub Desktop.
integreatly commands
#!/bin/bash
for name in `oc get crd -oname | grep enmasse`; do oc delete $name; done

This needs to be done in case the installer is stuck at "template service broker" role for some reason.

  • Run the command oc get secret/templateservicebroker-client -n openshift-template-service-broker -o yaml and copy the value of service-ca.crt somewhere

  • Create a cluster service broker yaml file (replace SECRET_KEY_VALUE with the value retrieved from service-ca.crt):

apiVersion: servicecatalog.k8s.io/v1beta1
kind: ClusterServiceBroker
metadata:
  name: template-service-broker
spec:
  relistBehavior: Duration
  relistRequests: 0
  url: https://apiserver.openshift-template-service-broker.svc:443/brokers/template.openshift.io
  caBundle: SECRET_KEY_VALUE
  authInfo:
    bearer:
      secretRef:
        name: templateservicebroker-client
        namespace: openshift-template-service-broker
  • Run oc get clusterservicebroker to check the status of template-service-broker until it is ready (or check its status by adding -o yaml in case it has a different status other than ready) - an empty status means the broker is still being provisioned.
#!/bin/bash
oc get nodes -l 'node-role.kubernetes.io/master=true' -o jsonpath='{.items[0].metadata.name}'
#!/bin/bash
ansible-playbook \
-i inventories/hosts \
-e 'github_client_id=' \
-e 'github_client_secret=' \
playbooks/install.yml
#!/bin/bash
oc get serviceinstances,servicebinding --all-namespaces \
| sed 's/\.servicecatalog\.k8s\.io//g' \
| grep -v Ready \
| awk '{print $1,$2}' \
| while read ns res; do oc patch $(echo $res | sed 's/\// /g') -n $ns -p '{"metadata":{"finalizers": []}}' --type=merge; done
#!/bin/bash
#oneliner
for bname in `oc get build -l 'syndesis.io/type=integration' -o jsonpath='{.items[].metadata.name}' -n fuse`; do oc start-build $bname -n fuse; done
#readable script
builds=`oc get build -l 'syndesis.io/type=integration' -o jsonpath='{.items[].metadata.name}' -n fuse`
for build in $builds
do
oc start-build $build -n fuse
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment