Skip to content

Instantly share code, notes, and snippets.

@DStorck
Created September 7, 2017 17:00
Show Gist options
  • Save DStorck/1c5db38eb9d15e8899bce598060da4dd to your computer and use it in GitHub Desktop.
Save DStorck/1c5db38eb9d15e8899bce598060da4dd to your computer and use it in GitHub Desktop.
kubernetes network policy example
kind: NetworkPolicy
apiVersion: extensions/v1beta1
metadata:
name: access-nginx
namespace: secret
spec:
podSelector:
matchLabels:
run: nginx
ingress:
- from:
- namespaceSelector:
matchExpressions:
- key: Namespace
operator: NotIn
values:
- secret
ports:
- protocol: TCP
port: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment