GKE Ingress controller multipath

12/6/2018

I am trying to set up a multipath ingress controller, the problem I encounter is that one path is completely ignored.The service at /blog never gets hit.I tried duplicating the host entry but is the same result. Any help is more than welcomed as i've been hitting my head against the wall for past 10 hours with this.

This is the ingress.yaml:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: 'my-ingress-ip'
spec:
  tls:
    - secretName: my-ingress-tls
  rules:
    - host: www.example.com
      http:
        paths: 
          - path: /blog
            backend:
              serviceName: blog
              servicePort: 81
          - path: /*
            backend:
              serviceName: www
              servicePort: 80
    - host: graphql.example
      http:
        paths:
          - path: /*
            backend:
              serviceName: example-graphql
              servicePort: 80
-- Popa Alex
gcloud
google-cloud-platform
kubernetes
kubernetes-ingress

1 Answer

12/6/2018

This how it should be your ingress if you want to have multi service in one host:

 apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      name: my-ingress
      annotations:
        kubernetes.io/ingress.global-static-ip-name: 'my-ingress-ip'
    spec:
      tls:
        - secretName: my-ingress-tls
      rules:
        - host: www.example.com
          http:
            paths: 
              - path: /blog/*
                backend:
                  serviceName: blog
                  servicePort: 81
              - path: /*
                backend:
                  serviceName: www
                  servicePort: 80
        - host: graphql.example
          http:
            paths:
              - path: /*
                backend:
                  serviceName: example-graphql
                  servicePort: 80
-- Alioua
Source: StackOverflow