I am trying to work through the DTU Kubernetes lab, and I am stuck on what feels like the last step. The OneAgent pod will not start, the log is ending with the following:
00:49:55 Started with user: uid=0(root) gid=0(root) groups=0(root)
00:49:55 Error: Container was not launched in host's cgroup namespace
00:49:55 Error: Dynatrace OneAgent requires parameters: --pid, --net and --cgroupns set to 'host'.
00:49:55 If you are not sure how to launch the container please visit: https://www.dynatrace.com/support/help/shortlink/oneagent-docker
00:49:55 Error: Initialization procedure failed
I have googled every error message, combed through yaml files, and I have not been able to figure out if this is the real issue, or something else? I've tried adding the 'useUnprivilegedMode: true' setting in the dynakube.yaml, but it didn't make a difference. I'm fairly new to deploying Dynatrace in K8S, not new to Dynatrace though, this one has me stumped!
Thanks for any help.
Solved! Go to Solution.
I used the automated Dynatrace Operator guide here: Get started with Kubernetes/OpenShift monitoring | Dynatrace Docs
The lab I am working on is this one: https://university.dynatrace.com/assets/23274/LabKubernetes.pdf
I created another full Kubernetes cluster on another completely separate server, and had the exact same problem and error. On the new cluster, before I installed K8S, I had a docker instance, oneagent and activegate installed outside docker and it worked perfectly. I removed oneagent, activegate and docker completely, and started with K8S from scratch, and had the same problem.
As a test I installed the onegent again outside the cluster and that seems to work.
I tried to reproduce it, but didn't have these problems. The OneAgent pod was able to start.
My setup looks like this:
It was a new VM only minikube and docker were installed according to instructions.
Is it possible that you have also executed steps from this documentation?
I followed the exact same steps that you did. The only difference, and this may be the root cause, is that on the new server I had previously installed Docker (not Kubernetes), and standalone (not containerized) ActiveGate and OneAgent. I thought I had removed all of those components and started fresh, but it was still on the same server. Having said that, my first attempt was on a VirtualBox VM that I don't think had anything other than a K8S deployment, but I will start that from scratch with a new VM and see how it goes.
Thank you for investigating!
I just re-did the whole thing from scratch and I get the same error again:
The only difference I can see is that I used Ubuntu 22.04. I guess the last thing to try would be to use 20.04 as that is literally the only thing that is different. I would appreciate if anyone else who has used Ubuntu 22.04 and Dynatrace K8S via the Operator would chime in to see if it's just me.
I also tried it with Ubuntu 22.04. It works. My ActiveGate doesn't run because I do not have enough CPU 😇. But the agent works. However, I am surprised that the agent shows me Ubuntu 20.04 as OS, but it was set up in VM 22.04.
I don't know what the difference is to your attempts. But as I said, the detection of the OS also makes me wonder 🤔.
@TomLichti After restarting the VM, I have the error as well.
14:11:41 Started with capabilities: self: cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_net_admin,cap_net_raw,cap_sys_chroot,cap_sys_ptrace,cap_sys_admin,cap_sys_resource,cap_setfcap=ep 14:11:41 Started with user: uid=0(root) gid=0(root) groups=0(root) 14:11:41 Error: Container was not launched in host's cgroup namespace 14:11:41 Error: Dynatrace OneAgent requires parameters: --pid, --net and --cgroupns set to 'host'. 14:11:41 If you are not sure how to launch the container please visit: https://www.dynatrace.com/support/help/shortlink/oneagent-docker 14:11:41 Error: Initialization procedure failed
Until now I had always started with a new VM and reinstalled everything. The error did not occur. After a reboot now it does.
@andre_f I followed the exact same steps, but for some reason, my AG pod doesn't get created/doesn't start up - any idea why that would be? I've tried it using EC2 instances as well as local VMs. Do I need to change anything in the dynakube.yaml file, or use it as is from the deployment screen?
Ah okay. Sorry about that. I thought that the pod was there but would not come into the status "running".
If you download the dynakube.yaml here (see screenshot), you should not need to adjust anything.
This part is already included there (I have removed some comments here):
# Configuration for ActiveGate instances. activeGate: # Enables listed ActiveGate capabilities capabilities: - routing - kubernetes-monitoring resources: requests: cpu: 500m memory: 512Mi limits: cpu: 1000m memory: 1.5Gi