add: 添加 k8s deployment.yaml,dev 用 apply
This commit is contained in:
@@ -44,8 +44,7 @@ steps:
|
|||||||
cluster: kubernetes
|
cluster: kubernetes
|
||||||
namespace: drone
|
namespace: drone
|
||||||
commands:
|
commands:
|
||||||
- kubectl -n drone set image deployment/todo-backend todo-backend=ccr.ccs.tencentyun.com/violin/todo-backend:${DRONE_COMMIT_SHA:0:8}
|
- kubectl apply -f k8s/deployment.yaml
|
||||||
- kubectl -n drone rollout status deployment/todo-backend
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
|||||||
35
k8s/deployment.yaml
Normal file
35
k8s/deployment.yaml
Normal 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
|
||||||
Reference in New Issue
Block a user