Is it possible to configure a pod to spin up containers on the host machine? #1840
-
I'm struggling to prove out an example where I make a container in a Kubernetes pod spin up another container on a host machine running Bottlerocket. Naturally, some variation of it is possible using the "admin" and "control" containers, but I'm starting to wonder whether it's possible in the context of Kubernetes. Thanks for your help! UPDATE: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
You can map in the host's
kubelet will register the static pod as a mirror pod when it connects to the Kubernetes API server. To create a "real" pod, you'd need to run your pod with a service account and role that allowed pod creation. I haven't tried this, but I expect the role would be something like the pod-reader example with mutating verbs added. |
Beta Was this translation helpful? Give feedback.
You can map in the host's
/usr/bin/apiclient
and/run/api.sock
to a privileged pod, then use the settings API to start a static pod:kubelet will register the static pod as a mirror pod when it connects to the Kubernetes API server.
To create a "real" pod, you'd need to run your pod with a service account and role that allowed pod creation. I haven't tried this, but I expect the role would be something like the pod-reader example with mutating verbs added.