qy-html-project/k8s/deployment.yaml
zyc 1ab9e67f21
Some checks failed
Deploy Static Sites / deploy (push) Failing after 1s
init: 静态站点部署配置 + cyberstar 项目
- Gitea CI 自动 rsync 到服务器
- K8S Nginx 按子域名路由到对应项目目录
- cyberstar 首个项目
2026-04-08 17:56:59 +08:00

56 lines
1.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: static-sites
labels:
app: static-sites
spec:
replicas: 1
selector:
matchLabels:
app: static-sites
template:
metadata:
labels:
app: static-sites
spec:
containers:
- name: nginx
image: nginx:alpine
ports:
- containerPort: 80
volumeMounts:
- name: sites-data
mountPath: /usr/share/nginx/html
readOnly: true
- name: nginx-conf
mountPath: /etc/nginx/conf.d
readOnly: true
resources:
requests:
memory: "32Mi"
cpu: "25m"
limits:
memory: "128Mi"
cpu: "100m"
volumes:
- name: sites-data
hostPath:
path: /data/static-sites
type: DirectoryOrCreate
- name: nginx-conf
configMap:
name: static-sites-nginx-conf
---
apiVersion: v1
kind: Service
metadata:
name: static-sites
spec:
selector:
app: static-sites
ports:
- protocol: TCP
port: 80
targetPort: 80