Skip to content

Commit

Permalink
Add extra ingress template
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Mar 27, 2024
1 parent cf2352a commit a2b7f97
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm/flowforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ For other values please refer to the documentation below.
- `forge.logPassthrough` Allows Node-RED Project pods to log in JSON format to standard out, allowing this to be ingested by a logging service (default `false`)
- `forge.labels` allows to add custom labels to the core application related objects (e.g. deployment, services, etc.) (default `{}`)
- `forge.podLabels` allows to add custom labels to the core application pod (default `{}`)
- `forge.replicas` allows the number of instances of the FlowFuse App to be set (default `1`)
- `forge.replicas` allows the number of instances of the FlowFuse App to be set. Scaling only supported with ingress-nginx controller (default `1`)


note: `forge.projectSelector` and `forge.managementSelector` defaults mean that you must have at least 2 nodes in your cluster and they need to be labeled before installing.
Expand Down
40 changes: 40 additions & 0 deletions helm/flowforge/templates/service-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,43 @@ spec:
- {{ $forgeHostname }}
secretName: {{ $forgeHostname }}
{{- end }}
{{- if gt .Values.forge.replicas 1 -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: flowforge-ingress
labels:
{{- include "forge.labels" . | nindent 4 }}
annotations:
{{- if .Values.ingress.certManagerIssuer }}
cert-manager.io/cluster-issuer: {{ $.Values.ingress.certManagerIssuer }}
{{- end }}
{{- if .Values.ingress.annotations }}
nginx.ingress.kubernetes.io/affinity: cookie
nginx.ingress.kubernetes.io/affinity-mode: persistent
nginx.ingress.kubernetes.io/session-cookie-name: FFSESSION
nginx.ingress.kubernetes.io/session-cookie-samesite: Strict
{{ toYaml .Values.ingress.annotations | replace "{{ instanceHost }}" $forgeHostname | replace "{{ serviceName }}" "forge" | indent 4 }}
{{- end }}
spec:
{{- if and $.Values.ingress.className (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ $.Values.ingress.className }}
{{- end }}
rules:
- host: {{ $forgeHostname }}
http:
paths:
- pathType: Prefix
path: "/api/v1/devices/"
backend:
service:
name: forge
port:
number: 80
{{- if .Values.ingress.certManagerIssuer }}
tls:
- hosts:
- {{ $forgeHostname }}
secretName: {{ $forgeHostname }}
{{- end }}
{{- end -}}

0 comments on commit a2b7f97

Please sign in to comment.