-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a86298f
commit 8c86f15
Showing
6 changed files
with
149 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test_outputs/connlist/anp_test_named_ports_multiple_peers_connlist_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
0.0.0.0-104.154.164.169 => ns1/pod1[Deployment] : All Connections | ||
0.0.0.0-104.154.164.169 => ns3/pod1[Deployment] : All Connections | ||
104.154.164.170-104.154.164.170 => ns1/pod1[Deployment] : All Connections | ||
104.154.164.170-104.154.164.170 => ns3/pod1[Deployment] : All Connections | ||
104.154.164.171-255.255.255.255 => ns1/pod1[Deployment] : All Connections | ||
104.154.164.171-255.255.255.255 => ns3/pod1[Deployment] : All Connections | ||
ns1/pod1[Deployment] => 0.0.0.0-104.154.164.169 : All Connections | ||
ns1/pod1[Deployment] => 104.154.164.170-104.154.164.170 : TCP 8080,UDP 5000-6000 | ||
ns1/pod1[Deployment] => 104.154.164.171-255.255.255.255 : All Connections | ||
ns1/pod1[Deployment] => ns3/pod1[Deployment] : TCP 8080,UDP 80,5000-6000 | ||
ns3/pod1[Deployment] => 0.0.0.0-104.154.164.169 : All Connections | ||
ns3/pod1[Deployment] => 104.154.164.170-104.154.164.170 : All Connections | ||
ns3/pod1[Deployment] => 104.154.164.171-255.255.255.255 : All Connections | ||
ns3/pod1[Deployment] => ns1/pod1[Deployment] : All Connections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ns1 | ||
labels: | ||
apps: all-apps | ||
spec: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ns3 | ||
labels: | ||
apps: external-apps | ||
spec: {} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: pod1 | ||
namespace: ns1 | ||
labels: | ||
app: a-app | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: a-app | ||
template: | ||
metadata: | ||
labels: | ||
app: a-app | ||
spec: | ||
containers: | ||
- name: ns1 | ||
image: quay.io/shfa/ns1:latest | ||
ports: | ||
- containerPort: 80 | ||
- containerPort: 81 | ||
- containerPort: 80 | ||
protocol: UDP | ||
- containerPort: 81 | ||
protocol: UDP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: pod1 | ||
namespace: ns3 | ||
labels: | ||
app: web | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: web | ||
template: | ||
metadata: | ||
labels: | ||
app: web | ||
spec: | ||
containers: | ||
- name: ns2 | ||
image: quay.io/shfa/ns2:latest | ||
ports: | ||
- containerPort: 80 | ||
- containerPort: 81 | ||
- containerPort: 80 | ||
protocol: UDP | ||
name: dns | ||
- containerPort: 81 | ||
protocol: UDP | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# a file copied from : | ||
# https://docs.openshift.com/container-platform/4.17/networking/network_security/AdminNetworkPolicy/ovn-k-egress-nodes-networks-peer.html#egress-traffic-control-networks-peer-external-destinations_ovn-k-egress-nodes-networks-peer | ||
# with some changes | ||
apiVersion: policy.networking.k8s.io/v1alpha1 | ||
kind: AdminNetworkPolicy | ||
metadata: | ||
name: egress-peer-1 | ||
spec: | ||
egress: | ||
- action: "Allow" | ||
name: "allow-egress" | ||
to: | ||
- networks: | ||
- 104.154.164.170/32 | ||
- pods: | ||
namespaceSelector: | ||
matchLabels: | ||
apps: external-apps | ||
podSelector: | ||
matchLabels: | ||
app: web | ||
ports: | ||
- portRange: | ||
protocol: UDP | ||
start: 5000 | ||
end: 6000 | ||
- portNumber: | ||
protocol: TCP | ||
port: 8080 | ||
- namedPort: dns | ||
- action: "Deny" # deny all other ports | ||
name: "deny-egress" | ||
to: | ||
- networks: | ||
- 104.154.164.170/32 | ||
- pods: | ||
namespaceSelector: | ||
matchLabels: | ||
apps: external-apps | ||
podSelector: | ||
matchLabels: | ||
app: web | ||
priority: 30 | ||
subject: | ||
namespaces: | ||
matchLabels: | ||
apps: all-apps |