How to config service host via Kong Ingress?

I am using kong chart 1.5 with kong ingress controller 0.8.0 to deploy kong to our cluster via helm release.

I saw the service host has created automation when I set up via Ingress. Imagine it is review-web.staging.80.svc.

Now, I want to change it to another value. For example:

  • Change it to domain
  • Or point to another internal service another-service.staging.80.svc

By manual, I can do it, but I wonder how to do that via Kong Ingress?

You can set upstream.host_header in a KongIngress resource and then annotate your service using This will change the host-header to the value you prefer.

Let me show you my configuration:

kind: KongIngress
  name: demo-ki
  namespace: default
  host_header: "echo.internal.local"
apiVersion: extensions/v1beta1
kind: Ingress
  name: demo
  namespace: default
  annotations: demo-ki
  - http:
      - path: /foo
          serviceName: echo
          servicePort: 80 

After I applied that config, I expect the value of the service host is echo.internal.local. But it is not the same.

Two things:

  1. You need to put the annotation on the Service resource for this to work.
  2. You will still not see the the host property of Service change. You will see the host_header property of the corresponding Upstream change.

Thank you for your prompt reply.
I have tested by following your guide and it worked with two things you noted.