<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Container issues and initial information gathering in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/Container-issues-and-initial-information-gathering/ta-p/207469</link>
    <description>&lt;H1&gt;Initial information gathering commands&lt;/H1&gt;
&lt;P&gt;These will help describe Dynatrace entities and their status, also can help gather the Dynakube Custom Resource if the location of the yaml used to apply it isn't known. Also including some basic exec commands to get into pods&lt;/P&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG data-stringify-type="bold"&gt;Kubernetes commands:&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;kubectl get all -n dynatrace
kubectl describe all -n dynatrace
kubectl get events -n dynatrace --sort-by=.metadata.creationTimestamp
kubectl describe nodes
kubectl get dynakube -n dynatrace -o yaml&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;init container logs (app only/cloudnative):&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl logs frontend-79db8fc578-48qxh -c install-oneagent&lt;/CODE&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;&lt;/CODE&gt;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG data-stringify-type="bold"&gt;OpenShift Commands:&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;oc get all -n dynatrace
oc describe all -n dynatrace
oc get events -n dynatrace --sort-by=.metadata.creationTimestamp
oc describe nodes
oc get dynakube -n dynatrace -o yaml&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG&gt;Generic 1st response commands&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;kubectl get all -n dynatrace
kubectl describe all -n dynatrace
kubectl get events -n dynatrace --sort-by=.metadata.creationTimestamp
kubectl logs -n dynatrace nameofdynatracepods (this is good for oneagent pods and csi pods)
kubectl describe nodes
kubectl get dynakube -n dynatrace -o yaml&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG data-stringify-type="bold"&gt;Exec into pods&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;kubectl logs oneagent-pod
kubectl exec oneagentPodname -n dynatrace -it – sh
kubectl exec oneagentPodname -n dynatrace -it –- /bin/bash
chroot /mnt/host_root /bin/bash&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG data-stringify-type="bold"&gt;cloudNativeFullStack injection issues&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;These labels are subject to change and this information might not be the most up to date source for this.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Quick rundown of how the Webhook pod does the container injections while we have the Dynatrace Operator running in CloudNativeFullStack:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The install of the webhook should lead to all namespaces (with dynatrace operator deployed NS along with anything kube- or openshift- starting) to be applied with the label:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;&lt;A class="c-link" href="http://dynakube.internal.dynatrace.com/instance" target="_blank" rel="noopener noreferrer" data-stringify-link="http://dynakube.internal.dynatrace.com/instance" data-sk="tooltip_parent"&gt;dynakube.internal.dynatrace.com/instance&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As long as that label is on the namespace that the app pods are starting in, check it with kubectl describe appNamespace , then you should be seeing pod injections on that kind of container.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can see if a pod was seen by the webhook for injection or not consideration by checking its logs with these two steps:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Gather pod UID for next command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl get pods -n &amp;lt;namespace&amp;gt; &amp;lt;pod-name&amp;gt; -o jsonpath='{.metadata.uid}'&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Use Pod UID to search all webhook pod logs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl logs &amp;lt;webhook pod name&amp;gt; -n dynatrace | grep &amp;lt;UID of the pod that was launched&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And Further validation on if a pod was injected into by the webhook or not can be seen by inspecting the pods labels for the label:&amp;nbsp;&lt;/SPAN&gt;&lt;A class="c-link" href="http://dynakube.dynatrace.com/injected" target="_blank" rel="noopener noreferrer" data-stringify-link="http://dynakube.dynatrace.com/injected" data-sk="tooltip_parent"&gt;dynakube.dynatrace.com/injected&lt;/A&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code c-mrkdwn__code--no_right_cap" data-stringify-type="code"&gt;kubectl describe pod podName -n PodNamespace | grep &lt;/CODE&gt;&lt;CODE class="c-mrkdwn__code c-mrkdwn__code--no_left_cap" data-stringify-type="code"&gt;&lt;A class="c-link" href="http://dynakube.dynatrace.com/injected" target="_blank" rel="noopener noreferrer" data-stringify-link="http://dynakube.dynatrace.com/injected" data-sk="tooltip_parent"&gt;dynakube.dynatrace.com/injected&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;cloudNative logs&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;Also.. if you're working on cloudNative issues and wondering where the application/pod logs are.. they're located on the instrumented/injected application pods, you can find the log locations if you exec in and run something like the below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;sudo ls -lash /proc/*/fd | grep oneagent&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG data-stringify-type="bold"&gt;Copying logs out of container&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;If tar binary is on the app pod you can use kubectl cp&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl cp namespace/podname:/opt/dynatrace/oneagent-paas/log /tmp/logs&lt;/CODE&gt;&lt;SPAN&gt;If tar is unavailable on the app pod you can try something like the below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl exec &amp;lt;pod-name&amp;gt; – find &amp;lt;directory-path&amp;gt; -type f | xargs -I {} sh -c 'kubectl exec &amp;lt;pod-name&amp;gt; – cat {} &amp;gt; &amp;lt;local-path&amp;gt;/${1#&amp;lt;directory-path&amp;gt;}' _ {}&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl exec myapp-123 – find /data/logs -type f | xargs -I {} sh -c 'kubectl exec myapp-123 – cat {} &amp;gt; /tmp/${1#/data/logs}' _ {}&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2023 14:51:35 GMT</pubDate>
    <dc:creator>danmichael</dc:creator>
    <dc:date>2023-03-20T14:51:35Z</dc:date>
    <item>
      <title>Container issues and initial information gathering</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Container-issues-and-initial-information-gathering/ta-p/207469</link>
      <description>&lt;H1&gt;Initial information gathering commands&lt;/H1&gt;
&lt;P&gt;These will help describe Dynatrace entities and their status, also can help gather the Dynakube Custom Resource if the location of the yaml used to apply it isn't known. Also including some basic exec commands to get into pods&lt;/P&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG data-stringify-type="bold"&gt;Kubernetes commands:&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;kubectl get all -n dynatrace
kubectl describe all -n dynatrace
kubectl get events -n dynatrace --sort-by=.metadata.creationTimestamp
kubectl describe nodes
kubectl get dynakube -n dynatrace -o yaml&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;init container logs (app only/cloudnative):&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl logs frontend-79db8fc578-48qxh -c install-oneagent&lt;/CODE&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;&lt;/CODE&gt;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG data-stringify-type="bold"&gt;OpenShift Commands:&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;oc get all -n dynatrace
oc describe all -n dynatrace
oc get events -n dynatrace --sort-by=.metadata.creationTimestamp
oc describe nodes
oc get dynakube -n dynatrace -o yaml&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG&gt;Generic 1st response commands&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;kubectl get all -n dynatrace
kubectl describe all -n dynatrace
kubectl get events -n dynatrace --sort-by=.metadata.creationTimestamp
kubectl logs -n dynatrace nameofdynatracepods (this is good for oneagent pods and csi pods)
kubectl describe nodes
kubectl get dynakube -n dynatrace -o yaml&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&lt;STRONG data-stringify-type="bold"&gt;Exec into pods&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;kubectl logs oneagent-pod
kubectl exec oneagentPodname -n dynatrace -it – sh
kubectl exec oneagentPodname -n dynatrace -it –- /bin/bash
chroot /mnt/host_root /bin/bash&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG data-stringify-type="bold"&gt;cloudNativeFullStack injection issues&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;These labels are subject to change and this information might not be the most up to date source for this.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Quick rundown of how the Webhook pod does the container injections while we have the Dynatrace Operator running in CloudNativeFullStack:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The install of the webhook should lead to all namespaces (with dynatrace operator deployed NS along with anything kube- or openshift- starting) to be applied with the label:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;&lt;A class="c-link" href="http://dynakube.internal.dynatrace.com/instance" target="_blank" rel="noopener noreferrer" data-stringify-link="http://dynakube.internal.dynatrace.com/instance" data-sk="tooltip_parent"&gt;dynakube.internal.dynatrace.com/instance&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As long as that label is on the namespace that the app pods are starting in, check it with kubectl describe appNamespace , then you should be seeing pod injections on that kind of container.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can see if a pod was seen by the webhook for injection or not consideration by checking its logs with these two steps:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Gather pod UID for next command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl get pods -n &amp;lt;namespace&amp;gt; &amp;lt;pod-name&amp;gt; -o jsonpath='{.metadata.uid}'&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Use Pod UID to search all webhook pod logs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl logs &amp;lt;webhook pod name&amp;gt; -n dynatrace | grep &amp;lt;UID of the pod that was launched&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And Further validation on if a pod was injected into by the webhook or not can be seen by inspecting the pods labels for the label:&amp;nbsp;&lt;/SPAN&gt;&lt;A class="c-link" href="http://dynakube.dynatrace.com/injected" target="_blank" rel="noopener noreferrer" data-stringify-link="http://dynakube.dynatrace.com/injected" data-sk="tooltip_parent"&gt;dynakube.dynatrace.com/injected&lt;/A&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code c-mrkdwn__code--no_right_cap" data-stringify-type="code"&gt;kubectl describe pod podName -n PodNamespace | grep &lt;/CODE&gt;&lt;CODE class="c-mrkdwn__code c-mrkdwn__code--no_left_cap" data-stringify-type="code"&gt;&lt;A class="c-link" href="http://dynakube.dynatrace.com/injected" target="_blank" rel="noopener noreferrer" data-stringify-link="http://dynakube.dynatrace.com/injected" data-sk="tooltip_parent"&gt;dynakube.dynatrace.com/injected&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;cloudNative logs&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;Also.. if you're working on cloudNative issues and wondering where the application/pod logs are.. they're located on the instrumented/injected application pods, you can find the log locations if you exec in and run something like the below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;sudo ls -lash /proc/*/fd | grep oneagent&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG data-stringify-type="bold"&gt;Copying logs out of container&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;If tar binary is on the app pod you can use kubectl cp&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl cp namespace/podname:/opt/dynatrace/oneagent-paas/log /tmp/logs&lt;/CODE&gt;&lt;SPAN&gt;If tar is unavailable on the app pod you can try something like the below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl exec &amp;lt;pod-name&amp;gt; – find &amp;lt;directory-path&amp;gt; -type f | xargs -I {} sh -c 'kubectl exec &amp;lt;pod-name&amp;gt; – cat {} &amp;gt; &amp;lt;local-path&amp;gt;/${1#&amp;lt;directory-path&amp;gt;}' _ {}&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;kubectl exec myapp-123 – find /data/logs -type f | xargs -I {} sh -c 'kubectl exec myapp-123 – cat {} &amp;gt; /tmp/${1#/data/logs}' _ {}&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:51:35 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Container-issues-and-initial-information-gathering/ta-p/207469</guid>
      <dc:creator>danmichael</dc:creator>
      <dc:date>2023-03-20T14:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Container issues and initial information gathering</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Container-issues-and-initial-information-gathering/tac-p/212089#M179</link>
      <description>&lt;P&gt;Thank you for sharing this! I'm sure it will help out many community members.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 18:53:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Container-issues-and-initial-information-gathering/tac-p/212089#M179</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-05-12T18:53:45Z</dc:date>
    </item>
  </channel>
</rss>

