kind
是 Kubernetes in Docker
的简写,是一个使用 Docker
容器作为 Nodes
,在本地创建和运行 Kubernetes
群集的工具。适用于在本机创建 Kubernetes
群集环境进行开发和测试。
容器作为Node
首先查看Node Linux版本:
root@test-control-plane:/# cat /proc/version
Linux version 5.15.49-linuxkit (root@buildkitsandbox) (gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, GNU ld (GNU Binutils) 2.35.2) #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022
root@test-control-plane:/# uname -a
Linux test-control-plane 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
查看 alpine linux 默认timezone:
root@test-control-plane:/# cat /etc/localtime
cat: /etc/localtime: Is a directory
问题出在这边: timezone不合法
问题处理
root@test-control-plane:/# apt-get update
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [270 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [119 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [108 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [110 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages [1758 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports jammy/multiverse arm64 Packages [224 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports jammy/restricted arm64 Packages [24.2 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 Packages [17.2 MB]
Get:9 http://ports.ubuntu.com/ubuntu-ports jammy-updates/multiverse arm64 Packages [14.3 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports jammy-updates/restricted arm64 Packages [429 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages [1116 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 Packages [1010 kB]
Get:13 http://ports.ubuntu.com/ubuntu-ports jammy-backports/universe arm64 Packages [23.3 kB]
Get:14 http://ports.ubuntu.com/ubuntu-ports jammy-backports/main arm64 Packages [48.9 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports jammy-security/restricted arm64 Packages [416 kB]
Get:16 http://ports.ubuntu.com/ubuntu-ports jammy-security/universe arm64 Packages [766 kB]
Get:17 http://ports.ubuntu.com/ubuntu-ports jammy-security/main arm64 Packages [792 kB]
Get:18 http://ports.ubuntu.com/ubuntu-ports jammy-security/multiverse arm64 Packages [10.3 kB]
Fetched 24.4 MB in 16s (1557 kB/s)
Reading package lists... Done
root@test-control-plane:/# apt-get install -y tzdata
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
tzdata
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 335 kB of archives.
After this operation, 3867 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 tzdata all 2023c-0ubuntu0.22.04.0 [335 kB]
Fetched 335 kB in 2s (155 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package tzdata.
(Reading database ... 7583 files and directories currently installed.)
Preparing to unpack .../tzdata_2023c-0ubuntu0.22.04.0_all.deb ...
Unpacking tzdata (2023c-0ubuntu0.22.04.0) ...
Setting up tzdata (2023c-0ubuntu0.22.04.0) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/aarch64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
User defined time zone, leaving /etc/localtime unchanged.
Local time is now: Thu Apr 13 07:07:26 UTC 2023.
Universal Time is now: Thu Apr 13 07:07:26 UTC 2023.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
然后,通过将zoneinfo
时区绑定到localtime
解决
root@test-control-plane:/# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
「如果这篇文章对你有用,请随意打赏」
如果这篇文章对你有用,请随意打赏
使用微信扫描二维码完成支付