Add the Init Container to the Deployment Spec

Edit the deployment spec to add the required sections that allow you to copy the agent binaries from the init container to the application image.

The following snippet from a deployment spec shows the required volumes, volumeMounts, and initContainer definitions. The code example assumes the Java application image is published to myrepo/java-app:v1 and the init container image uses the pre-built image docker.io/appdynamics/java-agent:20.6.0:

kind: Deployment
      spec:
      containers:
      - name: java-app
      image: myrepo/java-app:v1
      volumeMounts:
      - mountPath: /opt/appdynamics
      name: appd-agent-repo
      initContainers:
      - command:
      - cp
      - -r
      - /opt/appdynamics/.
      - /opt/temp
      name: appd-agent
      image: docker.io/appdynamics/java-agent:20.8.0
      volumeMounts:
      - mountPath: /opt/temp
      name: appd-agent-repo
      volumes:
      - name: appd-agent-repo
      emptyDir: {}