I have camunda spring boot application deployed as K8s deployment and have 2 replicas running. To enable session affinity, have configured K8s nginx. i am using rewrite annotation to to differentiate multiple microservices running. Below is my ingress resource definition and the url that am using to access the camunda page - http://:/sample/camunda/app/welcome/default/
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myservice
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "sample"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/use-port-in-redirects: "false"
nginx.ingress.kubernetes.io/rewrite-target: /camunda/app/welcome/default/
spec:
rules:
- http:
paths:
- backend:
serviceName: myservice-service
servicePort: 61055
path: /sample
if I dont use rewrite annotation and use the below definition , it works fine with the url - http://:/camunda/app/welcome/default/
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myservice
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "sample"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/use-port-in-redirects: "false"
spec:
rules:
- http:
paths:
- backend:
serviceName: myservice-service
servicePort: 61055
path: /
As I need to use different paths for different services, I had to go for rewrite annotation. But the camunda page is not loading if I use rewrite rule. Could you please suggest a solution?