KONG YAML configuration reference

Hi

I have a few doubts regarding the YAML configuration for a service.
Let me explain the scenario. Suppose that i have a flask application having two routes:

/user - For user related information
/products - For Products related information

The configuration that i have used for this is as defined below.

services:

  • name: flaskusers
    url: http://IP:PORT/users
    tags:

    • flaskAPI
      routes:
    • name: Flask-Users
      paths:
      • /users
  • name: flaskproducts
    url: http://IP:PORT/products
    tags:

    • flaskAPI
      routes:
    • name: Flask-Products
      paths:
      • /products

Can the above scenario be implemented by defining a single service only.
Please suggest if there are some better ways to implement this scenario. Any best practices please.

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

name: demo

spec:

rules:

  • http:

    paths:

    • path: /httpbin

      backend:

      serviceName: httpbin

      servicePort: 80

    • path: /echo

      backend:

      serviceName: echo

      servicePort: 80

curl -I $PROXY_IP/httpbin
curl -I $PROXY_IP/echo

see if helps

This is not Kubernetes Yaml. This is the kong definition yaml in DB less mode.

THis is kong ingress YAML .

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

name: demo

spec:

rules:

  • http:

    paths:

    • path: /httpbin

      backend:

      serviceName: httpbin

      servicePort: 80

    • path: /echo

      backend:

      serviceName: echo

      servicePort: 80

I have done … may be i misunderstood your questions .