Skip to content

Commit a74845a

Browse files
authored
Merge pull request #467 from PatrickSpies/feat/chart-netpol
feat: add optional networkpolicy to helm-chart
2 parents ffe6c65 + b228cb4 commit a74845a

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ _gopath/
99
.vscode
1010
vendor
1111
dist
12-
Reloader
12+
Reloader
13+
!**/chart/reloader
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if and ( .Values.reloader.netpol.enabled ) }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
annotations:
6+
{{ include "reloader-helm3.annotations" . | indent 4 }}
7+
labels:
8+
{{ include "reloader-labels.chart" . | indent 4 }}
9+
{{- if .Values.reloader.matchLabels }}
10+
{{ toYaml .Values.reloader.matchLabels | indent 4 }}
11+
{{- end }}
12+
name: {{ template "reloader-fullname" . }}
13+
spec:
14+
podSelector:
15+
matchLabels:
16+
app: {{ template "reloader-fullname" . }}
17+
release: {{ .Release.Name | quote }}
18+
{{- if .Values.reloader.matchLabels }}
19+
{{ toYaml .Values.reloader.matchLabels | indent 6 }}
20+
{{- end }}
21+
policyTypes:
22+
- Ingress
23+
ingress:
24+
- ports:
25+
- port: http
26+
{{- with .Values.reloader.netpol.from}}
27+
from:
28+
{{- toYaml .| nindent 8 }}
29+
{{- end }}
30+
{{- end }}

deployments/kubernetes/chart/reloader/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,10 @@ reloader:
268268
enabled: false
269269
# Set the minimum available replicas
270270
# minAvailable: 1
271+
272+
netpol:
273+
enabled: false
274+
from: []
275+
# - podSelector:
276+
# matchLabels:
277+
# app.kubernetes.io/name: prometheus

0 commit comments

Comments
 (0)