环境信息:
K3s 版本:
k3s version v1.21.11+k3s1 (4eb3a488)
go version go1.16.10
节点 CPU 架构、操作系统和版本::
Linux myth3year 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
集群配置:
单节点
问题描述:
复现步骤:
- 安装 K3s 的命令:
INSTALL_K3S_SKIP_DOWNLOAD=true
INSTALL_K3S_EXEC="–service-node-port-range=63888-64888"
/opt/k3s/install.sh
预期结果:
配置了 SSL证书(阿里云的)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-web-ingress
annotations:
kubernetes.io/ingress.class: "traefik"
# nginx.ingress.kubernetes.io/ssl-redirect: "true"
traefik.ingress.kubernetes.io/redirect-entry-point: https
# traefik.ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- hosts:
- "nginx.xxx.cn"
secretName: nginx-tls
rules:
- host: "nginx.xxx.cn"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-web
port:
number: 80
可以通过http://nginx.xxx.cn 访问.
可以 https://nginx.xxx.cn
我希望http强制跳转https
实际结果:
强制跳转 http → https 未实现
求大佬指导…找了好久没找到相关的
附加上下文/日志: