Web app not displaying pages using Kubernetes traefik ingress controller

5/20/2019

My app does not work when I use a path other than / in the ingress rule. The app works when I access the application using http://gv.cloud.test.com:nodeport outside kubernetes cluster however does not work with http://gv.cloud.test.com/mytestapp. Can someone help me? The web app is using / as the base_href path in angular.

I am using traefik as the ingress controller. I have tried all the available traefik rule types:

PathPrefixStrip PathPrefix etc

apiVersion: extensions/v1beta1                                                                                        
kind: Ingress                                                                                                         
metadata:                                                                                                             
  annotations:                                                     
    kubernetes.io/ingress.class: traefik                                                                              
    traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip                                                          
  labels:                                                                                                             
    app: my-testapp                                                                                             
    env: dev                                                                                                          
  name: my-testapp-dev-ingress                                                                                  
  namespace: jenkins                                                                                                  

spec:                                                                                                                 
  rules:                                                                                                              
  - host: gv.cloud.test.com                                                               
    http:                                                                                                             
      paths:                                                                                                          
      - backend:                                                                                                      
          serviceName: my-testapp-service                                                            
          servicePort: 8090                                                                                
        path: /mytestapp
-- Ganesh Venkataramanan
kubernetes
traefik

0 Answers