Skip to content

Commit 977e416

Browse files
authored
Merge pull request #1041 from gunjan5/bringbackoursnp
SNP for calico v2.4 or older
2 parents eb96a91 + 4733032 commit 977e416

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

hack/remove-calico-policy/override-policy.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
This section describes how to override the Calico-enabled Network Policy using higher priority system-wide
44
network policy.
55

6-
In the following we describe how to create a `GlobalNetworkPolicy` resource using `kubectl` to allow all
7-
ingress and egress traffic, overriding any other Network Policy that has been configured.
6+
In the following we describe how to create a `GlobalNetworkPolicy` (`SystemNetworkPolicy` for Calico `v2.4.x` or older)
7+
resource using `kubectl` to allow all ingress and egress traffic, overriding any other Network Policy that has been configured.
88

99
### Requirements / Assumptions
1010

11-
- Calico version v2.5 or higher
12-
- Kubernetes v1.7 or higher
11+
- Calico version `v2.3` or higher
12+
- Kubernetes `v1.6` or higher
1313
- Calico is running in policy-only mode (without Calico networking)
1414
- Calico is using using the Kubernetes API as the datastore
1515

@@ -19,17 +19,33 @@ ingress and egress traffic, overriding any other Network Policy that has been co
1919
2020
#### Override Calico policy to allow all traffic
2121

22-
Create a `GlobalNetworkPolicy` resource by running the following command:
22+
Create a policy-override resource by running the following command:
23+
24+
For Calico `v2.5.x` or higher:
2325

2426
```
2527
kubectl create -f=https://raw.githubusercontent.com/projectcalico/calico/master/hack/remove-calico-policy/global-network-policy-override.yaml
2628
```
2729

30+
For Calico `v2.3.x` and `v2.4.x`:
31+
32+
```
33+
kubectl create -f=https://raw.githubusercontent.com/projectcalico/calico/master/hack/remove-calico-policy/system-network-policy-override.yaml
34+
```
35+
2836
#### Revert override to enable Calico policy
2937

30-
To revert the override of Calico policy, delete the `GlobalNetworkPolicy` resource
38+
To revert the override of Calico policy, delete the policy-override resource
3139
responsible for the override by running the following command:
3240

41+
For Calico `v2.5.x` or higher:
42+
3343
```
3444
kubectl delete -f=https://raw.githubusercontent.com/projectcalico/calico/master/hack/remove-calico-policy/global-network-policy-override.yaml
3545
```
46+
47+
For Calico `v2.3.x` and `v2.4.x`:
48+
49+
```
50+
kubectl delete -f=https://raw.githubusercontent.com/projectcalico/calico/master/hack/remove-calico-policy/system-network-policy-override.yaml
51+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: "alpha.projectcalico.org/v1"
2+
kind: SystemNetworkPolicy
3+
metadata:
4+
name: allow-all-calico-policy
5+
namespace: kube-system
6+
spec:
7+
order: 0.0
8+
ingress:
9+
- action: allow
10+
egress:
11+
- action: allow

0 commit comments

Comments
 (0)