Hey all. I'm currently learning Kubernetes and I'm...
# k3s
i
Hey all. I'm currently learning Kubernetes and I'm trying to figure out what timezone is used for CronJobs in k3s. I did some googeling but all I could find is the documentation on a full Kubernetes cluster - but k3s seem to behave differently here. Is there any k3s documentation on this topic?
q
Its probably using the timezone of the node that its on.
Ideally all nodes on the cluster are in the same timezone also.
i
Could be. But the official documentation says it's the timezone of the "kube-controller-manager". But I'm getting conflicting information on whether the timezone is a cluster setting or simply inherited from the OS. And what happens if the nodes have different timezone (for whatever reason)?
That's why I'm looking for an official documentation.
q
I'm not a k3s dev, but I'm pretty sure that the controller-manager is running on a node, and the timezone of that node will be the timezone of the controller-manager. Having pods with separate timezones than the node would be confusing.
i
ChatGPT thinks, the kube-controller-manager only runs on the control-plane, not on every node.
q
Right, but it still runs on a node, and that node has a timezone, which likely the controller inherits.
This would likely be simple enough to test, also. Create a cronjob which does nothing, but it will be enough to see that the job gets created.
q
Makes sense.
i
Yeah - I asked ChatGPT and it made it sound as if k3s was special in this case. But maybe this was wrong and the timezone behavior comes directly from the Kubernetes implementation.
q
One thing to know is that k3s is an implementation of kubernetes, but it has some of its own flavor. Since you're learning kubernetes, this is good to pay attention to.
i
Hmm... yeah. ChatGPT's reasoning was that in a default Kubernetes cluster, the kube-controller-manager runs in a container that has its timezone set to UTC - while k3s runs directly on the host and thus inherits the timezone from the host. Makes sense to me.
👍 1