kubernetes - 在 GKE 入口云负载均衡器上强制 http 到 https
问题描述
如何在使用入口云负载均衡器时仅在 GKE 中强制 https 流量,是否有任何特殊注释或类似的东西来解决这个问题
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: example-oms-ingress
namespace: example-oms
annotations:
kubernetes.io/ingress.class: "gce"
kubernetes.io/ingress.global-static-ip-name: "example-gke-oms"
spec:
tls:
- hosts:
- oms-test-gke.example.com
secretName: test-example-tls
rules:
- host: oms-test-gke.example.com
http:
paths:
- path: /*
backend:
serviceName: example-oms-svc
servicePort: 80
- host: oms-test-gke.example.com
nginx入口控制器不在图片中
更新:
能够通过使用中提到的规则创建一个新的负载均衡器来解决
确保在创建新的 frwd lb 之前删除入口 LB 上的端口 80
解决方案
推荐阅读
- microsoft-graph-api - 如何使用 Microsoft Graph API (C#) 以编程方式配置个人网站 (OneDrive)
- elisp - 它在 find-file-hook 的变量中引用哪个文件
- c++ - 工具提示被限制为 80 个字符,甚至 setmaxtipwidth 为 32767
- ruby-on-rails - Rails 中 Json 数据的查找/搜索选项
- java - ?Android < API21 的属性/颜色
- c# - 如何选择所需的列?
- python - 如何将字典的键和值转换为数据框列?
- random - 区间全覆盖的随机序列发生器
- c# - 转换字典
通过异常“名称不能以'1'字符开头,十六进制值0x31。” - spring - 有什么方法可以在春季只为一种方法启用缓存?