1、创建secret导入tls证书
kubectl create secret tls cnbugs-com-https --key cnbugs.com.key --cert cnbugs.com.crt -n prod
2、创建service
apiVersion: v1
kind: Service
metadata:
name: mindoc-service
spec:
selector:
app: mindoc
type: ClusterIP
ports:
- protocol: TCP
port: 80
targetPort: 8181
3、创建ingress https
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mindoc-https
spec:
ingressClassName: nginx
tls:
- hosts:
- doc.cnbugs.com
secretName: cnbugs-com-https
rules:
- host: doc.cnbugs.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mindoc-service
port:
number: 80
文档更新时间: 2023-03-09 09:31 作者:admin