Run K3s cli command from a pod? #10727
Unanswered
TheOnlyWei
asked this question in
Q&A
Replies: 1 comment
-
You could play with using the You could probably look at what the k3s-upgrade image and k3s upgrade system-upgrade-controller plans are doing, as a source of inspiration. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to run
k3s
cli commands from a pod? For example, if I want to deploy a pod to run aservice.key
rotation periodically using the k3s cli command using:The best way I found to do this currently is to mount the entire server node file system into a pod, use the server node
hostNetwork
,hostPID
, and a privilegedserviceAccountName
tochroot
the mounted server node file system. Then I can run thek3s
command.However, taking a look at the k3s CLI code, it seems to make HTTP requests, at least for the
k3s certificate rotate-ca
command:k3s/pkg/cli/cert/cert.go
Line 269 in 876d54c
Is there a way to make such an HTTP request from a pod in the server node's cluster, or even just run the
k3s
command itself, or is this not a supported use case? Although, even granted that it is possible, I would still need to run some related bash commands remotely for the full rotation and so I would likely need to use the chroot command regardless. But it would be nice to know if the HTTP request method is somehow possible or if there is a way to runk3s
command from a pod.Beta Was this translation helpful? Give feedback.
All reactions