Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vchintal committed Dec 19, 2019
1 parent 5b6c573 commit 01dc521
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 13 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# OCP4 on VMware vSphere UPI Automation

The goal of this repo is to make deploying and redeploying a new Openshift v4 cluster a snap. The document looks long but after you have used it till end once, you will appreciate how quickly VMs come up in vCenter for you to start working with.
The goal of this repo is to make deploying and redeploying a new Openshift v4 cluster a snap. The document looks long but after you have used it till the end once, you will appreciate how quickly VMs come up in vCenter for you to start working with.

Using the same repo and with minor tweaks, it can be applied to any version of Openshift higher than the current version of 4.2.

## Prerequisites

1. vSphere ESXi and vCenter 6.7 installed
2. A datacenter created with vSphere host added to it
2. A datacenter created with a vSphere host added to it
3. **VM and Template folder** created with the same name as the **Openshift cluster name** you would like to use, as described in the [documentation](https://docs.openshift.com/container-platform/4.2/installing/installing_vsphere/installing-vsphere.html#installation-vsphere-machines_installing-vsphere)
4. The OVF template deployed in the ***same folder*** from the OVA file [located here](https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.2/latest/rhcos-4.2.0-x86_64-vmware.ova) using instructions from **#6** step of the same documentation as in the previous step. Once deployed, on the template name, right-click and select **Edit Settings** and do the following:
* Under `Virtual Hardware` 🠮 `Network adapter 1` 🠮 Highlight and delete it by clicking on the x symbol on the right. ***This is an important step if you would like to use the mac addresses as defined in the file***
* Under the `VM Options` 🠮 `Advanced` 🠮 Latency Sensitivity; set it to **High**
* Under the `VM Options` 🠮 `Advanced` 🠮 `Configuration Parameters` 🠮 Edit Configuration; add the following param (name, value) respectively:
* Under `Virtual Hardware` 🠮 `Network adapter 1` 🠮 Highlight and delete it by clicking on the `x` symbol on the right. ***This is an important step if you would like to use the mac addresses as defined in the file***
* Under the `VM Options` 🠮 `Advanced` 🠮 `Latency Sensitivity`; set it to **High**
* Under the `VM Options` 🠮 `Advanced` 🠮 `Configuration Parameters` 🠮 `Edit Configuration`; add the following param (name, value) respectively:
1. `disk.EnableUUID`, TRUE
2. `guestinfo.ignition.config.data.encoding`, base64
3. `guestinfo.ignition.config.data`, blah
* Save the template
5. Ideally have [helper node](https://github.com/christianh814/ocp4-upi-helpernode) running in the same network to provide all the necessary services such as [DHCP/DNS/HAProxy as LB/FTP Server]
6. Ansible 2.8.5 installed on the machine where this repo is cloned
6. Ansible 2.8.5 installed on the machine where this repo is cloned
* For this specific version of Ansible you can run the command `sudo dnf -y install ansible-2.8.5`

## Automatic generation of ignition and other supporting files

### Prerequisites

1. Get the ***pull secret*** from [here](https://cloud.redhat.com/openshift/install/vsphere/user-provisioned)
2. Generate a ssh key pair as per [instructions](https://docs.openshift.com/container-platform/4.2/installing/installing_vsphere/installing-vsphere.html#ssh-agent-using_installing-vsphere). The private key will then be used to log into bootstrap/master and worker nodes
3. Get the vcenter details:
2. Generate a SSH key pair as per [instructions](https://docs.openshift.com/container-platform/4.2/installing/installing_vsphere/installing-vsphere.html#ssh-agent-using_installing-vsphere). The private key will then be used to log into bootstrap/master and worker nodes
3. Get the vCenter details:
1. IP Address
2. Username
3. Password
Expand Down Expand Up @@ -102,7 +103,7 @@ In vCenter all VMs (bootstrap, master0-2, worker0-2) generated in the designated
In vCenter click on the ESXi Host (IP address) 🠮 Click on VMs tab 🠮 Cntrl-select all of the 7 machines 🠮 Right-click and choose Power 🠮 Power On

If everything goes well you should be able to log into all of the machines (from the machine which has the private key of the ssh key pair that was generated) using the private key generated in prerequistes. On **bootstrap** node running the following command will help understand if the masters are (being) setup:
If everything goes well you should be able to log into all of the machines (from the machine which has the private key of the SSH key pair that was generated) using the private key generated in prerequistes. On **bootstrap** node running the following command will help understand if the masters are (being) setup:

```sh
journalctl -b -f -u bootkube.service
Expand Down
8 changes: 8 additions & 0 deletions extras/1-nfs-storage-class.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: nfs
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

15 changes: 15 additions & 0 deletions extras/2-nfs-pv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
storageClassName: nfs
nfs:
path: /export
server: 192.168.86.180

13 changes: 13 additions & 0 deletions extras/3-image-registry-storage-pvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: image-registry-storage
namespace: openshift-image-registry
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
storageClassName: nfs
volumeMode: Filesystem
32 changes: 32 additions & 0 deletions extras/openshift-logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
metadata:
name: instance
namespace: openshift-logging
spec:
managementState: Managed
logStore:
type: elasticsearch
elasticsearch:
nodeCount: 3
redundancyPolicy: SingleRedundancy
resources:
limits:
cpu:
memory: 8Gi
storage:
storageClassName: thin
size: 200G
visualization:
type: kibana
kibana:
replicas: 1
curation:
type: curator
curator:
schedule: 0 1 * * *
collection:
logs:
type: fluentd
fluentd: {}

4 changes: 2 additions & 2 deletions setup-vcenter-vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
masterContent : "{{ lookup('file', '{{ playbook_dir }}/install-dir/master.64') }}"
workerContent : "{{ lookup('file', '{{ playbook_dir }}/install-dir/worker.64') }}"
templateName : rhcos-4.2.0-x86_64-vmware
folder : "/dc/vm/ocp4"
datastore: "datastore1"
folder : "/{{ vcenter.datacenter }}/vm/{{ config.clusterName }}"
datastore: "{{ vcenter.datastore }}"
tasks:
- name: "Bootstrap base64"
debug:
Expand Down
4 changes: 2 additions & 2 deletions vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ vcenter:
password: Password123!
datacenter: dc
download:
oc_client: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux-4.2.0.tar.gz"
openshift_install: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-linux-4.2.0.tar.gz"
oc_client: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux-4.2.9.tar.gz"
openshift_install: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-linux-4.2.9.tar.gz"

0 comments on commit 01dc521

Please sign in to comment.