Hi,
I am Trying to set my routes by the kong-ingress controller. Following is my deployment file. I am able to set the routes but when I get the service there path is coming as ‘/’ and port ‘80’ but I want to setup a path(Custom path) and port (Custom port) in service according to my requirement (Shared below).
apiVersion: v1
kind: Service
metadata:
labels:
app: dummyservice
name: dummyservice
spec:
ports:
- port: 8010
protocol: TCP
targetPort: 8010
selector:
app: dummyservice
sessionAffinity: None
type: ClusterIP
---
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: dummyservice-login
proxy:
protocols:
- http
- https
path: /admin/auth/login
route:
methods:
- POST
- GET
strip_path: true
preserve_host: false
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: dummyservice-login
spec:
rules:
- host: dummyservice.default.svc.cluster.local
http:
paths:
- path: /admin/api/v1/dummyservice/login
backend:
serviceName: dummyservice
servicePort: 8010
I am getting following output for /routes
{
"updated_at": 1556513571,
"created_at": 1556513571,
"strip_path": true,
"snis": null,
"hosts": [
"dummyservice.default.svc.cluster.local"
],
"name": "default.admin-login.00",
"methods": [
"POST",
"GET"
],
"sources": null,
"preserve_host": true,
"regex_priority": 0,
"service": {
"id": "95ec1b26-6ff0-4166-a95c-2cd798c94a4a"
},
"paths": [
"/admin/api/v1/dummyservice/login"
],
"destinations": null,
"id": "ceb3a3e2-04f5-4069-bd95-860395ea4c4d",
"protocols": [
"http",
"https"
],
"tags": null
for /service
{
"host": "dummyservice.default.svc",
"created_at": 1556513570,
"connect_timeout": 60000,
"id": "95ec1b26-6ff0-4166-a95c-2cd798c94a4a",
"protocol": "http",
"name": "default.authservice.8010",
"read_timeout": 60000,
"port": 80,
"path": "/",
"updated_at": 1556513570,
"retries": 5,
"write_timeout": 60000,
"tags": null
}
But my desired output for service is -
{
"host": "dummyservice.default.svc",
"created_at": 1556513570,
"connect_timeout": 60000,
"id": "95ec1b26-6ff0-4166-a95c-2cd798c94a4a",
"protocol": "http",
"name": "default.authservice.8010",
"read_timeout": 60000,
"port": 8010,
"path": " /admin/auth/login",
"updated_at": 1556513570,
"retries": 5,
"write_timeout": 60000,
"tags": null
}