首次提交:初始化项目
This commit is contained in:
31
002-infra/002-wordpress/03-ingress.yaml
Normal file
31
002-infra/002-wordpress/03-ingress.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
# 03-ingress.yaml
|
||||
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: wordpress-ingress
|
||||
namespace: demo-space
|
||||
annotations:
|
||||
# ▼▼▼ 关键注解:我要申请证书 ▼▼▼
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
# ▼▼▼ Traefik sticky session 配置 ▼▼▼
|
||||
traefik.ingress.kubernetes.io/affinity: "true"
|
||||
traefik.ingress.kubernetes.io/session-cookie-name: "wordpress-session"
|
||||
spec:
|
||||
rules:
|
||||
- host: blog.u6.net3w.com # 您的域名
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: wordpress-service
|
||||
port:
|
||||
number: 80
|
||||
# ▼▼▼ 关键配置:证书存放在这个 Secret 里 ▼▼▼
|
||||
tls:
|
||||
- hosts:
|
||||
- blog.u6.net3w.com
|
||||
secretName: blog-tls-secret # K3s 会自动创建这个 secret 并填入证书
|
||||
Reference in New Issue
Block a user