Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.27] - k3s docker image does not support time zones #8837

Closed
brandond opened this issue Nov 14, 2023 · 1 comment
Closed

[Release-1.27] - k3s docker image does not support time zones #8837

brandond opened this issue Nov 14, 2023 · 1 comment
Assignees
Labels
waiting-for-RC Issue is available to test only after we have an RC

Comments

@brandond
Copy link
Member

Backport fix for k3s docker image does not support time zones

@brandond brandond self-assigned this Nov 14, 2023
@fmoral2 fmoral2 added the waiting-for-RC Issue is available to test only after we have an RC label Nov 16, 2023
@fmoral2
Copy link
Contributor

fmoral2 commented Nov 27, 2023

Validated on Version:

-$ k3s version v1.27.8-rc1+k3s1 (0abb8a5a)

Environment Details

Infrastructure
Cloud EC2 instance

Node(s) CPU architecture, OS, and Version:
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"

Cluster Configuration:
1 node server

cron.yaml

apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-job
spec:
  jobTemplate:
    metadata:
      name: my-job
    spec:
      template:
        spec:
          containers:
            - image: busybox
              name: my-job
              command: ["echo", "Hello, CronJob!"]
          restartPolicy: Never
  schedule: "*/1 * * * *"
  timeZone: Europe/Berlin

Steps to validate the fix

  1. Install docker
  2. Run k3s through docker
  3. Apply cronjob with timezone
  4. Validate if applied
  5. Check the logs
  6. Validate nodes and pods are up and ok

Reproduction Issue:


$ docker pull rancher/k3s:latest
$ docker run -d --privileged --name k3s --hostname k3s -p 6443:6443 rancher/k3s:latest server
$ docker exec -it k3s bash


$ k3s -v
k3s version v1.28.3+k3s-0011eb5e (0011eb5e)


$ kubectl get nodes
NAME           STATUS   ROLES                  AGE   VERSION
06fad95635c3   Ready    control-plane,master   23m   v1.25.15+k3s2


$ kubectl apply -f cron.yaml 

The CronJob "my-job" is invalid: spec.timeZone: Invalid value: "Europe/Berlin": unknown time zone Europe/Berlin




Validation Results:


$ docker pull rancher/k3s:v1.27.8-rc1-k3s1
$  sudo docker run -d --privileged --name k3s127 --hostname k3s -p 6441:6441 rancher/k3s:v1.27.8-rc1-k3s1 server
$ docker exec -it k3s127 sh


# k3s -v
k3s version v1.27.8-rc1+k3s1 (0abb8a5a)
go version go1.20.11

# kubectl apply -f cron.yaml 

#  kubectl get jobs --watch
NAME              COMPLETIONS   DURATION   AGE
my-job-28351624   0/1                      0s
my-job-28351624   0/1           0s         0s
my-job-28351624   0/1           4s         4s
my-job-28351624   1/1           4s         4s



 # kubectl logs  my-job-28351624-879st 
Hello, CronJob!


# kubectl get pods -A
NAMESPACE     NAME                                     READY   STATUS      RESTARTS   AGE
kube-system   coredns-77ccd57875-xzw4r                 1/1     Running     0          3m36s
kube-system   local-path-provisioner-957fdf8bc-64hjh   1/1     Running     0          3m36s
kube-system   helm-install-traefik-crd-dwp8s           0/1     Completed   0          3m37s
kube-system   metrics-server-648b5df564-7jtpd          1/1     Running     0          3m36s
kube-system   svclb-traefik-7ad3a24b-lfvgt             2/2     Running     0          3m5s
kube-system   helm-install-traefik-v56sn               0/1     Completed   2          3m37s
kube-system   traefik-768bdcdcdd-4d6hw                 1/1     Running     0          3m5s
default       my-job-28351624-879st                    0/1     Completed   0          47s




 # kubectl describe  cronjob my-job
Name:                          my-job
Namespace:                     default
Labels:                        <none>
Annotations:                   <none>
Schedule:                      1 1 1 1 *
Concurrency Policy:            Allow
Suspend:                       False
Successful Job History Limit:  3
Failed Job History Limit:      1
Starting Deadline Seconds:     <unset>
Selector:                      <unset>
Parallelism:                   <unset>
Completions:                   <unset>
Pod Template:
  Labels:  <none>
  Containers:
   my-job:
    Image:           busybox
    Port:            <none>
    Host Port:       <none>
    Environment:     <none>
    Mounts:          <none>
  Volumes:           <none>
Last Schedule Time:  <unset>
Active Jobs:         <none>
Events:              <none>


@fmoral2 fmoral2 closed this as completed Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-RC Issue is available to test only after we have an RC
Projects
Archived in project
Development

No branches or pull requests

2 participants