-
Notifications
You must be signed in to change notification settings - Fork 57
Update configuring date and timezone.md #489
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
base: main
Are you sure you want to change the base?
Changes from all commits
c355f33
d8a0617
6994a54
b54bd1e
1144868
4f34391
f3a31dc
8339494
4a7890c
c369270
52eb48e
55e4f88
38ef669
087e799
0064543
c126b39
a2db01c
cfd8288
75e2329
22b60bf
866ea98
0733a0c
db4a1dd
48e3c4d
b0f634e
746abd9
5d276b2
b179191
13a1ae6
839a7f2
00bd3ff
13caaaf
bff5033
f00aad8
90f2a1d
1cb3204
2c50b5f
22ad485
c909c69
5e5a8de
75c0078
0b6f57b
83b5539
a8ce9d1
9a7b1c0
6c214b6
a4237a8
7e52d24
3a45ec6
9c15cec
09c74c3
0f4977d
fb96ae0
6107faf
a75d089
d9c737e
0377ea6
2d32a64
a0a8f71
ab463fe
1e473c4
e82f47f
36cbdc3
662af1c
58a0fc4
c8cef71
3b4b9c5
1a9c141
f151026
1966efd
8cbf506
42e8af4
0910a0c
ad08f77
6ee4e15
a3e0689
6357698
e422d82
aa1c74e
d6ec5b0
7f1b487
39e3b01
4467af9
9797394
317ce65
f1f525d
c73e1d9
028d1f2
22ad4ac
d2b7fa0
508c60d
be3818b
a0c1ded
c3e449c
f0edf26
314f2bc
1c15fbc
2887da3
b27a3cd
1a2ff38
997b5ea
ad6f6fb
2e10986
12d3f18
25935f2
92989e1
f335db0
0ed265d
21bae26
8f6e638
dde152f
b6c6d18
e1117bf
c523f18
ccaad50
771dfef
a24508a
d7cb693
67e580f
0fc91c0
0a1eb9f
062524d
8624fa4
f545cd6
e9856e8
3b7481a
bbc65c9
427e07d
5a6834d
f09135d
9749f7e
59b8fc3
4b2e2f2
6f7127b
110c285
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,50 @@ NTP synchronized: yes | |
| Sun 2015-11-01 01:00:00 EST | ||
| ``` | ||
|
|
||
| ## Time synchronization | ||
| ### Setting the time zone via Ignition | ||
|
|
||
| If you are aware of the downsides to setting a system time zone that is different from the default UTC time zone, you can set a different system time zone by setting the local time zone configuration file, [`/etc/localtime`][localtime], to be an absolute or relative symlink to a `tzfile` entry under `/usr/share/zoneinfo/`. | ||
| If you choose a non-UTC time zone, it is recommended that you set the same time zone across all your machines in the cluster. | ||
|
|
||
| For example, you can set the time zone to `America/New_York` by using a Butane config like the following: | ||
|
|
||
| ```yaml | ||
| variant: flatcar | ||
| version: 1.0.0 | ||
| storage: | ||
| links: | ||
| - path: /etc/localtime | ||
| target: ../usr/share/zoneinfo/America/New_York | ||
| overwrite: true | ||
| ``` | ||
| `overwrite: true` is optional; it forces recreation if `/etc/localtime` already exists. | ||
| <details> | ||
|
|
||
| <summary>Notes on other references</summary> | ||
|
|
||
| If you come across [this older Ignition v2 example][issuecomment-908316042] and wonder whether you have to use the fields `overwrite: true` and `filesystem: root` (unlike in Fedora CoreOS): | ||
| See <https://github.com/flatcar/Flatcar/issues/1836#issuecomment-3175310460> for details. | ||
|
|
||
| </details> | ||
|
Comment on lines
+91
to
+98
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole thing can be dropped. FCOS is not using Ignition 2 since years now, so no need to mention the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's how the journey began. If you start googling (or asking AI), you get a mix of old and up-to-date answers. I want to clarify things here. It always helps to give some histroical context for users not follwing a project cloelsys to keep track of such hchanges |
||
|
|
||
| ## Time zone synchronization with the host | ||
|
|
||
| To keep a container's time zone in sync with the host, you can mount the host's `/etc/localtime` into the container. | ||
| Add the following to your mount configuration section (for example, in a Kubernetes Pod spec): | ||
|
|
||
| ```yaml | ||
| volumeMounts: | ||
| - name: localtime | ||
| mountPath: /etc/localtime | ||
| readOnly: true | ||
| volumes: | ||
| - name: localtime | ||
| hostPath: | ||
| path: /etc/localtime | ||
| type: File | ||
| ``` | ||
|
|
||
| ## Time synchronization to NTP | ||
|
|
||
| Flatcar Container Linux clusters use NTP to synchronize the clocks of member nodes, and all machines start an NTP client at boot. The operating system uses [`systemd-timesyncd(8)`][systemd-timesyncd] as the default NTP client. Use `systemctl` to check which service is running: | ||
|
|
||
|
|
@@ -208,9 +251,11 @@ storage: | |
| restrict [::1] | ||
| ``` | ||
|
|
||
| [localtime]: https://www.freedesktop.org/software/systemd/man/localtime.html | ||
| [timedatectl]: http://www.freedesktop.org/software/systemd/man/timedatectl.html | ||
| [ntp.org]: http://ntp.org/ | ||
| [systemd-timesyncd]: http://www.freedesktop.org/software/systemd/man/systemd-timesyncd.service.html | ||
| [systemd.network]: http://www.freedesktop.org/software/systemd/man/systemd.network.html | ||
| [timesyncd.conf]: http://www.freedesktop.org/software/systemd/man/timesyncd.conf.html | ||
| [butane-configs]: ../../provisioning/config-transpiler | ||
| [issuecomment-908316042]: https://github.com/flatcar/Flatcar/issues/491#issuecomment-908316042 | ||
Uh oh!
There was an error while loading. Please reload this page.