From 79f58a0c8d71d9e1c3678eb470c6ae3025433360 Mon Sep 17 00:00:00 2001 From: Marlon Garcia Date: Wed, 27 Jul 2022 18:18:35 -0400 Subject: [PATCH] Add support to basic ingress controller Ingress controller support for the stardog helm chart. (Issue #79) --- charts/stardog/templates/ingress.yaml | 65 +++++++++++++++++++++++++++ charts/stardog/values.yaml | 18 ++++++++ 2 files changed, 83 insertions(+) create mode 100644 charts/stardog/templates/ingress.yaml diff --git a/charts/stardog/templates/ingress.yaml b/charts/stardog/templates/ingress.yaml new file mode 100644 index 0000000..0fec13a --- /dev/null +++ b/charts/stardog/templates/ingress.yaml @@ -0,0 +1,65 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "stardog.fullname" . -}} +{{- $httpPort := .Values.ports.server -}} +{{- $pathtype := .Values.ingress.pathtype -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }}-ingress + namespace: {{ include "stardog.namespace" . }} + labels: + app: {{ .Chart.Name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: + {{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className | quote }} + {{- end }} +{{- if .Values.ingress.tls }} + tls: + {{- if .ingressPath }} + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- else }} +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end }} +{{- end}} + rules: + {{- range .Values.ingress.hosts }} + {{- if $ingressPath }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + pathType: {{ $pathtype }} + backend: + service: + name: {{ $fullName }} + port: + number: {{ $httpPort }} + {{- else }} + - host: {{ .host }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ $pathtype }} + backend: + service: + name: {{ $fullName }} + port: + number: {{ $httpPort }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/stardog/values.yaml b/charts/stardog/values.yaml index 93938e8..42f4198 100644 --- a/charts/stardog/values.yaml +++ b/charts/stardog/values.yaml @@ -171,3 +171,21 @@ zookeeper: # failureThreshold: 6 # successThreshold: 1 # probeCommandTimeout: 2 + +# Settings for enable ingress controller. +ingress: + enabled: false + annotations: {} + # nginx.ingress.kubernetes.io/use-regex: "true" + # nginx.ingress.kubernetes.io/app-root: "/admin/alive" + # kubernetes.io/tls-acme: "true" + #className: "nginx" + #pathtype: Prefix + hosts: [] + # - host: chart-example.local + # paths: + # - path: / + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local \ No newline at end of file