diff --git a/speedtest-exporter/Chart.yaml b/speedtest-exporter/Chart.yaml index 5eeccd4..869ba45 100644 --- a/speedtest-exporter/Chart.yaml +++ b/speedtest-exporter/Chart.yaml @@ -3,7 +3,7 @@ name: speedtest-exporter description: icon: https://b.cdnst.net/images/favicons/favicon-180.png type: application -version: 0.1.1 +version: 0.2.0 # renovate: image=ghcr.io/miguelndecarvalho/speedtest-exporter appVersion: "3.5.4" maintainers: diff --git a/speedtest-exporter/README.adoc b/speedtest-exporter/README.adoc index 68fa28c..18c62b9 100644 --- a/speedtest-exporter/README.adoc +++ b/speedtest-exporter/README.adoc @@ -2,7 +2,7 @@ = speedtest-exporter -image::https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square[Version: 0.1.1] +image::https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square[Version: 0.2.0] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] image::https://img.shields.io/badge/AppVersion-3.5.4-informational?style=flat-square[AppVersion: 3.5.4] == Maintainers @@ -192,6 +192,26 @@ helm uninstall speedtest-exporter-release | `""` | +| networkPolicy.egress.enabled +| bool +| `false` +| activate egress no networkpolicy + +| networkPolicy.egress.extra +| list +| `[]` +| egress rules + +| networkPolicy.enabled +| bool +| `false` +| + +| networkPolicy.ingress.http +| list +| `[]` +| ingress for http port (e.g. ingress-controller, prometheus) + | nodeSelector | object | `{}` diff --git a/speedtest-exporter/templates/networkpolicy.yaml b/speedtest-exporter/templates/networkpolicy.yaml new file mode 100644 index 0000000..cb011b3 --- /dev/null +++ b/speedtest-exporter/templates/networkpolicy.yaml @@ -0,0 +1,28 @@ +{{- if .Values.networkPolicy.enabled }} +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "speedtest-exporter.fullname" . }} + labels: + {{- include "speedtest-exporter.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + {{- include "speedtest-exporter.selectorLabels" . | nindent 6 }} + policyTypes: + - Ingress + {{- if .Values.networkPolicy.egress.enabled }} + - Egress + {{- end }} + ingress: + - ports: + - port: 9798 + protocol: TCP + from: + {{- toYaml .Values.networkPolicy.ingress.http | nindent 8 }} + {{- with .Values.networkPolicy.egress }} + egress: + {{- toYaml .extra | nindent 4 }} + {{- end }} +{{- end }} diff --git a/speedtest-exporter/values.yaml b/speedtest-exporter/values.yaml index 4dc6d65..e85daa6 100644 --- a/speedtest-exporter/values.yaml +++ b/speedtest-exporter/values.yaml @@ -71,6 +71,17 @@ grafana: grafana_dashboard: "1" annotations: {} +networkPolicy: + enabled: false + ingress: + # -- ingress for http port (e.g. ingress-controller, prometheus) + http: [] + egress: + # -- activate egress no networkpolicy + enabled: false + # -- egress rules + extra: [] + ingress: enabled: false className: ""