以下の構成で lxc コンテナーで Kubespray を実行しました: (server_ram:8G | ubuntu のすべてのノード:18.04)
| NAME | STATE | IPV4
+---------+---------+-------------------
| ansible | RUNNING | 10.21.185.23 (eth0)
| node1 | RUNNING | 10.21.185.158 (eth0)
| node2 | RUNNING | 10.21.185.186 (eth0)
| node3 | RUNNING | 10.21.185.65 (eth0)
| node4 | RUNNING | 10.21.185.106 (eth0)
| node5 | RUNNING | 10.21.185.14 (eth0)
root@ansible で: kubespray コマンドを実行してクラスターを構築すると、次のエラーが発生しました:
TASK [kubernetes/preinstall : Disable swap] ******************
fatal: [node1]: FAILED! => {"changed": true, "cmd": ["/sbin/swapoff", "-a"], "delta": "0:00:00.020302", "end": "2020-05-13 07:21:24.974910", "msg": "non-zero return code", "rc": 255, "start": "2020-05-13 07:21:24.954608", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
fatal: [node2]: FAILED! => {"changed": true, "cmd": ["/sbin/swapoff", "-a"], "delta": "0:00:00.010084", "end": "2020-05-13 07:21:25.051443", "msg": "non-zero return code", "rc": 255, "start": "2020-05-13 07:21:25.041359", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
fatal: [node3]: FAILED! => {"changed": true, "cmd": ["/sbin/swapoff", "-a"], "delta": "0:00:00.008382", "end": "2020-05-13 07:21:25.126695", "msg": "non-zero return code", "rc": 255, "start": "2020-05-13 07:21:25.118313", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
fatal: [node4]: FAILED! => {"changed": true, "cmd": ["/sbin/swapoff", "-a"], "delta": "0:00:00.006829", "end": "2020-05-13 07:21:25.196145", "msg": "non-zero return code", "rc": 255, "start": "2020-05-13 07:21:25.189316", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
lxc コンテナーの構成:(include:node1、node2、node3、node4、node5)
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20200506)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: "20200506"
image.version: "18.04"
limits.cpu: "2"
limits.memory: 2GB
limits.memory.swap: "false"
linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
raw.lxc: "lxc.apparmor.profile=unconfined\nlxc.cap.drop= \nlxc.cgroup.devices.allow=a\nlxc.mount.auto=proc:rw
sys:rw"
security.nesting: "true"
security.privileged: "true"
volatile.base_image: 93b9eeb85479af2029203b4a56a2f1fdca6a0e1bf23cdc26b567790bf0f3f3bd
volatile.eth0.hwaddr: 00:16:3e:5a:91:9a
volatile.idmap.base: "0"
volatile.idmap.next: '[]'
volatile.last_state.idmap: '[]'
volatile.last_state.power: RUNNING
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: ""
ノードで手動でスワップオフしようとすると、何も受信しません。
root@node1:~# /sbin/swapoff -a
root@node1:~#
誰かがアイデアを持っているととても役に立ちます。