Search code examples
kubernetestraefik-ingresskong-ingress

How to configure Sub Domain on Kong Ingress Controller


We are trying to replicate the existing Traefik configuration with Kong Ingress Controller on Kubernetes cluster.

Currently, I'm trying to configure the sub domain in Kong ingress controller and not sure how exactly to proceed with this.

Below code is from Traefik configuration. Could you please help me configure the similar in Kong.

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: application-xyz
  namespace: default
spec:
  tls: {}
  entryPoints:
    - web
    - websecure
  routes:
    - match: "HostRegexp(`{sub:(www.)?}mycompany.com`) && PathPrefix(`/`)"
      kind: Rule
      priority: 1
      services:
        - name: application-xyz-service
          port: 80

Thanks in Advance.


Solution

  • We have explored a bit and found there is no such feature available in kong. Traefik was a router and it was valid to have this kind of functionality available. We have just configured a couple of ingress rules for www and domain explicitly to achieve this on Kong.

    We can also make use of the Admin API available in Kong to achieve the same. The documentation is pretty straight forward on the official site.