Skip to content

Instantly share code, notes, and snippets.

View dav1x's full-sized avatar

Davis Phillips dav1x

  • Red Hat
  • Austin, TX
View GitHub Profile
-> ./add-node.py --node_type=storage
Configured inventory values:
console_port: 8443
deployment_type: openshift-enterprise
openshift_vers: v3_5
vcenter_host: 10.19.114.25
vcenter_username: [email protected]
vcenter_password: 100Root-
vcenter_template_name: ocp-server-template-2.0.2
vcenter_folder: ocp35
---
- hosts: localhost
connection: local
gather_facts: no
become: no
vars_files:
- vars/main.yaml
roles:
# Group systems
- create-vm-crs-prod-ose
data = {}
data = '{ "clusters": [ { "nodes": [ '
for i in range(0, int(self.node_number)):
#determine node_number increment on the number of nodes
if self.node_type == 'app':
node_ip = int(self.app_nodes) + i
guest_name = self.node_type + '-' + str(node_ip)
if self.node_type == 'infra':
node_ip = int(self.infra_nodes) + i
-> cat ocp-on-vmware.ini
[vmware]
# console port and install type for OpenShift
console_port=8443
# choices are: openshift-enterprise or origin
deployment_type=openshift-enterprise
# OpenShift Version
openshift_vers: v3_5
[OSEv3:children]
masters
etcd
nodes
[OSEv3:vars]
deployment_type=openshift-enterprise
ansible_ssh_user=root
openshift_additional_repos=[{'id': 'ose-devel', 'name': 'ose-devel', 'baseurl': 'http://download.eng.bos.redhat.com/rcm-guest/puddles/RHAOS/AtomicOpenShift/3.5/latest/x86_64/os/', 'enabled': 1, 'gpgcheck': 0}]
oreg_url='registry.ops.openshift.com/openshift3/ose-${component}:${version}'
# Additional drivers for vmware and hyperv
echo 'add_drivers+="mptspi vmw_pvscsi "' > /etc/dracut.conf.d/vmware-fusion-drivers.conf
echo 'add_drivers+="hv_storvsc hv_netvsc "' > /etc/dracut.conf.d/hyperv-drivers.conf
# Rerun dracut for the installed kernel (not the running kernel):
KERNEL_VERSION=$(rpm -q kernel --qf '%{V}-%{R}.%{arch}\n')
dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION
# Embed the system open-vm-tools container.
atomic pull --storage ostree brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhel/open-vm-tools:latest
atomic images tag --storage ostree brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhel/open-vm-tools:latest registry.access.redhat.com/rhel7/open-vm-tools:latest
[subs=+quotes]
----
$ *cd ~/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/*
$ *./ocp-on-vmware.py --create_ocp_vars*
Configured OCP variables:
ldap_fqdn: e2e.bos.redhat.com
ldap_user: openshift
ldap_user_password: password
public_hosted_zone: vcenter.example.com
app_dns_prefix: apps
[[Add-Node]]
== Extending the Cluster
By default, the reference architecture playbooks are configured to deploy 3 master, 3 application, and 3 infrastructure nodes. This cluster size provides enough resources to get started with
deploying a few test applications or a Continuous Integration Workflow example. However, as the cluster begins to be utilized by more teams and projects, it will be become necessary to
provision more application or infrastructure nodes to support the expanding environment. To facilitate easily growing the cluster, the `add-node.py` python script
(similar to `ocp-on-vmware.py`) is provided in the `openshift-ansible-contrib` repository. It will allow for provisioning either an Application or Infrastructure node per run and
can be ran as many times as needed.
=== Before Adding a Node
Verify the quantity and type of the nodes in the cluster by using the `oc get nodes` command. The output below is an example of a complete OpenShift environment after the deployment of the reference archit
---
- hosts: localhost
vars_files:
- vars/main.yaml
roles:
- create-vm-prod-ose
- name: fulfill OSE3 prerequisites on production hosts roles
hosts: production_group
vars_files:
{
"ociVersion": "1.0.0",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": false,
"user": {},
"args": [