- kubectl create secret generic app-secret --from-literal=s247_license_key=<your_s247_license_key> -n petclinic
Replace app-secret, <your_s247_license_key>, and namespace (petclinic) with the appropriate values.
Step 2:
Create an empty volume that will be used to copy the agent files during the InitContainers process.
Example:
- volumes:
- - name: s247agent
Step 3:
Include the following InitContainers command in your helm chart/deployment YAML file.
- initContainers:
- - name: agent-copy
- image: site24x7/apminsight-javaagent:latest
- imagePullPolicy: IfNotPresent
- command: ['cp', '-r', '/opt/site24x7/.', '/home/apm']
- volumeMounts:
- - name: s247agent
- mountPath: /home/apm
Step 4:
Mount the volume created in step 2 into your application container.
- containers:
- - name: petclinic
- image: petclinic:latest
- imagePullPolicy: IfNotPresent
- ports:
- - containerPort: 8080
- volumeMounts:
- - name: s247agent
- mountPath: /home/apm
Step 5:
Add the following environment variables to application containers.
Environment variable 1:
Name: S247_LICENSE_KEY
Value: s247_license_key from the secret added in step 1
Environment variable 2:
Name: JAVA_TOOL_OPTIONS
Value: "-javaagent:[mount/path]/apminsight-javaagent.jar -Dapminsight.application.name=[DesiredMonitorName]"