dieunb
April 17, 2020, 12:02pm
#1
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 api.staging.example.com
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?
hbagdi
April 20, 2020, 9:09pm
#2
You can set upstream.host_header
in a KongIngress resource and then annotate your service using konghq.com/override
. This will change the host-header to the value you prefer.
dieunb
April 23, 2020, 7:16am
#3
@hbagdi
Let me show you my configuration:
---
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: demo-ki
namespace: default
upstream:
host_header: "echo.internal.local"
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo
namespace: default
annotations:
konghq.com/override: demo-ki
spec:
rules:
- http:
paths:
- path: /foo
backend:
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.
dieunb
April 25, 2020, 10:20am
#5
Thank you for your prompt reply.
I have tested by following your guide and it worked with two things you noted.