通过yaml文件实现微服务加入skywalking agent,能够容易管理skywalking agent版本,主要内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| spec: volumes: - name: skywalking-agent emptyDir: { } 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/" ] containers: - name: java image: xxxx volumeMounts: - name: skywalking-agent mountPath: /skywalking env: - name: JAVA_TOOL_OPTIONS value: "-javaagent:/skywalking/agent/skywalking-agent.jar" - name: SW_AGENT_NAME value: "xxxx" - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES value: "xx.xx.xx.xx:11800"
|