2
2
3
3
NetworkFence is a cluster-scoped custom resource that allows Kubernetes to invoke "Network fence" operation on a storage provider.
4
4
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
+
6
14
The creation of NetworkFence CR will add a network fence, and its deletion will undo the operation.
7
15
8
16
## Fence Operation
@@ -13,10 +21,14 @@ kind: NetworkFence
13
21
metadata :
14
22
name : network-fence-sample
15
23
spec :
16
- driver : example.driver
24
+ networkFenceClassName : network-fence-class
17
25
cidrs :
18
26
- 10.90.89.66/32
19
27
- 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
20
32
secret :
21
33
name : fence-secret
22
34
namespace : default
26
38
27
39
> **Note**: Creation of a NetworkFence CR blocks access to the corresponding CIDR block; which is then unblocked the CR deletion.
28
40
29
- - ` provisioner`: specifies the name of storage provisioner.
41
+ - ` networkFenceClassName`: specifies the name of the NetworkFenceClass.
42
+ - `driver` : specifies the name of storage provisioner.
30
43
- `cidrs` : refers to the CIDR blocks on which the mentioned fence/unfence operation is to be performed.
31
44
- `secret` : refers to the kubernetes secret required for network fencing operation.
32
45
- `name` : specifies the name of the secret
0 commit comments