i would like to run an Spring Boot APP with an Angular Frontend using Keycloak as an IDP inside a Kubernetes Cluster.
Running the App with HTTPs works fine:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-app-ingress
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/x-forwarded-prefix: "/"
spec:
tls:
- hosts:
- myapp.northeurope.cloudapp.azure.com
secretName: tls-secret
rules:
- host: myapp.northeurope.cloudapp.azure.com
http:
paths:
- path: /?(.*)
backend:
serviceName: my-service
servicePort: 8080
But if Keycloak comes in, i am stuck
First ide was to change the path for the app:
metadata:
name: my-app-ingress
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/x-forwarded-prefix: "/app"
spec:
tls:
- hosts:
- myapp.northeurope.cloudapp.azure.com
secretName: tls-secret
rules:
- host: myapp.northeurope.cloudapp.azure.com
http:
paths:
- path: /app/?(.*)
backend:
serviceName: my-service
servicePort: 8080
But then the loading of the angular libraries does not work cause the app try to load them from / instead of /app.
Same thing for the IDP:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: keycloak-ingress
annotations:
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/x-forwarded-prefix: "/idp"
spec:
tls:
- hosts:
- myapp.northeurope.cloudapp.azure.com
secretName: tls-secret
rules:
- host: myapp.northeurope.cloudapp.azure.com
http:
paths:
- path: /idp/?(.*)
backend:
serviceName: keycloak-http
servicePort: 80
Any help which settings to be used is welcome :-)
Kind Regards