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

Lukas
已提問 5 個月前檢視次數 1199 次
2 個答案
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


已回答 5 個月前
0
已接受的答案

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
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南