kezhenxu94 commented on a change in pull request #14:
URL: https://github.com/apache/skywalking-showcase/pull/14#discussion_r775437305



##########
File path: deploy/platform/kubernetes/feature-agent/resources.yaml
##########
@@ -88,14 +97,23 @@ spec:
   template:
     metadata:
       labels:
+        # @feature: java-agent-injector; enable the java agent injector
+        swck-java-agent-injected: "true"
         app: songs
       annotations:
         sidecar.istio.io/inject: "${AGENTLESS}"
+        # @feature: java-agent-injector; set the java agent configuration
+        strategy.skywalking.apache.org/inject.Container: "songs"
+        strategy.skywalking.apache.org/agent.Overlay: "true"
+        agent.skywalking.apache.org/agent.service_name: "agent::songs"
     spec:
       containers:
         - name: songs
           image: ${HUB}/songs-service:${TAG}
           imagePullPolicy: Always
+          command: ["java"]
+          # @feature: java-agent-injector; we need to add $(AGENT_OPTS) to 
enable the injected configuration 
+          args: ${JAVA_AGENT}

Review comment:
       > Now the injector is using the 
[way](https://skywalking.apache.org/docs/skywalking-java/latest/en/setup/service-agent/java-agent/setting-override/#agent-options)
 to inject. I don't know much about java, can it be used as an environment 
variable? if possible, then we don’t need to add it to the startup parameters.
   
   @dashanji yes, take a look at this 
https://github.com/apache/skywalking-java/blob/96ea77cf8f1fa922ed4f1e8c4bf9796e33790bdf/Dockerfile#L31
 , this env var is automatically picked up by JVM and it's the same effect as 
`java $JAVA_TOOL_OPTIONS /app.jar` for all Java applications in that container




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to