|
| 1 | +# NetworkFenceClass |
| 2 | + |
| 3 | +NetworkFence is a cluster-scoped custom resource that allows Kubernetes to invoke "GetFenceClients" operation on a storage provider. |
| 4 | + |
| 5 | +The user needs to specify the csi provisioner name, parameters and the secret required to perform GetFenceClients operation. |
| 6 | + |
| 7 | +## Fence Operation |
| 8 | + |
| 9 | +```yaml |
| 10 | +apiVersion: csiaddons.openshift.io/v1alpha1 |
| 11 | +kind: NetworkFenceClass |
| 12 | +metadata: |
| 13 | + name: network-fence-class |
| 14 | +spec: |
| 15 | + provisioner: driver.example.com |
| 16 | + parameters: |
| 17 | + key: value |
| 18 | + csiaddons.openshift.io/networkfence-secret-name: secret-name |
| 19 | + csiaddons.openshift.io/networkfence-secret-namespace: secret-namespace |
| 20 | +``` |
| 21 | +
|
| 22 | +- `provisioner`: specifies the name of storage provisioner. |
| 23 | +- `parameters`: specifies storage provider specific parameters. |
| 24 | + |
| 25 | +Resereved parameters: |
| 26 | + |
| 27 | +- `csiaddons.openshift.io/networkfence-secret-name`: specifies the name of the secret required for network fencing operation. |
| 28 | +- `csiaddons.openshift.io/networkfence-secret-namespace`: specifies the namespace in which the secret is located. |
| 29 | + |
| 30 | +Once the NetworkFenceClass is processed, the CSI Addons controller will call the GetFenceClients operation on the storage provider associated with the provisioner name that registered the `GET_CLIENTS_TO_FENCE` capability. The resulting data will then be stored in the CSIAddonsNode status. |
| 31 | + |
| 32 | +The NetworkFenceStatus object will contain the list of clients that need to be fenced. |
| 33 | + |
| 34 | +```yaml |
| 35 | +apiVersion: csiaddons.openshift.io/v1alpha1 |
| 36 | +kind: CSIAddonsNode |
| 37 | +metadata: |
| 38 | + annotations: |
| 39 | + csiaddons.openshift.io/networkfenceclass-names: '["network-fence-class"]' |
| 40 | + creationTimestamp: "2024-11-11T07:31:20Z" |
| 41 | + finalizers: |
| 42 | + - csiaddons.openshift.io/csiaddonsnode |
| 43 | + generation: 1 |
| 44 | + name: plugin |
| 45 | + namespace: default |
| 46 | + ... |
| 47 | +status: |
| 48 | + capabilities: |
| 49 | + - service.NODE_SERVICE |
| 50 | + - reclaim_space.ONLINE |
| 51 | + - encryption_key_rotation.ENCRYPTIONKEYROTATION |
| 52 | + - network_fence.GET_CLIENTS_TO_FENCE |
| 53 | + message: Successfully established connection with sidecar |
| 54 | + networkFenceClientStatus: |
| 55 | + - networkFenceClassName: network-fence-class |
| 56 | + clientDetails: |
| 57 | + - cidrs: |
| 58 | + - 10.244.0.1/32 |
| 59 | + id: a815fe8e-eabd-4e87-a6e8-78cebfb67d08 |
| 60 | + state: Connected |
| 61 | +``` |
0 commit comments