Skip to main content

CSI topology on an existing cluster

The CSI (Container Storage Interface) topology feature allows Kubernetes to make intelligent decisions about where to place workloads based on the underlying storage topology. This ensures that data is stored and accessed in the most efficient manner possible, reducing latency and improving performance. Follow the instructions on this page to enable CSI topology on an existing Kubernetes cluster using FlashArray and FlashBlade Direct Access volumes.

Enable CSI topology on an existing cluster

  1. Edit the cluster's StorageCluster object to include the following:

    csi:
    enabled: true
    topology:
    enabled: true
  2. Delete the existing px-pure-secret:

    kubectl delete secret --namespace <stc-namespace> px-pure-secret
  3. Create a new px-pure-secret using the following command:

    kubectl create secret generic px-pure-secret --namespace <stc-namespace> --from-file=<pure.json_file_path>

    Include Labels that specify the topology for each FlashArray. The keys must match a set of specific strings, but you can define your own values. For example:

    {
    "FlashArrays": [
    {
    "MgmtEndPoint": "<managementEndpoint>",
    "APIToken": "<apiToken>",
    "Labels": {
    "topology.portworx.io/zone": "zone-0",
    "topology.portworx.io/region": "region-0"
    }
    }
    }
  4. Label your Kubernetes nodes with labels that correspond to the Labels from the previous step. For example:

    kubectl label node <nodeName> topology.portworx.io/zone=zone-0
    kubectl label node <nodeName> topology.portworx.io/region=region-0
  5. Restart on all nodes using the following command:

    kubectl label nodes --all px/service=restart
  6. Delete the Portworx CSI pods. Wait until all pods are restarted and running on all nodes.

  7. Validate that topology is enabled in a node by describing csinode with the following command:

    kubectl describe csinode <node-name>
    Name:               <node-name>
    ...
    Spec:
    Drivers:
    pxd.portworx.com:
    Node ID: <node-id>
    Topology Keys: [topology.portworx.io/region topology.portworx.io/zone]