Skip to content

Commit

Permalink
feat(networkPolicy): networkpolicy for juice-shop
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbg authored and J12934 committed Sep 23, 2023
1 parent 6cbb657 commit 46c0b03
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions helm/multi-juicer/templates/juice-shop/networkPolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
{{- if .Values.juiceshop.networkPolicy }}
{{- if .Values.juiceShop.networkPolicy }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: networkPolicy-juice-shop
name: networkpolicy-juice-shop
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: 'juice-shop'
policyTypes:
- Ingress
- Egress
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
{{- include "multi-juicer.juice-balancer.labels" . | nindent 14 }}
ports:
- port: http
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: 'juice-balancer'
ports:
- port: http
egress:
- to:
- podSelector:
matchLabels:
{{- include "multi-juicer.juice-balancer.labels" . | nindent 14 }}
ports:
- port: http
{{- end }}
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: 'juice-balancer'
- podSelector:
matchLabels:
app.kubernetes.io/name: 'progress-watchdog'
ports:
- port: http
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
{{- end }}

0 comments on commit 46c0b03

Please sign in to comment.