kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.57k stars 4.9k forks source link

Aparent inconsistence between the time displayed by the Linux date command and the one obtained by a running pod #19361

Open nicolasduminil opened 3 months ago

nicolasduminil commented 3 months ago

What Happened?

I'm running minikube 1.32.0 on Ubuntu 22.04.4 LTS. The file ~/.minikube/files/etc/localtime has been configured with the CEST time zone. I can check that as follows:

$ minikube ssh
docker@minikube:~$ date
Thu Aug  1 17:58:31 CEST 2024

I have a deployed a pod that returns the system current date and time. The Java code is below:

return LocalDateTime.now().format(...); 

However, this returns Thu Aug 1 15:58:31 CEST 2024 instead of Thu Aug 1 17:58:31 CEST 2024 . So, the date and time returned by the Linux date command is different from the one returned by the pod running in the cluster.

I have the following locale:

On the host machine:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=

On the cluster:

$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX" 
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

By setting the file ~/.minikube/files/etc/localtime I would have expected that the cluster locale be the same as the host machine. But obviously not. However, the date command show the CEST locale.

What might be the problem here ?

Attach the log file

log.txt

Operating System

Ubuntu

Driver

Docker

nicolasduminil commented 3 months ago

Anyone concerned there ?

k8s-triage-robot commented 1 week ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale