Initial commit: k3s deployment configurations
This commit is contained in:
30
k3s/my-blog/fd_反代3100/external-app.yaml
Normal file
30
k3s/my-blog/fd_反代3100/external-app.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
# 1. 定义一个“虚假”的服务,作为 K8s 内部的入口
|
||||
#
|
||||
|
||||
# external-app.yaml (修正版)
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: host-app-service
|
||||
namespace: demo-space
|
||||
spec:
|
||||
ports:
|
||||
- name: http # <--- Service 这里叫 http
|
||||
protocol: TCP
|
||||
port: 80
|
||||
targetPort: 3100
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Endpoints
|
||||
metadata:
|
||||
name: host-app-service
|
||||
namespace: demo-space
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 85.137.244.98
|
||||
ports:
|
||||
- port: 3100
|
||||
name: http # <--- 【关键修改】这里必须也叫 http,才能配对成功!
|
||||
25
k3s/my-blog/fd_反代3100/external-ingress.yaml
Normal file
25
k3s/my-blog/fd_反代3100/external-ingress.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: host-app-ingress
|
||||
namespace: demo-space
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
# ▼▼▼ 核心修复:添加这一行 ▼▼▼
|
||||
ingress.kubernetes.io/custom-response-headers: "Content-Security-Policy: upgrade-insecure-requests"
|
||||
spec:
|
||||
rules:
|
||||
- host: wt.u9.net3w.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: host-app-service
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- wt.u9.net3w.com
|
||||
secretName: wt-tls-secret
|
||||
Reference in New Issue
Block a user