# Limit Resource for OneAgent DeamonSet

**URL:** <https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621>\
**Category:** Container platforms\
**Tags:** kubernetes\
**Created:** [November 15, 2023, 6:15am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621 "2023-11-15T06:15:52Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 6:15am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/1 "2023-11-15T06:15:52Z")

</div>

Hi all,  
We are integrating dynatrace with k8s version 1.20 using DeamonSet.

I see in the yaml file there is a resource limitation for Operator.&nbsp;What about DeamonSet?

---

<div class="post-metadata">

**Author:** ![eduard\_van\_der1](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@eduard\_van\_der1](https://community.dynatrace.com/u/eduard_van_der1)\
**Post date:** [November 15, 2023, 8:25am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/2 "2023-11-15T08:25:20Z")

</div>

Hi,

You should be able to define the resource limits as we are deploying a DaemonSet (Not a custom resource like the operator).

An example of limiting resources can be found here in the Kubernetes documentation:&nbsp;[DaemonSet | Kubernetes](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/)

200Mi is probably not enough for the OneAgent - I’d go with similar limits that are recommended for the Operator.

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 8:55am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/3 "2023-11-15T08:55:38Z")

</div>

I try to it. But All Oneagent Pods don’t working.

OneAgent Pods status is: CrashLoopBackOff

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 8:56am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/4 "2023-11-15T08:56:08Z")

</div>

My dynatrace-oneagent.yaml:

apiVersion: apps/v1  
kind: DaemonSet  
metadata:  
name: dynatrace-oneagent  
spec:  
selector:  
matchLabels:  
name: dynatrace-oneagent  
template:  
metadata:  
labels:  
name: dynatrace-oneagent  
spec:  
hostPID: true  
hostIPC: true  
hostNetwork: true  
nodeSelector:  
[beta.kubernetes.io/os:](http://beta.kubernetes.io/os:) linux  
volumes:  
- name: host-root  
hostPath:  
path: /  
containers:  
- name: dynatrace-oneagent  
image: dynatrace/oneagent  
resources:  
limits:  
memory: 200Mi  
requests:  
cpu: 100m  
memory: 200Mi  
env:  
- name: ONEAGENT\_INSTALLER\_SCRIPT\_URL  
value: [https://env/e/700/api/v1/deployment/installer/agent/unix/default/latest?arch=](https://rmw650.dynatrace-managed.com/e/702ce034-0f01-4f5b-9078-4c7b33e16678/api/v1/deployment/installer/agent/unix/default/latest?arch=)\<arch\>  
- name: ONEAGENT\_INSTALLER\_SKIP\_CERT\_CHECK  
value: ‘false’  
- name: ONEAGENT\_INSTALLER\_DOWNLOAD\_TOKEN  
value: ‘’  
args:  
- ‘--set-network-zone=\<your.network.zone\>’  
volumeMounts:  
- name: host-root  
mountPath: /mnt/root  
securityContext:  
privileged: true

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 8:57am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/5 "2023-11-15T08:57:23Z")

</div>

**My dynatrace-oneagent.yaml:**

apiVersion: apps/v1  
kind: DaemonSet  
metadata:  
name: dynatrace-oneagent  
spec:  
selector:  
matchLabels:  
name: dynatrace-oneagent  
template:  
metadata:  
labels:  
name: dynatrace-oneagent  
spec:  
hostPID: true  
hostIPC: true  
hostNetwork: true  
nodeSelector:  
[beta.kubernetes.io/os:](http://beta.kubernetes.io/os:) linux  
volumes:  
- name: host-root  
hostPath:  
path: /  
containers:  
- name: dynatrace-oneagent  
image: dynatrace/oneagent  
resources:  
limits:  
memory: 200Mi  
requests:  
cpu: 100m  
memory: 200Mi  
env:  
- name: ONEAGENT\_INSTALLER\_SCRIPT\_URL  
value: [https://env/e/700/api/v1/deployment/installer/agent/unix/default/latest?arch=](https://rmw650.dynatrace-managed.com/e/702ce034-0f01-4f5b-9078-4c7b33e16678/api/v1/deployment/installer/agent/unix/default/latest?arch=)\<arch\>  
- name: ONEAGENT\_INSTALLER\_SKIP\_CERT\_CHECK  
value: ‘false’  
- name: ONEAGENT\_INSTALLER\_DOWNLOAD\_TOKEN  
value: ‘’  
args:  
- ‘--set-network-zone=\<your.network.zone\>’  
volumeMounts:  
- name: host-root  
mountPath: /mnt/root  
securityContext:  
privileged: true

---

<div class="post-metadata">

**Author:** ![eduard\_van\_der1](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@eduard\_van\_der1](https://community.dynatrace.com/u/eduard_van_der1)\
**Post date:** [November 15, 2023, 8:57am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/6 "2023-11-15T08:57:48Z")

</div>

Hi, What is the crash reason? Very likely it runs out of memory at 200Mi - try to increase it to 500Mi or 1G

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 9:10am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/7 "2023-11-15T09:10:05Z")

</div>

Oh, I try to&nbsp;increase it to 500M but not running. I will try to&nbsp;increase to more memory. Lol

---

<div class="post-metadata">

**Author:** ![eduard\_van\_der1](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@eduard\_van\_der1](https://community.dynatrace.com/u/eduard_van_der1)\
**Post date:** [November 15, 2023, 9:11am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/8 "2023-11-15T09:11:28Z")

</div>

You can describe the Pod to see what caused the failure.

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 9:21am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/9 "2023-11-15T09:21:25Z")

</div>

I see OneAgent Pods status is: CrashLoopBackOff

 ![1_n.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/5/f/5fae82c3ddc069d6cb6a83cb70af6573b1c6df5f.jpeg)

I try to get event and result as picture:

 ![2_n.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/d/d788ab052af7bcf0fdcb9cb11db5d12b6c3057b1.jpeg)

---

<div class="post-metadata">

**Author:** ![eduard\_van\_der1](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@eduard\_van\_der1](https://community.dynatrace.com/u/eduard_van_der1)\
**Post date:** [November 15, 2023, 9:29am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/10 "2023-11-15T09:29:00Z")

</div>

Thanks. This indicates that either the container host operating system is running out of memory.

The Linux OOMKiller will designate a victim (in this case one of the processes from the OneAgent pods), and that causes the CrashLoopBackoff. So you have to check that your host has sufficient memory available - and then make sure that the limit for the OneAgent is high enough.

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 15, 2023, 9:48am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/11 "2023-11-15T09:48:10Z")

</div>

The K8s cluster have 3 master node & 3 worker&nbsp; node&nbsp;corresponding to 3 oneagent daemon. I see that 1 oneagent using&nbsp;a small amount of memory as picture:

 ![3.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/5/55388cbdde07777e2248a655a65fc94bee7bc2e1.jpeg)

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 16, 2023, 1:42am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/12 "2023-11-16T01:42:04Z")

</div>

Sorry. Noted that: I use deamonset for deployment oneagent

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [November 16, 2023, 6:33am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/13 "2023-11-16T06:33:06Z")

</div>

Hello&nbsp;[@xuyenpn](https://community.dynatrace.com/user/7971)&nbsp;, removed full token from your reply.

The limits are best set as defined by the Dynatrace operator’s developers.

On the github, you can select the desired version and see the default limits in the example file dynakube

```markup
oneAgentResources:
        requests:
          cpu: 100m
          memory: 512Mi
        limits:
          cpu: 300m
          memory: 1.5Gi

```

You can easly check it for different versions in [samples](https://github.com/Dynatrace/dynatrace-operator/tree/main/assets/samples) of dynakube.

 ![Romanenkov_Al3x_0-1700116043297.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/7/876818736e334e602f283cc2388a91576d5f248f.png)

You can find recommended operator version from [documentation page](https://docs.dynatrace.com/docs/setup-and-configuration/technology-support/support-model-for-kubernetes#dynatrace-support-lifecycle-for-kubernetes-and-red-hat-openshift-full-stack-monitoring).

Regards,

Alex Romanenkov

---

<div class="post-metadata">

**Author:** ![xuyenpn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xuyenpn/32/34902_2.png) [@xuyenpn](https://community.dynatrace.com/u/xuyenpn)\
**Post date:** [November 20, 2023, 2:09am UTC](https://community.dynatrace.com/t/limit-resource-for-oneagent-deamonset/42621/14 "2023-11-20T02:09:58Z")

</div>

Thanks for your respond.  
I removed&nbsp;&nbsp;full token from my reply.

Noted. I try to using DaemonSet for K8s version 1.16. Don’t using Operator
