Created
March 16, 2023 03:50
-
-
Save owensengoku/7e8cf83f44b8798f84109b63574580ef to your computer and use it in GitHub Desktop.
network-policy-sample.yaml
This file contains hidden or 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
apiVersion: networking.k8s.io/v1 | |
kind: NetworkPolicy | |
metadata: | |
name: test-network-policy | |
namespace: default #You can specify the namespace by your requirement | |
spec: | |
podSelector: {} # Means select all | |
policyTypes: | |
- Egress | |
egress: | |
- to: | |
- ipBlock: | |
cidr: 10.0.0.0/24 #The cidr allowed to go | |
ports: | |
- protocol: TCP | |
port: 5978 #The port allowed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment