From 4ff0d6c1b821be48c218075f6308d9962145a5e2 Mon Sep 17 00:00:00 2001 From: AceDataCloud Date: Sat, 14 Jan 2023 13:19:08 +0800 Subject: [PATCH] update --- .github/workflows/deploy-test.yaml | 2 +- deploy/test/deploy.sh | 1 - deploy/test/deployment.yaml | 20 ++++++++++---------- deploy/test/ingress.yaml | 4 ++-- deploy/test/scripts/deploy.sh | 3 +++ deploy/test/service.yaml | 6 +++--- docker-compose.yaml | 2 +- 7 files changed, 20 insertions(+), 18 deletions(-) delete mode 100644 deploy/test/deploy.sh create mode 100644 deploy/test/scripts/deploy.sh diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 15bcb7c7..9bbd8aa5 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -43,4 +43,4 @@ jobs: run: | docker-compose build docker-compose push - sh ./deploy/test/deploy.sh + sh ./deploy/test/scripts/deploy.sh diff --git a/deploy/test/deploy.sh b/deploy/test/deploy.sh deleted file mode 100644 index ec32e499..00000000 --- a/deploy/test/deploy.sh +++ /dev/null @@ -1 +0,0 @@ -cat deploy/test/deployment.yaml | sed 's/\${TAG}/'"$BUILD_NUMBER"'/g' | kubectl apply -f - || true \ No newline at end of file diff --git a/deploy/test/deployment.yaml b/deploy/test/deployment.yaml index b7a01eaa..3cea1b98 100644 --- a/deploy/test/deployment.yaml +++ b/deploy/test/deployment.yaml @@ -2,32 +2,32 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: zhishuyun-data-frontend - name: zhishuyun-data-frontend + app: data-frontend + name: data-frontend namespace: zhishuyun-test spec: replicas: 1 revisionHistoryLimit: 5 selector: matchLabels: - app: zhishuyun-data-frontend + app: data-frontend template: metadata: labels: - app: zhishuyun-data-frontend + app: data-frontend spec: containers: - - image: ghcr.io/zhishuyun/zhishuyun-data-frontend:${TAG} - name: zhishuyun-data-frontend + - image: ghcr.io/zhishuyun/data-frontend:${TAG} + name: data-frontend ports: - containerPort: 80 resources: requests: - memory: '200Mi' - cpu: '100m' + memory: '50Mi' + cpu: '20m' limits: - memory: '512Mi' - cpu: '200m' + memory: '100Mi' + cpu: '30m' imagePullSecrets: - name: docker-registry restartPolicy: Always diff --git a/deploy/test/ingress.yaml b/deploy/test/ingress.yaml index 92ccefa5..fdd009f0 100644 --- a/deploy/test/ingress.yaml +++ b/deploy/test/ingress.yaml @@ -1,7 +1,7 @@ apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: - name: ingress-zhishuyun-data-frontend + name: data-frontend namespace: zhishuyun-test annotations: kubernetes.io/ingress.class: 'nginx' @@ -17,6 +17,6 @@ spec: http: paths: - backend: - serviceName: zhishuyun-data-frontend + serviceName: data-frontend servicePort: 8083 path: / diff --git a/deploy/test/scripts/deploy.sh b/deploy/test/scripts/deploy.sh new file mode 100644 index 00000000..3d8cae8b --- /dev/null +++ b/deploy/test/scripts/deploy.sh @@ -0,0 +1,3 @@ +cat deploy/test/deployment.yaml | sed 's/\${TAG}/'"$BUILD_NUMBER"'/g' | kubectl apply -f - || true +kubectl apply -f deploy/test/service.yaml +kubectl apply -f deploy/test/ingress.yaml \ No newline at end of file diff --git a/deploy/test/service.yaml b/deploy/test/service.yaml index a9630889..bc59275f 100644 --- a/deploy/test/service.yaml +++ b/deploy/test/service.yaml @@ -2,8 +2,8 @@ apiVersion: v1 kind: Service metadata: labels: - app: zhishuyun-data-frontend - name: zhishuyun-data-frontend + app: data-frontend + name: data-frontend namespace: zhishuyun-test spec: ports: @@ -11,4 +11,4 @@ spec: port: 8083 targetPort: 80 selector: - app: zhishuyun-data-frontend + app: data-frontend diff --git a/docker-compose.yaml b/docker-compose.yaml index 47b086fd..6a437aeb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,6 +3,6 @@ services: zhishuyun-data-frontend: container_name: 'zhishuyun-data-frontend' build: ./ - image: 'ghcr.io/zhishuyun/zhishuyun-data-frontend:${BUILD_NUMBER}' + image: 'ghcr.io/zhishuyun/data-frontend:${BUILD_NUMBER}' ports: - '8086:80'