一、配置证书
1.1 创建证书secret
[root@k8smaster TSL]# kubectl create secret tls huhuhahei --key=private.key --cert=public.pem -n lnmp
secret/huhuhahei created
二 、配置Ingress
2.1 创建ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
spec:
tls:
- hosts:
- web.huhuhahei.cn
- secretName: huhuhahei
rules:
- host: web.huhuhahei.cn
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-php
port:
number: 80