I want to set up some stuff when starting Kubernetes node worker. Specifically, I change systemd service configuration and apply it (systemctl daemon-reload), but from inside the container, I don't know how to configure systemd of node worker
Asked
Active
Viewed 523 times
1 Answers
1
Not sure what you actually want to do, but
- Usually systemd is not installed inside containers
- I don't know what you want to implement, but I pretty sure that run systemd daemon inside container is a bad idea
- In most cases if you want to start long running background process, that will be better idea to run it in separate container and connect two containers.
- If you need to do some action on container start before run main process, just override entrypoint, and prepend own command before main one (you may add it with & symbol to run in background, but it is a not smart solution)

rzlvmp
- 7,512
- 5
- 16
- 45
-
I run k8s cluster on AWS, with node worker - spot instance. Every day, we will scale the auto-scaling group from N node worker -> 0 node worker in 12 pm for saving resource, thus there will be new servers. Recently, our server (with image instance is specified when creating k8s cluster) run a cronjob from 6 am - 7 am, so my server will reload configuration systemd and restart network service, so my applications running on node worker are disconnected with outside. Therefore I want to turn off this cron job. – Nguyễn Văn Dưng Aug 19 '21 at 04:49
-
Sorry, still can't figure out actual problem and task details. Also I'm not familiar with AWS k8s – rzlvmp Aug 19 '21 at 05:01