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
preguntada hace 5 meses1193 visualizaciones
2 Respuestas
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


respondido hace 5 meses
0
Respuesta aceptada

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
respondido hace 5 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas