如何在 istio ingress gateway 中配置以下 nginx 注解

问题描述 投票:0回答:1

如何在 istio ingress gateway 中添加以下 ssl-redirect 配置

 nginx.ingress.kubernetes.io/ssl-redirect: "false"
 nginx.ingress.kubernertes.io/force-ssl-redirect: "false"

istio gateway 中是否有任何注释或 envoy 过滤器上需要进行任何其他配置以使 ssl 重定向为 false?

kubernetes istio istio-gateway istio-sidecar servicemesh
1个回答
0
投票

istio 中的选项之一是在网关定义中将“httpsRedirect”属性指定为 false,这将停止重定向。

以下是示例定义。更多详细信息请参阅 istio 文档

apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: my-gateway
  namespace: some-config-namespace
spec:
  selector:
    app: my-gateway-controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - uk.bookinfo.com
    - eu.bookinfo.com
    tls:
      httpsRedirect: true # sends 301 redirect for http requests
  - port:
      number: 443
      name: https-443
      protocol: HTTPS
    hosts:
    - uk.bookinfo.com
    - eu.bookinfo.com
    tls:
      mode: SIMPLE # enables HTTPS on this port
      serverCertificate: /etc/certs/servercert.pem
      privateKey: /etc/certs/privatekey.pem
  - port:
      number: 9443
      name: https-9443
      protocol: HTTPS
    hosts:
    - "bookinfo-namespace/*.bookinfo.com"
    tls:
      mode: SIMPLE # enables HTTPS on this port
      credentialName: bookinfo-secret # fetches certs from Kubernetes secret
© www.soinside.com 2019 - 2024. All rights reserved.