Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active August 30, 2017 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbraad/04fdad7277463d2544a8f2fa9bebee72 to your computer and use it in GitHub Desktop.
Save gbraad/04fdad7277463d2544a8f2fa9bebee72 to your computer and use it in GitHub Desktop.
Deploy an OpenShift cluster
Title Date Category Tags
Deploy an OpenShift cluster
2016-11-21
Containers
containers, openshift, deployment, devops, cluster, ansible

In previous articles I have described how to setup a test cluster for OpenShift and how the deployment of an example application works using source-to-image. In this article, I am going to setup OpenShift using the Ansible playbooks.

sudo yum install -y epel-release
sudo yum install -y pyOpenSSL ansible git
git clone https://github.com/openshift/openshift-ansible.git
cd openshift-ansible
cp ansible.cfg.example ansible.cfg
vi inventory/byo/hosts
[OSEv3:children]
masters
nodes

[OSEv3:vars]
ansible_ssh_user=centos
ansible_become=true
deployment_type=origin
deployment_subtype=registry
openshift_release=v1.3.1
openshift_install_examples=true
openshift_public_ip=89.42.141.147
#containerized=true
osm_default_subdomain=origin.spotsnel.net
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
openshift_master_htpasswd_users={'demo': '$apr1$.MaA77kd$Rlnn6RXq9kCjnEfh5I3w/.'}

openshift_hosted_router_selector='region=infra'
openshift_hosted_registry_selector='region=infra'
openshift_master_default_subdomain=origin.spotsnel.net
osm_default_node_selector='region=primary'

[masters]
master.spotsnel.net openshift_public_hostname="master.spotsnel.net"

[nodes]
master.spotsnel.net openshift_schedulable=True
10.5.0.50 openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
10.5.0.53 openshift_node_labels="{'region': 'primary', 'zone': 'default'}"
10.5.0.52 openshift_node_labels="{'region': 'primary', 'zone': 'default'}"
10.5.0.51 openshift_node_labels="{'region': 'primary', 'zone': 'default'}"
ansible -i hosts nodes -u centos -s -m shell -a \
        "yum install -y NetworkManager && systemctl enable NetworkManager && systemctl disable network && reboot"
ansible-playbook -i hosts ~/openshift-ansible/playbooks/byo/config.yml
vi /etc/origin/master/master-config.yaml
htpasswd /etc/origin/htpasswd admin
oc get nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment