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 个月前1194 查看次数
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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容