Skip to content

Commit

Permalink
feat: add network policy
Browse files Browse the repository at this point in the history
Signed-off-by: Guilhem Barthés <guilhem.barthes@owkin.com>
  • Loading branch information
guilhem-barthes committed Jun 21, 2024
1 parent 535efc5 commit 9ca6c0e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions charts/substra-frontend/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Deny ALL networking in launched substra ml task
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "substra-frontend.fullname". }}
labels:
{{ include "substra-frontend.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "substra-frontend.selectorLabels" . | nindent 6 }}
ingress:
- from:
- ipBlock:
cidr: 0.0.0.0/0
ports:
- port: 3000
protocol: TCP
{{- if eq .Values.service.type "NodePort" }}
{{- if not (empty .Values.service.nodePort) }}
- port: {{.Values.service.nodePort}}
protocol: TCP
{{- else }}
# If not nodePort specified, open the range
- port: 30000
endPort: 32767
protocol: TCP
{{- end }}
{{- end }}
policyTypes:
- Ingress
- Egress

0 comments on commit 9ca6c0e

Please sign in to comment.