Skip to content

Commit

Permalink
[stable/prometheus-pushgateway] Fix networkPolicy podSelector and ing…
Browse files Browse the repository at this point in the history
…ress rule (helm#23053)

* Fix `podSelector` by adding `release` label
* Fix ingress rule by ensuring port is restricted

  Before it was:

    * Source: any, Port: `targetPort`
    * Source: `customSelectors`, Port: any

  Now it is:

    * Source: `customSelectors`, Port: `targetPort`

  and `allowAll` does not add an any/any rule anymore.

Signed-off-by: Maxime Brunet <[email protected]>
Signed-off-by: Adrien Loiseau <[email protected]>
  • Loading branch information
maxbrunet authored and li-adrienloiseau committed Jul 29, 2020
1 parent 451abe5 commit 39faa75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/prometheus-pushgateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "1.2.0"
description: A Helm chart for prometheus pushgateway
name: prometheus-pushgateway
version: 1.4.0
version: 1.4.1
home: https://github.com/prometheus/pushgateway
sources:
- https://github.com/prometheus/pushgateway
Expand Down
5 changes: 2 additions & 3 deletions stable/prometheus-pushgateway/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ spec:
podSelector:
matchLabels:
app: {{ template "prometheus-pushgateway.name" .}}
release: {{ .Release.Name }}
ingress:
- ports:
- port: {{ .Values.service.targetPort }}
{{- if .Values.networkPolicy.customSelectors }}
- from:
from:
{{ toYaml .Values.networkPolicy.customSelectors | indent 8 }}
{{- else if .Values.networkPolicy.allowAll }}
- {}
{{- end -}}
{{- end -}}

0 comments on commit 39faa75

Please sign in to comment.