Skip to content

Instantly share code, notes, and snippets.

View jwmatthews's full-sized avatar

John Matthews jwmatthews

View GitHub Profile
$ oc exec asb-4137035260-55tl4 -it /bin/bash
bash-4.2$ cat /etc/ansible-service-broker/config.yaml
registry:
name: dockerhub
url: docker.io
user: REMOVED
pass: REMOVED
org: ansibleplaybookbundle
dao:
etcd_host: etcd
@jwmatthews
jwmatthews / Debugging a Failed APB Provision - 3.6.0 MediaWiki & PostgreSQL
Last active July 14, 2017 23:41
Collection of logs/snippets to show how to debug a failed APB provision in OCP 3.6.0 with Ansible Service Broker
# oc get projects
NAME DISPLAY NAME STATUS
default Active
demo Active
kube-public Active
kube-service-catalog Active
kube-system Active
logging Active
management-infra Active
openshift Active
@jwmatthews
jwmatthews / gist:93b7357fbc202ecaf8f9e37ca19efcf8
Created July 14, 2017 23:50
Example describing the pod & configmap of a running Ansible Service Broker
# oc get pods --namespace=openshift-ansible-service-broker
NAME READY STATUS RESTARTS AGE
asb-3295515155-s26dk 1/1 Running 0 6h
etcd-1487946270-gcm1v 1/1 Running 0 6h
# oc export pod asb-3295515155-s26dk --namespace=openshift-ansible-service-broker
apiVersion: v1
kind: Pod
metadata:
annotations:
==> default:
==> default: TASK [openshift_excluder : Check for docker-excluder] **************************
==> default: ok: [192.168.120.4.nip.io]
==> default:
==> default: TASK [openshift_excluder : Enable docker excluder] *****************************
==> default: changed: [192.168.120.4.nip.io]
==> default:
==> default: TASK [openshift_excluder : Check for openshift excluder] ***********************
==> default: ok: [192.168.120.4.nip.io]
==> default:
jmatthews@Johns-MacBook-Pro-2:/git/fusor/catasb/local/mac (master)
$ oc get pods
NAME READY STATUS RESTARTS AGE
asb-3316811801-vsmfr 0/1 CrashLoopBackOff 5 4m
etcd-2338997634-0wb5t 1/1 Running 0 4m
jmatthews@Johns-MacBook-Pro-2:/git/fusor/catasb/local/mac (master)
$ oc logs asb-3316811801-vsmfr
Using config file mounted to /etc/ansible-service-broker/config.yaml
============================================================
$ oc logs apiserver-644637603-r7pfk
Error from server (BadRequest): a container name must be specified for pod apiserver-644637603-r7pfk, choose one of: [apiserver etcd]
jmatthews@beast origin (master) $ oc logs apiserver-644637603-r7pfk -c apiserver
I0720 18:51:44.510065 1 server.go:95] using etcd for storage
I0720 18:51:44.520663 1 run_server.go:99] Preparing to run API server
I0720 18:51:44.551875 1 interface.go:248] Default route transits interface "eth0"
I0720 18:51:44.553493 1 interface.go:93] Interface eth0 is up
I0720 18:51:44.553563 1 interface.go:138] Interface "eth0" has 2 addresses :[172.17.0.4/16 fe80::42:acff:fe11:4/64].
I0720 18:51:44.553599 1 interface.go:105] Checking addr 172.17.0.4/16.
I0720 18:51:44.553608 1 interface.go:114] IP found 172.17.0.4
@jwmatthews
jwmatthews / launch_asb.sh
Last active August 23, 2017 15:42
Example: oc cluster up with Service Catalog and Ansible Service Broker
####
# We deploy oc cluster up with an explicit hostname and routing suffix so that pods can access routes internally.
# For example, we need to register the ansible service broker route to the service catalog when we create the broker resource.
# The service catallog needs to be able to communicate to the ansible service broker.
# When we use the default "127.0.0.1.nip.io" route suffix, requests from inside the cluster fail with an error like:
#
# From Service Catalog: controller manager
# controller.go:196] Error syncing Broker ansible-service-broker: Get https://asb-1338-ansible-service-broker.127.0.0.1.nip.io/v2/catalog: dial tcp 127.0.0.1:443: getsockopt: connection refused
#
# To resolve this, we explicitly set the --public-hostname and --routing-suffix
@jwmatthews
jwmatthews / run_latest_build_wait_for_pvs.sh
Created July 26, 2017 19:02
Updated to wait for PVs to finish creating from oc cluster up, was seeing if this helped to avoid an intermittent issue.
#!/bin/bash
###
# Minimal example for deploying latest built 'Ansible Service Broker' on oc cluster up
###
###
# Cleanup persistent volume data if it exists from prior runs
# Avoids intermittent issue we've seen of:
# $ oc logs etcd-2338997634-ljppv --namespace=ansible-service-broker
@jwmatthews
jwmatthews / gist:9c2c9f4221482d57245361b6b466c2a2
Last active September 14, 2017 17:11
Debugging RHTE environment 9/14/2017
sudo yum groupinstall -y "Development Tools"
sudo yum install -y python-devel
sudo easy_install pip
sudo pip install ansible
git clone https://github.com/fusor/catasb.git
modify catasb/config/linux_env_vars
$ cat ../../config/linux_env_vars
metadata_endpoint="http://169.254.169.254/latest/meta-data"
export PUBLIC_IP="$( curl -m 20 -s "${metadata_endpoint}/public-ipv4" )"
@jwmatthews
jwmatthews / Broker_ServiceCatalogLogs
Created October 3, 2017 20:02
10/3/2017 Debugging Failed Binding
From WebUI
The binding could not be created.
Error creating ServiceInstanceCredential "dh-ansibleplaybookbundle-rhscl-postgresql-apb-lates-k5rrr-ml321/jwm2" for ServiceInstance "jwm2/dh-ansibleplaybookbundle-rhscl-postgresql-apb-lates-k5rrr" of ServiceClass "dh-ansibleplaybookbundle-rhscl-postgresql-apb-lates" at ServiceBroker "ansible-service-broker", Status: 409; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>