22
33NetworkFence is a cluster-scoped custom resource that allows Kubernetes to invoke "Network fence" operation on a storage provider.
44
5- The user needs to specify the list of CIDR blocks on which network fencing operation will be performed; alongside the csi driver name.
5+ The user needs to specify the list of CIDR blocks on which network fencing operation will be performed along with either of
6+ ` networkFenceClassName ` or the csi driver name. When a ` networkFenceClassName ` is specified, the secret name, namespace
7+ and parameters are read from the ` NetworkFenceClass ` .
8+
9+ When both ` networkFenceClassName ` and ` driver ` are specified ` networkFenceClassName ` has the higher precedence.
10+
11+ > ** Note:** Specifying ` driver ` , ` secret ` and ` parameters ` inside ` NetworkFence ` is deprecated, users are encouraged
12+ > to use ` networkFenceClassName ` along with a ` NetworkFenceClass ` instead.
13+
614The creation of NetworkFence CR will add a network fence, and its deletion will undo the operation.
715
816## Fence Operation
@@ -13,10 +21,14 @@ kind: NetworkFence
1321metadata :
1422 name : network-fence-sample
1523spec :
16- driver : example.driver
24+ networkFenceClassName : network-fence-class
1725 cidrs :
1826 - 10.90.89.66/32
1927 - 11.67.12.42/24
28+ # The fields driver, secret and parameters are deprecated.
29+ # It is recommended to use networkFenceClassName to specify these.
30+ # Note: `driver` is referred to as the `provisioner` in NetworkFenceClass.
31+ driver : example.driver
2032 secret :
2133 name : fence-secret
2234 namespace : default
2638
2739> **Note**: Creation of a NetworkFence CR blocks access to the corresponding CIDR block; which is then unblocked the CR deletion.
2840
29- - ` provisioner`: specifies the name of storage provisioner.
41+ - ` networkFenceClassName`: specifies the name of the NetworkFenceClass.
42+ - `driver` : specifies the name of storage provisioner.
3043- `cidrs` : refers to the CIDR blocks on which the mentioned fence/unfence operation is to be performed.
3144- `secret` : refers to the kubernetes secret required for network fencing operation.
3245 - `name` : specifies the name of the secret
0 commit comments