×

OpenShift SDN CNI is deprecated as of OKD 4.14. As of OKD 4.15, the network plugin is not an option for new installations. In a subsequent future release, the OpenShift SDN network plugin is planned to be removed and no longer supported. Red Hat will provide bug fixes and support for this feature until it is removed, but this feature will no longer receive enhancements. As an alternative to OpenShift SDN CNI, you can use OVN Kubernetes CNI instead. For more information, see OpenShift SDN CNI removal.

When your cluster is configured to use the multitenant isolation mode for the OpenShift SDN network plugin, each project is isolated by default. Network traffic is not allowed between pods or services in different projects in multitenant isolation mode.

You can change the behavior of multitenant isolation for a project in two ways:

  • You can join one or more projects, allowing network traffic between pods and services in different projects.

  • You can disable network isolation for a project. It will be globally accessible, accepting network traffic from pods and services in all other projects. A globally accessible project can access pods and services in all other projects.

Prerequisites

  • You must have a cluster configured to use the OpenShift SDN network plugin in multitenant isolation mode.

Joining projects

You can join two or more projects to allow network traffic between pods and services in different projects.

Prerequisites
  • Install the OpenShift CLI (oc).

  • You must log in to the cluster with a user that has the cluster-admin role.

Procedure
  1. Use the following command to join projects to an existing project network:

    $ oc adm pod-network join-projects --to=<project1> <project2> <project3>

    Alternatively, instead of specifying specific project names, you can use the --selector=<project_selector> option to specify projects based upon an associated label.

  2. Optional: Run the following command to view the pod networks that you have joined together:

    $ oc get netnamespaces

    Projects in the same pod-network have the same network ID in the NETID column.

Isolating a project

You can isolate a project so that pods and services in other projects cannot access its pods and services.

Prerequisites
  • Install the OpenShift CLI (oc).

  • You must log in to the cluster with a user that has the cluster-admin role.

Procedure
  • To isolate the projects in the cluster, run the following command:

    $ oc adm pod-network isolate-projects <project1> <project2>

    Alternatively, instead of specifying specific project names, you can use the --selector=<project_selector> option to specify projects based upon an associated label.

Disabling network isolation for a project

You can disable network isolation for a project.

Prerequisites
  • Install the OpenShift CLI (oc).

  • You must log in to the cluster with a user that has the cluster-admin role.

Procedure
  • Run the following command for the project:

    $ oc adm pod-network make-projects-global <project1> <project2>

    Alternatively, instead of specifying specific project names, you can use the --selector=<project_selector> option to specify projects based upon an associated label.