Skip to content

Instantly share code, notes, and snippets.

@trozet
Forked from christianh814/install-ovn.md
Created October 8, 2020 20:12
Show Gist options
  • Save trozet/c032f8f3fe36750ace6d4261055a3ac4 to your computer and use it in GitHub Desktop.
Save trozet/c032f8f3fe36750ace6d4261055a3ac4 to your computer and use it in GitHub Desktop.

Need 4.6

Use the 4.6 nightlies

wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/latest-4.6/openshift-client-linux.tar.gz
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/latest-4.6/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

$ cp manifests/cluster-network-02-config.yml manifests/cluster-network-03-config.yml

Modify the apiversion

Modify the apiVersion of this new config

$ sed -i 's/config.openshift.io\/v1/operator.openshift.io\/v1/g' manifests/cluster-network-03-config.yml

Add default network

In the manifests/cluster-network-03-config.yml file, add the defaultNetwork section. The entire file should look 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: {}
  networkType: OVNKubernetes
  serviceNetwork:
  - 172.30.0.0/16
  defaultNetwork:
    type: OVNKubernetes
    ovnKubernetesConfig:
      hybridOverlayConfig:
        hybridClusterNetwork:
        - cidr: 10.132.0.0/14
          hostPrefix: 23
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