Skip to content

Commit

Permalink
Merge pull request #306 from Flagsmith/fix/sse-ingress
Browse files Browse the repository at this point in the history
fix: Add missing SSE ingress
  • Loading branch information
rolodato authored Jan 17, 2025
2 parents ba3d3ed + 3d1b637 commit 8cae5e7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/flagsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: flagsmith
description: Flagsmith
type: application
version: 0.64.0
version: 0.65.0
appVersion: 2.159.0
dependencies:
- name: postgresql
Expand Down
59 changes: 59 additions & 0 deletions charts/flagsmith/templates/ingress-sse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- if .Values.ingress.sse.enabled -}}
{{- $fullName := include "flagsmith.fullname" . -}}
{{- $svcPort := .Values.service.sse.port -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-sse
labels:
{{- include "flagsmith.labels" . | nindent 4 }}
app.kubernetes.io/component: sse
{{- $annotations := include "flagsmith.annotations" ( dict "customAnnotations" .Values.ingress.sse.annotations "commonValues" .Values.common ) }}
{{- with $annotations }}
annotations:
{{- . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.sse.ingressClassName }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.ingress.sse.tls }}
tls:
{{- range .Values.ingress.sse.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.sse.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix
backend:
service:
name: {{ $fullName}}-sse
port:
number: {{ $svcPort }}
{{- else }}
backend:
serviceName: {{ $fullName }}-sse
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ sse:
# extraEnv:
# REDIS_HOST: redis.example.com
# REDIS_PORT: 6379
# USE_CLUSTER_MODE: true # - set this if connecting to a Redis cluster, not a single node
# extraEnvFromSecret:
# REDIS_PASSWORD:
# secretName: my_redis_secrets
Expand Down

0 comments on commit 8cae5e7

Please sign in to comment.