I would like to use multiple rules under the one ingress name.
{
"kind": "Ingress",
"spec": {
"rules": [
{
"host": "gke-service-xyz.com",
"http": {
"paths": [
{
"path": "/",
"backend": {
"serviceName": "gke-service",
"servicePort": 8080
}
}
]
}
},
{
"host": "gke-service1-xyz.com",
"http": {
"paths": [
{
"path": "/",
"backend": {
"serviceName": "gke-service1",
"servicePort": 8081
}
}
]
}
}
]
},
"apiVersion": "extensions/v1beta1",
"metadata": {
"annotations": {
"kubernetes.io/ingress.class": "nginx",
"nginx.ingress.kubernetes.io/ssl-redirect": "false"
},
"name": "javaservice1-ingress"
},
"namespace": "abc-namespace"
}
YAML CODE
kind: Ingress
spec:
rules:
- host: gke-service-xyz.com
http:
paths:
- path: "/"
backend:
serviceName: gke-service
servicePort: 8080
- host: gke-service1-xyz.com
http:
paths:
- path: "/"
backend:
serviceName: gke-service1
servicePort: 8081
apiVersion: extensions/v1beta1
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
name: javaservice1-ingress
namespace: abc-namespace
Here the problem is the first ingress host is working fine but while fetching the second ingress host is not working and it is showing like, 503 Service Temporarily Unavailable. I want both the hosts in a working state. Is there any way to achieve the same?
- ingress name: service-ingress.
- gke-service-xyz.com
- gke-service1-xyz.com
Above points 1 and 2 are the ingress endpoints both should work but here only 1 is in working. Both the above YAML codes are not working.