mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 13:44:24 +00:00
feat: k8s network policies examples
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: GlobalNetworkPolicy
|
||||
metadata:
|
||||
name: deny-all-but-kube-dns
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress: []
|
||||
egress:
|
||||
- to:
|
||||
- namespaceSelector: {}
|
||||
podSelector:
|
||||
matchLabels:
|
||||
k8s-app: kube-dns
|
||||
ports:
|
||||
- port: 53
|
||||
protocol: UDP
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-everything-in-same-namespace
|
||||
spec:
|
||||
podSelector: {}
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector: {}
|
||||
egress:
|
||||
- to:
|
||||
- podSelector: {}
|
||||
@@ -40,6 +40,7 @@ All the references in the [further readings] section, plus the following:
|
||||
<!-- Others -->
|
||||
[an introduction to kubernetes network policies for security people]: https://reuvenharrison.medium.com/an-introduction-to-kubernetes-network-policies-for-security-people-ba92dd4c809d
|
||||
[get started with kubernetes network policy]: https://docs.tigera.io/calico/latest/network-policy/get-started/kubernetes-policy/kubernetes-network-policy
|
||||
[graphical editor]: https://editor.networkpolicy.io/
|
||||
[implementing kubernetes network policies: a comprehensive guide]: https://blog.kubesimplify.com/implementing-kubernetes-network-policies-a-comprehensive-guide
|
||||
[kubernetes network policy recipes]: https://github.com/ahmetb/kubernetes-network-policy-recipes
|
||||
[setting up kubernetes network policies: a detailed guide]: https://www.cncf.io/blog/2019/04/19/setting-up-kubernetes-network-policies-a-detailed-guide/
|
||||
|
||||
Reference in New Issue
Block a user