Migrating from kube-system to cex-device-plugin namespace

This section describes how to move the CEX device plug-in from the kube-system namespace to its own namespace cex-device-plugin.

Migration details

You must log in as a user that belongs to a role with administrative privileges for the cluster. For example, system:admin or kube:admin.

The migration basically corresponds to a reinstallation of the CEX device plug-in and the corresponding CEX resource configuration in the new cex-device-plugin namespace.

Note: To prevent resource conflicts when two plug-ins try to manage the same device, you must first remove the plug-in from the kube-system namespace. This leads to a short interruption in service such that pods with containers that are requesting a CEX resource cannot be scheduled. Already running containers with allocated CEX resources will not be affected and continue to run.

To help the migration, download the deployment kustomize files from the CEX device plug-in github repository and change to the download directory. With these files you can install the CEX devce plug-in with a custom configuration in the new namespace cex-device-plugin.

The configuration map is the only part that has to be moved. Everything else can simply be deleted in the kube-system namespace and freshly installed in the cex-device-plugin namespace. The kustomize templates for installation can be used to directly install the CEX device plug-in with a custom configmap.

Migration sequence

Follow these steps for migration:

  1. Download the deployment Kustomize files from the CEX device plug-in github repository and change into the download directory.
  2. Copy the cex_resources.json file content that is contained in the configuration map in the kube-system namespace into deployments/configmap/cex_resources.json by running the following command:
    oc get cm -n kube-system cex-resources-config -o jsonpath="{.data['cex_resources\.json']}" > deployments/configmap/cex_resources.json
  3. Remove the old CEX device plug-in daemonset from the kube-system namespace by running the following command:
    oc delete daemonset cex-plugin-daemonset -n kube-system

    Now, no new pods with containers requesting CEX devices can be created anymore.

  4. Create the installation template by running the following command:
    oc create -k deployments/rhocp-create

    After successful installation, new pods with containers requesting CEX devices can be created and the CEX device plug-in should be fully functional again.

  5. Optionally, the cex-resources-config ConfigMap in the kube-system namespace can be cleaned up. It is no longer needed since the new copy in the cex-device-plugin namespace is used. To delete the old ConfigMap, run the following command:
    oc delete cm cex-resources-config -n kube-system