创建证书secret
kubectl create secret tls lavatest-tls-secret --cert=/root/6694248.com.key --key=/root/6694248com.pem -n test
创建ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-web
namespace: test
annotations:
# 指定Ingress Controller的类型
kubernetes.io/ingress.class: "nginx"
spec:
tls:
- hosts:
- www.baidu.com
secretName: tls-secret-mobile
rules:
- host: www.baidu.com
http:
禁用ssl强制跳转
annotations:标签:tls,ingress,nginx,ssl,secret,io,跳转 From: https://blog.51cto.com/yht1990/5887758
nginx.ingress.kubernetes.io/use-regex: "true"