我这里使用阿里云的官方免费证书,大家可以到阿里云进行申请
1.申请证书
2.申请成功后下载证书并上传到服务器
kubectl describe secret tls-secret
3.执行创建secret的命令
kubectl create secret tls tls-secret --cert=/k3s/secret/6812999_www.appliedatax.com.pem --key=/k3s/secret/6812999_www.appliedatax.com.key
4.查看状态
kubectl describe secret tls-secret
5.配置Ingress
spec: tls: - hosts: - appliedatax.com secretName: tls-secret rules: - host: appliedatax.com http: paths: - path: / pathType: ImplementationSpecific backend: serviceName: mynginx-service servicePort: 80
6.测试