konghq.com/preserve-host: "true"
konghq.com/strip-path: "false"
konghq.com/plugins: cors-global # i created the plugin
konghq.com/protocols: "http,https"
konghq.com/https-redirect-status-code: "308"
konghq.com/strip-path: "false" — valid annotation, though "false" is the default behavior. [strip-path annotation]
konghq.com/plugins: cors-global — correct way to attach a KongPlugin resource for CORS. [plugins annotation]
konghq.com/https-redirect-status-code: "308" — valid value (acceptable values are 301, 302, 307, 308, 426). [https-redirect-status-code]
What needs fixing
1. SSL redirect protocol
The NGINX annotation nginx.ingress.kubernetes.io/ssl-redirect: "true" forces HTTPS-only traffic. In Kong, this is done by setting:
konghq.com/protocols: "https"
Setting konghq.com/protocols: "http,https" allows both HTTP and HTTPS, which does not enforce a redirect. To actually redirect HTTP to HTTPS (like the NGINX annotation does), you need "https" only. [configure HTTPS redirect]
2. CORS headers annotation
The NGINX annotation nginx.ingress.kubernetes.io/cors-allow-headers: "*" configures CORS at the ingress controller level. In Kong, CORS is handled entirely by the CORS KongPlugin resource you create — the plugin’s config (e.g., headers, origins, methods) is where you set those values. There is no direct annotation equivalent for CORS header configuration. Make sure your cors-global KongPlugin resource has the correct config fields set.
Corrected annotation block
metadata:
annotations:
kubernetes.io/ingress.class: kong-dmz # or use ingressClassName in spec (you already have it)
konghq.com/protocols: "https" # enforces HTTPS redirect
konghq.com/https-redirect-status-code: "308"
konghq.com/preserve-host: "true"
konghq.com/strip-path: "false"
konghq.com/plugins: cors-global
Note: Since you’re already using ingressClassName: kong-dmz in the spec, the kubernetes.io/ingress.class annotation may be redundant, but it’s worth keeping for compatibility depending on your KIC version. [ingress class annotation]