...
In the sample Yaml file below, we dynamically download the agent into a side car sidecar container to make it available to the JVM of our application container. We’re using the busybox
base image, which is lightweight and contains wget
and unzip
.
Code Block | ||
---|---|---|
| ||
spec: initContainers: - name: sealights-java-coverage-listener image: busybox:latest imagePullPolicy: IfNotPresent command: ["/bin/sh", "-c"] args: - | wget -nv -O /tmp/sealights-java-agents.zip https://agents.sealights.co/sealights-java/sealights-java-latest.zip; mkdir -p /sealights; unzip -j /tmp/sealights-java-agents.zip sl-test-listener.jar -d /sealights; volumeMounts: - mountPath: /sealights name: sealights-java-coverage-listener containers: - name: your-main-container # other container configurations env: - name: sl.tags value: k8s - name: sl.labId value: integ_test_microservices - name: JAVA_TOOL_OPTIONS value: -javaagent:/sealights/sl-test-listener.jar volumeMounts: - mountPath: /sealights name: sealights-java-coverage-listener volumes: - name: sealights-java-coverage-listener emptyDir: {} |
...