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개 답변
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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠