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