Skip to content

Is it possible to configure a pod to spin up containers on the host machine? #1840

Answered by bcressey
artburkart asked this question in Q&A
Discussion options

You must be logged in to vote

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:

apiclient set \
  kubernetes.static-pods.my-pod.manifest=${BASE64_BLOB} \
  kubernetes.static-pods.my-pod.enabled=true

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.

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@bcressey
Comment options

@artburkart
Comment options

@artburkart
Comment options

@artburkart
Comment options

@artburkart
Comment options

Answer selected by artburkart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants