Skip to content

Commit

Permalink
Add support to basic ingress controller
Browse files Browse the repository at this point in the history
Ingress controller support for the stardog helm chart. (Issue #79)
  • Loading branch information
marlonabarua committed Jul 27, 2022
1 parent 4017033 commit 79f58a0
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
65 changes: 65 additions & 0 deletions charts/stardog/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
18 changes: 18 additions & 0 deletions charts/stardog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 79f58a0

Please sign in to comment.