Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
chart: Add networkPolicy (#598)
Browse files Browse the repository at this point in the history
* chart: Add networkPolicy

Signed-off-by: Sebastian Poehn <[email protected]>

* chart: Bump version

Signed-off-by: Sebastian Poehn <[email protected]>
  • Loading branch information
pho-enix authored and prydonius committed Feb 19, 2019
1 parent 74fe61c commit 2426f50
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/monocular/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: monocular
description: Monocular is a search and discovery front end for Helm Charts Repositories.
version: 1.3.0
version: 1.4.0
appVersion: v1.3.0
home: https://github.com/helm/monocular
sources:
Expand Down
20 changes: 20 additions & 0 deletions chart/monocular/templates/chartsvc-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "fullname" . }}-chartsvc
labels:
app: {{ template "fullname" . }}-chartsvc
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
podSelector:
matchLabels:
app: {{ template "fullname" . }}-chartsvc
release: {{ .Release.Name }}
ingress:
- ports:
- port: {{ .Values.chartsvc.service.port }}
protocol: TCP
{{- end }}
16 changes: 16 additions & 0 deletions chart/monocular/templates/prerender-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "fullname" . }}-prerender
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
podSelector:
matchLabels:
app: {{ template "fullname" . }}-prerender
ingress:
- ports:
- port: {{ .Values.prerender.service.internalPort }}
protocol: TCP
{{- end }}
16 changes: 16 additions & 0 deletions chart/monocular/templates/ui-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "fullname" . }}-ui
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
podSelector:
matchLabels:
app: {{ template "fullname" . }}-ui
ingress:
- ports:
- port: {{ .Values.ui.service.internalPort }}
protocol: TCP
{{- end }}
5 changes: 5 additions & 0 deletions chart/monocular/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,8 @@ global:
# It allows to be launch in a Kubernetes with PodSecurityPolicy with a policy set runAsNonRoot
securityContext: {}

# Installs networkPolicy for the services. This will allow communication betweeen the services in
# environments where the default policy is deny
networkPolicy:
enabled: false

0 comments on commit 2426f50

Please sign in to comment.