dockerfile
Some checks failed
全局K3s部署 / deploy (push) Has been cancelled

This commit is contained in:
2026-05-23 17:26:24 +08:00
parent 5e9553d43b
commit 5771e196f9
2 changed files with 50 additions and 6 deletions

44
deploy.yaml Normal file
View File

@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${APP_NAME}
namespace: default
labels:
app: ${APP_NAME}
spec:
replicas: 1
selector:
matchLabels:
app: ${APP_NAME}
template:
metadata:
labels:
app: ${APP_NAME}
spec:
containers:
- name: ${APP_NAME}
image: ${REGISTRY}/${APP_NAME}:${gitea.sha}
imagePullPolicy: Always
ports:
- containerPort: 80 # 你的项目实际端口比如前端80、后端8080
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
name: ${APP_NAME}-service
namespace: default
spec:
type: NodePort
selector:
app: ${APP_NAME}
ports:
- port: 80
targetPort: 80
nodePort: 30001 # 必须在30000-32767之间