Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kong Ingress Controller Chart] Deploy multiple kong instances and customize the controllerName of GatewayClass. #1079

Closed
xiaoronglv opened this issue Jun 7, 2024 · 4 comments

Comments

@xiaoronglv
Copy link

xiaoronglv commented Jun 7, 2024

Hi Kong Engineers,

Good day!

I would like to deploy two Kong Gateway Instances to an AWS Kubernetes Cluster (EKS):

  1. Public Kong API Gateway
  2. Internal Kong API Gateway

Install the first Kong Gateway Instance

Kong provides excellent documentation on how to install the Kong Ingress Controller using Helm. The deployment of my public API gateway was very smooth.

Here is the values.yaml file used:

gateway:
  proxy:
    http:
      enabled: true
    tls:
      overrideServiceTargetPort: 8000
    annotations:
      external-dns.alpha.kubernetes.io/aws-zone-type-public: true
      external-dns.alpha.kubernetes.io/hostname: "gateway-kong.example.com"
      service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
      service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing" #  👈
      service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-west-2:****"
      service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
  autoscaling:
    enabled: true

Here is the command to install the public API gateway:

helm install kong kong/ingress -n kong --values ./values.yml --create-namespace

After installation, I defined the GatewayClass with the default controllerName konghq.com/kic-gateway-controller:

apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
 name: kong
 annotations:
   konghq.com/gatewayclass-unmanaged: 'true'
spec:
 controllerName: konghq.com/kic-gateway-controller #  👈

Everything works fine

Install second Kong Gateway Instance

After installing the public kong gateway, I started to install the second kong gateway instance as the internal API gateway instance. I need to specify a new controllerName: konghq.com/kic-gateway-controller-private. Then I could reference the controllerName when define the GatewayClass for internal purpose.

apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: kong
  annotations:
    konghq.com/gatewayclass-unmanaged: 'true'

spec:
  controllerName: konghq.com/kic-gateway-controller-internal  #  👈

However, I couldn't find any values.yaml example in the codebase that illustrates how to customize the controllerName for the gateway class, which is crucial for deploying multiple Kong gateway instances.

The documentation "Using Custom Classes to split Internal/External traffic" seems stale and the parameter controller.ingressController.ingressClass recommend by the documentation seems not working.

Question

  1. How to customize the controllerName of GatwayClass in the values.yaml when using the kong ingress controller chart?

  2. could you please provide a values.yaml example in this examples folder?

Thank you!

Reference

  1. Github: Kong / Charts / charts / ingress / example-values
  2. Using Custom Classes to split Internal/External traffic
  3. Github Issues: Document how to support multiple GatewayClass instances
@xiaoronglv xiaoronglv changed the title [Kong Ingress Controller] Deploy multiple kong instances and specify the controllerName of GatewayClass. [Kong Ingress Controller] Deploy multiple kong instances and customize the controllerName of GatewayClass. Jun 7, 2024
@xiaoronglv xiaoronglv changed the title [Kong Ingress Controller] Deploy multiple kong instances and customize the controllerName of GatewayClass. [Kong Ingress Controller Chart] Deploy multiple kong instances and customize the controllerName of GatewayClass. Jun 7, 2024
@xiaoronglv
Copy link
Author

@czeslavo

Could you please take a look when you get the time?

when installing the kong though helm, how to specify the gateway-api-controller-name ?

@pmalek
Copy link
Member

pmalek commented Jun 12, 2024

@xiaoronglv when using the ingress chart you should be able to do that via

gateway:
  proxy:
    ... my values

controller:
  ingressController:
    env:
      gateway_api_controller_name: name

@pmalek
Copy link
Member

pmalek commented Jun 20, 2024

@xiaoronglv I'm going to close this one. If there's still something you'd like us to look at, don't hesitate to write.

@pmalek pmalek closed this as completed Jun 20, 2024
@xiaoronglv
Copy link
Author

Thank you, @pmalek !

Your solutions works really well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants