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
# 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
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)
hacks/vsphere_roles.sh
is available to help automate the creation of vCenter roles with a vCenter administrator account.
Assign the following roles to the vCenter account being used to install OpenShift at various levels in vCenter listed below.
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
- Golden Image
unattend.xml
: example-unattend.xml - OCP MachineSet: win-worker-machineset.yml
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
- Basic Web App: example-win-web.yml
- Win Daemon Set: example-win-daemonset.yml
OpenShift Docs
- vCenter Account Priviledges
- OpenShift 4.10 - OVN Hybrid Networking
- OpenShift 4.10 - Windows MachineSet
Windows Machine Config Operator (WMCO)
Windows Images