HTTPS redirection for Ingress resources in multiple namespaces

Hi All,

I am facing an issues with ‘HTTPS redirect using KongIngress’ for applications running in different namespaces. Below I have shared the relevant configurations of KongIngress resource. Despite I am using ’ configuration.konghq.com: “https-only” annotation for the application’s Ingress resource in a different name space, I can still access the API with HTTP protocol. But if the application is running in the same namespace as KongIngress, then this HTTPS only feature get applied properly.

echo "
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: https-only
route:
protocols:

  • https
    https_redirect_status_code: 302
    " | oc apply -f -

Can you help me point to any missing configurations or the relevant component that can be used to enable HTTPS only requests for selected Ingress resources in different namespaces.

Thanks!

Please create KongIngress resource in the same namespace as your Ingress resource.

@hbagdi,

Appreciate your feedback. But that doesn’t seem to be a viable option for my use case as I am having large number of micro services distributed across number of different name spaces. Then I will need to maintain the same KongIngress resource copy in each of those namespaces. So definitely it is the not the most convenient way to configure it.

  1. Is there any way to use a single KongIngress resource to cater selected Ingress resources in different namespaces ?

  2. If this feature is not available, will there be a similar feature coming in the near future?

  3. If the only available option is to create KongIngress for each of the namespaces, then what is your recommendation to manage this single copy of KongIngress resource in multiple namespaces ?

Thanks!

You can use annotations on Ingress resource as well: