gcloud-lab/trading-platform/deploy/helm/execute-service/templates/networkpolicy.yaml

30 lines
673 B
YAML
Raw Normal View History

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "execute-service.fullname" . }}-network-policy
labels:
{{- include "execute-service.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "execute-service.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: api-gateway
ports:
- port: http
protocol: TCP
egress:
# Allow DNS resolution
- to: []
ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP