Dynatrace | Pod Runtime Injection for Application Only Monitoring on Kubernetes

Pre-requisites

generate PaaS token for runtime pod injection application-only monitoring
# your application containers
containers:
- name: customer-app
image: tomcat
env:
- name: LD_PRELOAD
value: /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
volumeMounts:
- mountPath: /opt/dynatrace/oneagent
name: oneagent
volumes:
- name: oneagent
emptyDir: {}


# initcontainer to download OneAgent
initContainers:
- name: install-oneagent
image: alpine:latest
command:
- /bin/sh
args:
- -c
- ARCHIVE=$(mktemp) && wget -O $ARCHIVE "$DT_API_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT_PAAS_TOKEN&$DT_ONEAGENT_OPTIONS" && unzip -o -d /opt/dynatrace/oneagent $ARCHIVE && rm -f $ARCHIVE
env:
- name: DT_API_URL
value: https://<Your-environment-ID>.live.dynatrace.com/api
- name: DT_PAAS_TOKEN
value: <paastoken>
- name: DT_ONEAGENT_OPTIONS
value: flavor=<FLAVOR>&include=<TECHNOLOGY>
volumeMounts:
- mountPath: /opt/dynatrace/oneagent
name: oneagent
  #here in your environment variables add these lines.        env:
- name: LD_PRELOAD
value: /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
# in volumeMounts add these lines below volumeMounts:
- mountPath: /opt/dynatrace/oneagent
name: oneagent
# in volumes add the below lines, remember we already created oneagent volume volumes:
- name: oneagent
emptyDir: {}
#here in the image alpine:latest is being pulled from docker.io, if you are using private repo then follow the below steps
# docker pull alpine:latest
# docker tag alpine:latest your-repo/alpine:latest
# doker push your-repo/alpine:latest
# Now, replace the value in image key below with your image-> your-repo/alpine:latest
initContainers:
- name: install-oneagent
image: alpine:latest
command:
- /bin/sh
# if your dynatrace url certificate is expired or not supported the use --no-check-certificate in wget command below args:
- -c
- ARCHIVE=$(mktemp) && wget -O $ARCHIVE "$DT_API_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT_PAAS_TOKEN&$DT_ONEAGENT_OPTIONS" && unzip -o -d /opt/dynatrace/oneagent $ARCHIVE && rm -f $ARCHIVE
# here, below give the correct url of your dyntrace portal- DT_API_URL
# give the passtoken you generated in pre-requisite step - DT_PAAS_TOKEN
# for DT_ONEAGENT_OPTIONS, you have to pick correct value depending upon your application
# valid values for flavor -> default, musl, multidistro
# default if for glibc, musl is for musl binaries, multidistro is for both, if you don't know what to use go with multidistro, but mostly in corporate environment default option will work.
# valid values for technology -> all, java, apache, nginx, nodejs, dotnet, php, go, and sdk
# if you don't know what to use then go ahead with all. The size of the file will be larger though
#If you want to specify several code modules, use the following syntax: &include=technology1&include=technology2
env:
- name: DT_API_URL
value: https://<Your-environment-ID>.live.dynatrace.com/api
- name: DT_PAAS_TOKEN
value: <paastoken>
- name: DT_ONEAGENT_OPTIONS
value: flavor=<FLAVOR>&include=<TECHNOLOGY>
volumeMounts:
- mountPath: /opt/dynatrace/oneagent
name: oneagent

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store