Skip to content

Commit

Permalink
fix(ingress): add device-code and firebase messaging ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
moabu committed Mar 21, 2022
1 parent ff2dc86 commit a7fe730
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,122 @@ spec:

---

{{ if .Values.ingress.deviceCodeEnabled -}}
{{ $fullName := include "nginx-ingress.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-device-code
labels:
app: {{ $fullName }}-device-code
{{- if .Values.ingress.additionalLabels }}
{{ toYaml .Values.ingress.additionalLabels | indent 4 }}
{{- end }}
{{- if .Values.ingress.deviceCodeLabels }}
{{ toYaml .Values.ingress.deviceCodeLabels | indent 4 }}
{{- end }}
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/configuration-snippet: "rewrite /device-code /oxauth/device_authorization.htm$1 break;"
nginx.ingress.kubernetes.io/rewrite-target: /oxauth/device_authorization.htm
{{- if .Values.ingress.deviceCodeAdditionalAnnotations }}
{{ toYaml .Values.ingress.deviceCodeAdditionalAnnotations | indent 4 }}
{{- end }}
{{- if .Values.ingress.additionalAnnotations }}
{{ toYaml .Values.ingress.additionalAnnotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- $host := . -}}
{{- with $ }}
- host: {{ $host | quote }}
http:
paths:
- path: /device-code
pathType: Exact
backend:
service:
name: oxauth
port:
number: 8080
{{- end }}
{{- end }}
{{- end }}

---

{{ if .Values.ingress.firebaseMessagingEnabled -}}
{{ $fullName := include "nginx-ingress.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-firebase-messaging
labels:
app: {{ $fullName }}-firebase-messaging
{{- if .Values.ingress.additionalLabels }}
{{ toYaml .Values.ingress.additionalLabels | indent 4 }}
{{- end }}
{{- if .Values.ingress.firebaseMessagingLabels }}
{{ toYaml .Values.ingress.firebaseMessagingLabels | indent 4 }}
{{- end }}
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/configuration-snippet: "rewrite /firebase-messaging-sw.js /oxauth/firebase-messaging-sw.js$1 break;"
nginx.ingress.kubernetes.io/rewrite-target: /oxauth/firebase-messaging-sw.js
{{- if .Values.ingress.firebaseMessagingAdditionalAnnotations }}
{{ toYaml .Values.ingress.firebaseMessagingAdditionalAnnotations | indent 4 }}
{{- end }}
{{- if .Values.ingress.additionalAnnotations }}
{{ toYaml .Values.ingress.additionalAnnotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- $host := . -}}
{{- with $ }}
- host: {{ $host | quote }}
http:
paths:
- path: /firebase-messaging-sw.js
pathType: Exact
backend:
service:
name: oxauth
port:
number: 8080
{{- end }}
{{- end }}
{{- end }}

---

{{ if .Values.ingress.openidConfigEnabled -}}
{{ $fullName := include "nginx-ingress.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
Expand Down
12 changes: 12 additions & 0 deletions pygluu/kubernetes/templates/helm/gluu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,18 @@ nginx-ingress:
openidConfigLabels: { }
# -- openid-configuration ingress resource additional annotations.
openidAdditionalAnnotations: { }
# -- Enable endpoint /device-code
deviceCodeEnabled: true
# -- device-code ingress resource labels. key app is taken
deviceCodeLabels: { }
# -- device-code ingress resource additional annotations.
deviceCodeAdditionalAnnotations: { }
# -- Enable endpoint /firebase-messaging-sw.js
firebaseMessagingEnabled: true
# -- Firebase Messaging ingress resource labels. key app is taken
firebaseMessagingLabels: { }
# -- Firebase Messaging ingress resource additional annotations.
firebaseMessagingAdditionalAnnotations: { }
# -- Enable endpoint /.well-known/uma2-configuration
uma2ConfigEnabled: true
# -- uma 2 config ingress resource labels. key app is taken
Expand Down

0 comments on commit a7fe730

Please sign in to comment.