April 2018
Intermediate to advanced
468 pages
14h 34m
English
Network policies are configured through the NetworkPolicy resource. Here is a sample network policy:
apiVersion: networking.k8s.io/v1kind: NetworkPolicy
metadata:
name: test-network-policy
namespace: default
spec:
podSelector:
matchLabels:
role: db
ingress:
- from:
- namespaceSelector:
matchLabels:
project: awesome-project
- podSelector:
matchLabels:
role: frontend
ports:
- protocol: tcp
port: 6379
Read now
Unlock full access