Running KMS plugin as a static pod #13916
|
Hello,
Modification of the machine config: How to resove the probem with the permission? Is it possible to run the plugin as a static pod or perhaps system extension better? |
Replies: 4 comments 6 replies
|
I don't think it's a great idea to run it this way - seems fragile to me. But your problem I guess is that apiserver runs as non-root, and the socket is created by root-owned static pod, so you need match users. |
|
The 1. Share one host directory between both static podsThe KMS plugin and kube-apiserver are two separate static pods, so the socket has to live on a
If the apiserver mounts a different path than where the plugin actually created the socket, you'd get "no such file" — since you're getting permission denied, the mount is right and it's the next point. 2. Make the socket accessible to the apiserver's userTalos runs kube-apiserver as a non-root user, while your Infisical static pod almost certainly runs as root and creates the socket with mode
To find the UID the apiserver actually runs as, check the generated static pod: and look at the container 3. Ordering (usually not the cause of EACCES, but worth confirming)The plugin must be up before the apiserver tries to use it. Talos will restart the apiserver until the KMS endpoint answers, so a brief crash-loop at boot is normal — but that surfaces as connection-refused, not permission-denied, so it's not your current symptom. My money is on #2 (socket mode): a root-owned |
It's clear now, thanks! |
How to implement it in Talos 1.14.0-beta.0 ? |
Nice, you're basically there. Notice the error changed from
connect: permission deniedtobind: permission denied— that's actually the plugin now failing to create the socket rather than the apiserver failing to open it. Makes sense: the kubelet creates that hostPath dir as root (0755), so once you drop the plugin to65534it can't write into/var/run/infisicalanymore.Matching the UID to the apiserver is still the right call though — it quietly fixes the connect side too, since a socket created by
65534is owned by65534, and the apiserver (also65534) can always connect to a socket it owns no matter what mode it ends up with. So you don't actually need that0660/0666flag you were abo…