Skip to content

Instantly share code, notes, and snippets.

@eriknelson
Last active March 7, 2017 01:48
Show Gist options
  • Save eriknelson/38b2d85bcd9487ca60637470d375fa76 to your computer and use it in GitHub Desktop.
Save eriknelson/38b2d85bcd9487ca60637470d375fa76 to your computer and use it in GitHub Desktop.
[Prereq]
1) **DNS setup**
/etc/NetworkManager/dnsmasq.d/custom-example.com
address=/master.example.com/192.168.156.5
address=/.master.example.com/192.168.156.5
address=/node1.example.com/192.168.156.6
address=/.node1.example.com/192.168.156.6
address=/node2.example.com/192.168.156.7
address=/.node2.example.com/192.168.156.7
address=/apps.example.com/192.168.156.5
address=/.apps.example.com/192.168.156.5
Make sure dnsmasq is used by network manager; in /etc/NetworkManager/NetworkManager.conf
```
[main]
dns=dnsmasq
```
sudo systemctl restart NetworkManager
2) Projects:
https://github.com/eriknelson/centos-origin-cluster # Need to checkout branch "updates" **
https://github.com/fusor/ansible-service-broker # in same dir as centos-origin-cluster
https://github.com/fusor/ansibleapp # in same dir as centos-origin-cluster
--
cd centos-origin-cluster && vagrant up
# We don't have iptables hook in place right now, need host to forward traffic
sudo iptables -I FORWARD -d 192.168.156.0/24 -j ACCEPT
# cluster-user == admin:admin (openshift user)
# dockerhub required for querying for ansibleapps in dockerhub
# will prompt for passwords, or will accept them as args
# NOTE: Only the IP will work here, not the domain name.
./asbcli up 192.168.156.5:8443 --cluster-user=admin --dockerhub-user=eriknelson
# Need to wait until broker is up and running before connect.
# can confirm by checking to make sure asb-1-$ID pod is running
# in `ansible-service-broker` project
# Expecting to make this more dynamic and autoconnect to the broker soon
# Route can be retrieved by logging into the cluster and running:
# `oc get routes --namespace=ansible-service-broker`
./asbcli connect asb-1338-ansible-service-broker.apps.example.com
* Select [b] to bootstrap broker so it discovers available ansibleapps
* Select [p] to provision ansibleapp/miq-ansibleapp
-> Accept defaults
watch oc get project # Wait for miq-ansibleapp project to come up
oc project miq-ansibleapp
watch oc get pods # Wait for all 3 pods to transition to running
# Once running, miq will need to perform startup procedures, executing migrations
# etc. can attach to the pod and watch for httpd processes to come up
# App can take 5-10 minutes to become fully available
oc exec -it miq-app-1-$ID /bin/bash
watch ps aux # Inside pod, watch for httpd procs
# Once httpd is available, can hit the route and should land on login page
# ! IMPORTANT: Navigate to https://
# Most likely at -> https://miq-app-miq-ansibleapp.apps.example.com
# Credentials admin:smartvm
oc get routes # should list route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment