I have two services, tea and coffee, each is in their own namespace, I would like domain.com to go to the tea service and domain.com/coffee to go to coffee.
As each is in a namespace I have had to make two pieces of ingress, but when I try to apply them I get the error MAPPING Path '/coffee' already defined in another Ingress rule.
My two pieces of ingress look like the following:
Tea:
kind: Ingress
apiVersion: extensions/v1beta1
spec:
tls:
- hosts:
- domain.com
secretName: tea-tls
rules:
- host: domain.com
http:
paths:
- path: /
backend:
serviceName: tea
servicePort: 80
and Coffee:
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: coffee
namespace: coffee
spec:
tls:
- hosts:
- domain.com
secretName: coffee}-tls
rules:
- host: domain.com
http:
paths:
- path: /coffee
backend:
serviceName: coffee
servicePort: 80
- path: /coffee/*
backend:
serviceName: coffee
servicePort: 80
I guess the problem isn't having tea and coffee, but defining the coffee path twice in the coffee ingress. According to https://kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout I would assume that you only need the /coffee path, and can delete the /coffee/* path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With