From f609e1132caa904b8baeec8ba62714e1d0d8d995 Mon Sep 17 00:00:00 2001 From: wulin Date: Wed, 15 Nov 2023 14:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8Ddeploy=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/modules/user/deploy/deploy.yaml | 27 +++++++++++++++------ docker/modules/websocket/deploy/deploy.yaml | 10 +++----- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/docker/modules/user/deploy/deploy.yaml b/docker/modules/user/deploy/deploy.yaml index bea865a..f2b115b 100644 --- a/docker/modules/user/deploy/deploy.yaml +++ b/docker/modules/user/deploy/deploy.yaml @@ -21,10 +21,25 @@ spec: labels: app: iot-box-user-api spec: + initContainers: + - name: agent-container + image: apache/skywalking-java-agent:8.7.0-alpine + volumeMounts: + - name: skywalking-agent + mountPath: /agent + command: [ "/bin/sh" ] + args: [ "-c", "cp -R /skywalking/agent /agent/" ] imagePullSecrets: - name: aliyun-hub-register #提前在项目下配置访问阿里云的账号密码 containers: - - image: $REGISTRY/$DOCKERHUB_NAMESPACE/qiuguo-iot:iot-box-user-api-SNAPSHOT-v$BUILD_NUMBER + - image: $REGISTRY/$DOCKERHUB_NAMESPACE/qiuguo-iot:iot-box-user-api-test-v$BUILD_NUMBER + env: + - name: JAVA_TOOL_OPTIONS + value: "-javaagent:/skywalking/agent/skywalking-agent.jar" + - name: SW_AGENT_NAME + value: "iot-box-user-api" + - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES + value: "skywalking-oap.skywalking:11800" readinessProbe: httpGet: path: /actuator/health @@ -45,9 +60,8 @@ spec: volumeMounts: - mountPath: /home/qiuguo/logs name: iot-logs - - name: host-time - readOnly: true - mountPath: /etc/localtime + - name: skywalking-agent + mountPath: /skywalking terminationMessagePath: /nfs/data/qiuguo/iot/logs terminationMessagePolicy: File dnsPolicy: ClusterFirst @@ -57,9 +71,8 @@ spec: - name: iot-logs hostPath: path: /nfs/data/qiuguo/iot/logs - - name: host-time - hostPath: - path: /etc/localtime + - name: skywalking-agent + emptyDir: { } --- apiVersion: v1 kind: Service diff --git a/docker/modules/websocket/deploy/deploy.yaml b/docker/modules/websocket/deploy/deploy.yaml index 7a0a58f..dddc506 100644 --- a/docker/modules/websocket/deploy/deploy.yaml +++ b/docker/modules/websocket/deploy/deploy.yaml @@ -24,7 +24,7 @@ spec: imagePullSecrets: - name: aliyun-hub-register #提前在项目下配置访问阿里云的账号密码 containers: - - image: $REGISTRY/$DOCKERHUB_NAMESPACE/qiuguo-iot:iot-box-websocket-api-SNAPSHOT-v$BUILD_NUMBER + - image: $REGISTRY/$DOCKERHUB_NAMESPACE/qiuguo-iot:iot-box-websocket-api-SNAPSHOT-v1.0.0 readinessProbe: httpGet: path: /actuator/health @@ -39,15 +39,14 @@ spec: protocol: TCP resources: requests: #资源请求的设置 + cpu: 0m #Cpu请求,容器启动的初始可用数量 memory: 600Mi #内存清楚,容器启动的初始可用数量 limits: + cpu: 80m memory: 600Mi volumeMounts: - mountPath: /home/qiuguo/logs name: iot-logs - - name: host-time - readOnly: true - mountPath: /etc/localtime terminationMessagePath: /nfs/data/qiuguo/iot/logs terminationMessagePolicy: File dnsPolicy: ClusterFirst @@ -57,9 +56,6 @@ spec: - name: iot-logs hostPath: path: /nfs/data/qiuguo/iot/logs - - name: host-time - hostPath: - path: /etc/localtime --- apiVersion: v1 kind: Service