From a3f4ea5af7fd7ddfdce2ea7fa653c952d2ec7b59 Mon Sep 17 00:00:00 2001 From: clay <20932067@zju.edu.cn> Date: Wed, 1 Nov 2023 02:57:12 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'deployment.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployment.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 deployment.yml diff --git a/deployment.yml b/deployment.yml new file mode 100644 index 0000000..7869fe9 --- /dev/null +++ b/deployment.yml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Service +metadata: + name: $DRONE_REPO_NAME +spec: + type: ClusterIP + ports: + - protocol: TCP + port: 80 + targetPort: 80 + selector: + app: $DRONE_REPO_NAME + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: $DRONE_REPO_NAME +spec: + replicas: 1 + selector: + matchLabels: + app: $DRONE_REPO_NAME + template: + metadata: + labels: + app: $DRONE_REPO_NAME + spec: + imagePullSecrets: + - name: harbor + containers: + - image: $REGISTRY/$REGISTRY_NAMESPACE/$DRONE_REPO_NAME:$DRONE_COMMIT + name: $DRONE_REPO_NAME + imagePullPolicy: Always + env: + - name: TIME_ZONE + value: Asia/Shanghai + - name: REF_NAME + value: dev + resources: + requests: + memory: 0.1Gi + cpu: 0.1 + limits: + memory: 2Gi + cpu: 2 + ports: + - containerPort: 8080 + name: app-port \ No newline at end of file