Skip to content

codekow/demo-ocp-windows

Repository files navigation

OpenShift 4.10+ (Windows) Install

This repository helps automate the install of OpenShift 4.10+ with Kubernetes OVN for use with Windows containers

Note: Running these scripts on a Linux workstation with internet access is assumed

QuickStart

# pull this repo
git clone https://github.com/codekow/demo-ocp-windows.git
cd demo-ocp-windows

# setup vmware roles (optional)
. hacks/vsphere_roles.sh
vsphere_create_roles

# easy install button :)
hacks/install_ocp_win.sh

# run openshift-install
openshift-install create cluster --dir generated/ocp

VMware Notes

Add vSphere folder path to install-config.yml at the following level in the yaml

platform:
  vsphere:
    
    # example folder path
    # folder: /${{ datacenter }}/vm/${{ folder path}}
    folder: /Central/vm/Sandbox/ocp4.tigerlab.io

    vcenter: 10.1.2.3
    ...

Assumption: Two vCenter Accounts

  • Admin Account
  • Installer Account (w/ roles assigned)

Admin Account

hacks/vsphere_roles.sh is available to help automate the creation of vCenter roles with a vCenter administrator account.

Installer Account

Assign the following roles to the vCenter account being used to install OpenShift at various levels in vCenter listed below.

Precreated virtual machine folder in vSphere vCenter

Role Name Propagate Entity
openshift-vcenter-level False vCenter
ReadOnly False Datacenter
openshift-cluster-level True Cluster
openshift-datastore-level False Datastore
ReadOnly False Switch
openshift-portgroup-level False Port Group
ReadOnly True Virtual Machine folder (Top Level)
openshift-folder-level True Virtual Machine folder

In a cascading (nested) folder organization you will need "Read-only" permissions with "Propagate to children" from the top folder level.

Example Service Account: OCPInstaller

Folder Tree Example

Golden Image / Machine Set - Windows

kind: MachineSet
metadata:
  name: ocp4-win-worker
  namespace: openshift-machine-api
  labels:
    machine.openshift.io/cluster-api-cluster: ocp4-win
spec:
  replicas: 0
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: ocp4-win
      machine.openshift.io/cluster-api-machineset: ocp4-win-worker
  template:
    metadata:
      labels:
        machine.openshift.io/cluster-api-cluster: ocp4-win
        machine.openshift.io/cluster-api-machine-role: worker
        machine.openshift.io/cluster-api-machine-type: worker
        machine.openshift.io/cluster-api-machineset: ocp4-win-worker
        machine.openshift.io/os-id: Windows
    spec:
      metadata:
        labels:
          node-role.kubernetes.io/worker: ''
      providerSpec:
        value:
          userDataSecret:
            name: windows-user-data
          template: win2022

Sample Apps - Windows

Links

OpenShift Docs

Windows Machine Config Operator (WMCO)

Windows Images