To configure haproxy-ingress to allow access to multiple backend services using the same port, depending on the respective hostname, follow these steps:
app: service1
and app: service2
respectively.apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
ingress.kubernetes.io/ssl-redirect: "false" #Disable SSL redirect
spec:
rules:
- host: service1.example.com
http:
paths:
- path: /*
backend:
serviceName: service1
servicePort: 80
- host: service2.example.com
http:
paths:
- path: /*
backend:
serviceName: service2
servicePort: 80
This YAML file defines an Ingress resource that will expose two backend services named service1
and service2
, each at a different hostname. The haproxy-ingress controller will route requests to the appropriate backend service based on the hostname specified in the request.
In this way, you can configure haproxy-ingress to allow access to multiple backend services using the same port, depending on the respective hostname.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-29 16:29:32 +0000
Seen: 8 times
Last updated: May 29 '23