How to set/override host in kong ingress, which will set the host in kong services

I have a ingress as follows:

     apiVersion: extensions/v1beta1
     kind: Ingress
     metadata:
            name: sample-ingress
            namespace: sample
     spec:
       rules:
       - http:
           paths:
           - backend:
               serviceName: test
               servicePort: 80
             path: /test

This will create the entry for the service object in the database as below.
`{"host":"sample.test.80.svc","id":"6c66b65d-93bb-4927-9331-d95c02834ad6","protocol":"http","read_timeout":60000,"tls_verify_depth":null,"port":80,"updated_at":1605744279,"ca_certificates":null,"created_at":1605744279,"connect_timeout":60000,"write_timeout":60000,"name":"sample.test.80","retries":5,"path":"\/","tls_verify":null,"tags":["managed-by-ingress-controller"],"client_certificate":null}`

Here, host is configured with `sample.test.80.svc` rather than this, I want to forward the traffic to some other service. 

Service where request needs to be routed is as below:
     apiVersion: v1
     kind: Service
     metadata:
       name: test
       namespace: sample
     spec:
       externalName: foo.example.com
       sessionAffinity: None
       type: ExternalName

How can I achieve it? Thanks.

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ