insecure.action: Redirect
在主机应该是Route
此外,需要创建自定义健康检查:
kind: BackendConfig
metadata:
name: my-backendconfig
spec:
healthCheck:
checkIntervalSec: 10
timeoutSec: 10
healthyThreshold: 2
unhealthyThreshold: 2
type: HTTP
requestPath: /ambassador/v0/check_ready
port: 8080
并添加到ambassador.yaml
kind: Service
metadata:
name: ambassador
annotations:
cloud.google.com/backend-config: '{"ports": {"8080":"my-backendconfig"}}'
spec:
type: NodePort
ports:
- name: http
port: 8080
targetPort: 8080
selector:
service: ambassador
Ingress 应该禁用 http:
kind: Ingress
metadata:
name: basic-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "myip"
kubernetes.io/ingress.allow-http: "false"
spec:
tls:
- secretName: my-self-managed-cert
backend:
serviceName: ambassador
servicePort: 8080
这将只创建 HTTPS LB,它可以完美地工作,现在我们需要 http -> https 重定向。
只需转到负载平衡屏幕并再创建 1 个负载平衡器(无后端),它只会将 http 重定向到 https。