add: 添加 k8s deployment.yaml,dev 用 apply

This commit is contained in:
Agent
2026-03-23 13:13:14 +00:00
parent 8d1d677a33
commit 1368b13488
2 changed files with 36 additions and 2 deletions

View File

@@ -44,8 +44,7 @@ steps:
cluster: kubernetes
namespace: drone
commands:
- kubectl -n drone set image deployment/todo-backend todo-backend=ccr.ccs.tencentyun.com/violin/todo-backend:${DRONE_COMMIT_SHA:0:8}
- kubectl -n drone rollout status deployment/todo-backend
- kubectl apply -f k8s/deployment.yaml
---
kind: pipeline

35
k8s/deployment.yaml Normal file
View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-backend
namespace: drone
labels:
app: todo-backend
spec:
replicas: 1
selector:
matchLabels:
app: todo-backend
template:
metadata:
labels:
app: todo-backend
spec:
containers:
- name: todo-backend
image: ccr.ccs.tencentyun.com/violin/todo-backend:latest
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: todo-backend
namespace: drone
spec:
selector:
app: todo-backend
ports:
- port: 80
targetPort: 8080
type: ClusterIP