diff --git a/grampsweb/Chart.yaml b/grampsweb/Chart.yaml index d4379b6..0bb216c 100644 --- a/grampsweb/Chart.yaml +++ b/grampsweb/Chart.yaml @@ -3,7 +3,7 @@ name: grampsweb description: A Helm chart for gramps web icon: https://raw.githubusercontent.com/gramps-project/Gramps.js/main/images/icon512.png type: application -version: 0.1.15 +version: 0.2.0 # renovate: image=ghcr.io/gramps-project/grampsweb appVersion: "24.7.1" maintainers: diff --git a/grampsweb/README.adoc b/grampsweb/README.adoc index d4b5a1e..ab55169 100644 --- a/grampsweb/README.adoc +++ b/grampsweb/README.adoc @@ -2,7 +2,7 @@ = grampsweb -image::https://img.shields.io/badge/Version-0.1.15-informational?style=flat-square[Version: 0.1.15] +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-24.7.1-informational?style=flat-square[AppVersion: 24.7.1] == Maintainers @@ -187,6 +187,26 @@ helm uninstall grampsweb-release | `""` | +| networkPolicy.egress.enabled +| bool +| `true` +| 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) + | nodeSelector | object | `{}` diff --git a/grampsweb/templates/networkpolicy.yaml b/grampsweb/templates/networkpolicy.yaml new file mode 100644 index 0000000..cec8c65 --- /dev/null +++ b/grampsweb/templates/networkpolicy.yaml @@ -0,0 +1,28 @@ +{{- if .Values.networkPolicy.enabled }} +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "grampsweb.fullname" . }} + labels: + {{- include "grampsweb.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + {{- include "grampsweb.selectorLabels" . | nindent 6 }} + policyTypes: + - Ingress + {{- if .Values.networkPolicy.egress.enabled }} + - Egress + {{- end }} + ingress: + - ports: + - port: {{ .Values.service.port }} + protocol: TCP + from: + {{- toYaml .Values.networkPolicy.ingress.http | nindent 8 }} + {{- with .Values.networkPolicy.egress }} + egress: + {{- toYaml .extra | nindent 4 }} + {{- end }} +{{- end }} diff --git a/grampsweb/values.yaml b/grampsweb/values.yaml index a088a88..5427161 100644 --- a/grampsweb/values.yaml +++ b/grampsweb/values.yaml @@ -90,6 +90,17 @@ service: type: ClusterIP port: 5000 +networkPolicy: + enabled: false + ingress: + # -- ingress for http port (e.g. ingress-controller) + http: [] + egress: + # -- activate egress no networkpolicy + enabled: true + # -- egress rules + extra: [] + ingress: enabled: false className: ""