Created
January 4, 2024 21:23
-
-
Save weinong/dbe4c651de398b574c938853733708b0 to your computer and use it in GitHub Desktop.
network policy with cilium
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: deny-egress-to-imds | |
| spec: | |
| podSelector: {} | |
| policyTypes: | |
| - Egress | |
| egress: | |
| - to: | |
| - ipBlock: | |
| cidr: 0.0.0.0/0 | |
| except: | |
| - 169.254.169.254/32 | |
| - namespaceSelector: | |
| matchLabels: | |
| kubernetes.io/metadata.name: kube-system | |
| - podSelector: | |
| matchLabels: | |
| k8s-app: kube-dns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment