EKS time handling

0

Hallo guys,

how exactly is time handled in EKS?

  1. Is there a synchronization mechanism in place by default?
  2. If not, what time is exactly returned if I ask for the time of a concrete Kubernetes pod, e.g. simply calling 'date' in a Linux container? I know it depends on the actual container (e.g. implementing custom NTP sync etc.), I mean the default case here.
  3. Is time always strictly monotonically increasing? (Depends on the mechanisms in use)
  4. In either case, what are the maximum time deviations from Kubernetes workload to Kubernetes workload? E.g. can I expect time to be nearly equal on all workloads (probably nodes in the end) with a max deviation of <0.1 seconds?

Thank you :)

Lukas

2 Answers
1

The clock in a container is the same as on the host machine because it’s controlled by the kernel of that machine. Timezone is controlled by the OS layer so it may be different inside the container.

The default time zone for most images is UTC, but it is not guaranteed and can vary from container to container. You can use specific timezone config and hostPath volume to set specific timezone. Here’s an example YAML file that shows how to configure the timezone for a pod:


apiVersion: v1
kind: Pod
metadata:
name: busybox-sleep
spec:
containers:
- name: busybox
image: busybox
args:
- sleep
- "1000000"
volumeMounts:
- name: tz-config
mountPath: /etc/localtime
volumes:
- name: tz-config
hostPath:
path: /usr/share/zoneinfo/Europe/Berlin
type: File


answered 4 months ago
0
Accepted Answer

In the meantime, I took a look at it myself. Our EKS image (Amazon Linux 2) uses by default chrony for time synchronization with a local endpoint provided by Amazon Time Sync Service. This works in our quite restrictive environment without internet access. The default time zone seems to be UTC.

Lukas
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions