Skip to content

Instantly share code, notes, and snippets.

@christianh814
Last active February 18, 2021 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save christianh814/cede6aa0d2641240465fe0e49a1a9a7c to your computer and use it in GitHub Desktop.
Save christianh814/cede6aa0d2641240465fe0e49a1a9a7c to your computer and use it in GitHub Desktop.

Need 4.6+

Use 4.6+

wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-linux.tar.gz

Create Install config

Create install-config.yaml file as you would normally.

$ mkdir ocp4
$ cd ocp4/
$ openshift-install create install-config

Modify install-config

Modify the install-config.yaml file to use OVN

$ sed -i 's/OpenShiftSDN/OVNKubernetes/g' install-config.yaml

Generate manifest

Generate the install manifests as you would normally

$ openshift-install create manifests

Copy network config

Copy the existing network config file into a new file

$  touch manifests/cluster-network-03-config.yml

Checking Network Configs

There should be 3 network configs now.

$ ls -1 manifests/cluster-network-*
cluster-network-01-crd.yml
cluster-network-02-config.yml
cluster-network-03-config.yml

Add default network

Edit the manifests/cluster-network-03-config.yml file to look something like this

apiVersion: operator.openshift.io/v1
kind: Network
metadata:
  creationTimestamp: null
  name: cluster
spec: 
  clusterNetwork: 
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  externalIP:
    policy: {}
  serviceNetwork:
  - 172.30.0.0/16
  defaultNetwork:
    type: OVNKubernetes 
    ovnKubernetesConfig:
      hybridOverlayConfig:
        hybridClusterNetwork: 
        - cidr: 10.132.0.0/14
          hostPrefix: 23
        hybridOverlayVXLANPort: 9898 
status: {}

Install cluster

Now you can install the cluster as normal

$ openshift-install create cluster

Verify

Once cluster is up, verify that it's using OVN with your defaultNetwork settings

$ oc get network.operator cluster -o yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment