ingress的扩展有好多种,现举例nginx和kong的ingress

对于nginx ingress,强跳https的配置为

nginx.ingress.kubernetes.io/force-ssl-redirect:true

从对于kong ingress,强跳https的配置为

kong.ingress.kubernetes.io/force-ssl-redirect:true
konghq.com/override:https-only
konghq.com/protocol:https
kubernetes.io/ingress.allow-http:false

如果是kong ingress,强跳还需要配置kongIngress为https 

apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
    name: https-only
    namespace: kubernetes-dashboard
route:
  protocols:
  - https
  https_redirect_status_code: 302

Logo

开源、云原生的融合云平台

更多推荐