In GKE clsuter, I can't call with hostname in internal http loadbalancer config. This is generated ingress yaml file.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/backends: '{"k8s1-d21262da-default-hellorest-backend-service-80-698951b3":"HEALTHY","k8s1-d21262da-kube-system-default-http-backend-80-43d0837a":"HEALTHY"}'
ingress.kubernetes.io/forwarding-rule: k8s2-fr-h23zc63d-default-hellorest-ingress-i-jxaunyik
ingress.kubernetes.io/target-proxy: k8s2-tp-h23zc63d-default-hellorest-ingress-i-jxaunyik
ingress.kubernetes.io/url-map: k8s2-um-h23zc63d-default-hellorest-ingress-i-jxaunyik
kubernetes.io/ingress.class: gce-internal
creationTimestamp: "2021-04-08T09:29:50Z"
finalizers:
- networking.gke.io/ingress-finalizer-V2
generation: 1
managedFields:
- apiVersion: extensions/v1beta1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:kubernetes.io/ingress.class: {}
f:spec:
f:rules: {}
manager: GoogleCloudConsole
operation: Update
time: "2021-04-08T09:29:50Z"
- apiVersion: networking.k8s.io/v1beta1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:ingress.kubernetes.io/backends: {}
f:ingress.kubernetes.io/forwarding-rule: {}
f:ingress.kubernetes.io/target-proxy: {}
f:ingress.kubernetes.io/url-map: {}
f:finalizers:
.: {}
v:"networking.gke.io/ingress-finalizer-V2": {}
f:status:
f:loadBalancer:
f:ingress: {}
manager: glbc
operation: Update
time: "2021-04-08T09:30:44Z"
name: hellorest-ingress-i
namespace: default
resourceVersion: "39841"
selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/hellorest-ingress-i
uid: 728a4e1b-8435-4b1e-a378-82665e7a8a6c
spec:
rules:
- host: hello
http:
paths:
- backend:
serviceName: hellorest-backend-service
servicePort: 80
pathType: ImplementationSpecific
status:
loadBalancer:
ingress:
- ip: 10.178.100.7
In one of cluster node, service is successfully called with load balncer IP address. But call with hostname does not work.
# success with ip
$ curl http://10.224.13.150/hello
I am hellorest-backend-67fddc48f9-5hnmg(10.220.0.7)
# cannot resolve host
$ curl http://hello/hello
curl: (6) Couldn't resolve host 'hello'
More about test environments.
GKE Cluster: zonal / private cluster / 1.18.16-gke.302 / 2 nodes / control plane 172.16.0.0/28, global access disabled / http load balancing enableddeployed service: hellorest-backend-service / 3 pods / 80 to 8080 tcp forwarding / default namespace / NodePortingress service: hellorest-ingress-i / internal http(s) lb / default namespace / 10.178.100.7 / no problem in health check