Initial commit: k3s deployment configurations
This commit is contained in:
71
k3s/nav/nav-deploy.yaml
Normal file
71
k3s/nav/nav-deploy.yaml
Normal file
@@ -0,0 +1,71 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: homepage
|
||||
namespace: navigation
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: homepage
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: homepage
|
||||
spec:
|
||||
containers:
|
||||
- name: homepage
|
||||
image: ghcr.io/gethomepage/homepage:latest
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
# ▼▼▼ 关键动作:把 ConfigMap 挂载成文件 ▼▼▼
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /app/config # 容器里的配置目录
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: homepage-config # 引用上面的 ConfigMap
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: homepage-service
|
||||
namespace: navigation
|
||||
spec:
|
||||
selector:
|
||||
app: homepage
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 3000
|
||||
|
||||
---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: homepage-ingress
|
||||
namespace: navigation
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
# 开启这个可以允许跨域调用 (可选)
|
||||
nginx.ingress.kubernetes.io/enable-cors: "true"
|
||||
spec:
|
||||
rules:
|
||||
- host: nav.u9.net3w.com # <--- 您的新域名
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: homepage-service
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- nav.u9.net3w.com
|
||||
secretName: nav-tls-secret
|
||||
Reference in New Issue
Block a user