How to update / add a new pod IP range to an existing Openshift Cluster
search cancel

How to update / add a new pod IP range to an existing Openshift Cluster

book

Article ID: 368928

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

Updating the config map per NCP doc  to the [nsx_v3] section

container_ip_blocks = 10.10.0.0/16,10.11.0.0/16

The existing cluster was built with just 10.10.0.0/16

Restarting the operator doesn’t pass that info from the configmap in nsx-system-operator to the config map in nsx-system. The one in nsx-system stays with container_ip_blocks = 10.10.0.0/16

Environment

OpenShift 4.x

NCP 4.x

NSX 3.x 4.x

Cause

NCP does NOT rely on the container_ip_blocks from Operator ConfigMap. NCP Operator reads the CIDR from cluster network CRD.

Resolution

  1. Follow Opsenshift document to update the following section:

    apiVersion: config.openshift.io/v1
    kind: Network
    metadata:
    ...
    spec:
    clusterNetwork:
    - cidr: 10.10.0.0/16
    hostPrefix: 23
    - cidr: 10.11.0.0/16    <<<<<  additional IP block
    hostPrefix: 23        <<<<<    

     

  2.  You will see messages similar to the following after completed Step 1:

    message: 'Not applying unsafe configuration change: invalid configuration: [adding/removing clusterNetwork entries of the same type is not supported]. Use ''oc edit network.operator.openshift.io cluster'' to undo the change.'
    reason: InvalidOperatorConfig
    status: "True"
    type: Degraded


  3. Delete this config map and let the operator re-create it.

    oc -n openshift-network-operator delete cm/applied-cluster

Additional Information

Note that the NCP operator always reconciles the Network CRD, not only upon initial installation. The network CR can be updated after OC installation. The NCP Operator monitors the change at runtime. There is no need to restart the NCP Operator.