Skip to content

Commit

Permalink
[TIKA-3483] Implement a network policy for Helm Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
euven authored Aug 11, 2021
1 parent b0d6670 commit ca9d55b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
23 changes: 23 additions & 0 deletions templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "tika-helm.fullname" . }}
labels:
{{- include "tika-helm.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "tika-helm.selectorLabels" . | nindent 6 }}
egress:
- {}
ingress:
- ports:
- port: {{ .Values.service.port }}
{{- if not .Values.networkPolicy.allowExternal }}
from:
- podSelector:
matchLabels:
{{ template "tika-helm.fullname" . }}-client: "true"
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,10 @@ nodeSelector: {}
tolerations: []

affinity: {}

networkPolicy:
# networkPolicy.enabled -- Create a network policy to restrict traffic to pods
# within the same namespace that include the label `<release>-client: true`.
enabled: false
# networkPolicy.allowExternal -- Don't require a "-client" label for connections.
allowExternal: false

0 comments on commit ca9d55b

Please sign in to comment.