cgroupfs vs systemd
I'm back to the kubernetes initialization. When trying to run `kubeadm init` I'm getting a warning about cgroupfs which should be replaced with systemd.
I'm using ubuntu with systemd.
https://kubernetes.io/docs/setup/cri
The documentation states that having systemd OS and cgroupfs for k8s leads to having 2 cgroup managers and could lead to conflicts. As a result I'm switching to systemd.
My previous problem with swap is gone as my system has now 72 GB of RAM and no swap at all (by my design). But I'm on a new system.
I have created a new file /etc/docker/daemon.json and set driver there to systemd. Followed by `service docker restart`.
`kubeadm init`... I have some more warnings: ethtool, socat, conntrack and kubelet service are missing.
`apt install -y ethtool socat conntrack` - lucky this is already available on my system and I can install whatever came with it (no need for newest-possible-predevelop sources).
Now only kubelet service is missing...
`
sudo vim /etc/systemd/system/kubelet.service`
And content can be like this:
[Unit]
Description=Kubelet Kubetneres rootkit or whatever you want to call it
[Service]
ExecStartPre=/usr/bin/mkdir -p /etc/kubernetes/manifests
ExecStart=/home/myusername/go/src/k8s.io/kubernetes/_output/bin/kubelet \
--address=192.168.1.141 \
--cgroup-driver=systemd
[Install]
WantedBy=multi-user.target
Well... a bit of explanation.
My computer has IP 192.168.1.141 - but that is my personal network. Your will be different.
I have modified docker configuration to use systemd... so kubelet must match that.
Location is weird... becuase I built it there and you might have different ;)
Or you could install kubelet to somewhere (probably this is a better idea).
And remember to add it to the PATH when calling kubeadm - otherwise it would cry about kubelet not being in the PATH.
Also it cries about service not being enabled... `sudo systemctl enable kubelet.service` should solve the issue.
A trap here... kubelet is enabled but if you start it... `kubeadm init` would fail ("Port 10250 is in use").
Comments
Post a Comment