snap kube-proxy missing kernel modules on kubernetes control plane on lxd when on ipvs mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kubernetes Control Plane Charm |
Fix Released
|
Medium
|
Gustavo Sanchez |
Bug Description
# ------- Info
Juju agents 2.9.42
Cloud substrate MAAS
Ubuntu Focal 20.04 LTS
kuberntetes-
kuberntetes-
kuberntetes-
# ------- Juju info
$ juju config kubernetes-
proxy-mode=ipvs ipvs-strict-
$ juju status | grep -vE 'active|started'
Model Controller Cloud/Region Version SLA Timestamp
kubernetes foundations-maas maas_cloud 2.9.42 unsupported 19:02:38Z
SAAS Status Store URL
App Version Status Scale Charm Channel Rev Exposed Message
kubernetes-
Unit Workload Agent Machine Public address Ports Message
kubernetes-
kubernetes-
Machine State Address Inst id Series AZ Message
Offer Application Charm Rev Connected Endpoint Interface Role
vault-certificates vault vault 68 2/2 certificates tls-certificates provider
vault-secrets vault vault 68 1/1 secrets vault-kv provider
# ------- kube-proxy snap info
root@juju-
● snap.kube-
Loaded: loaded (/etc/systemd/
Drop-In: /etc/systemd/
Active: activating (auto-restart) (Result: exit-code) since Thu 2023-08-31 18:57:54 UTC; 7s ago
Process: 1761822 ExecStart=
Main PID: 1761822 (code=exited, status=1/FAILURE)
root@juju-
Name Version Rev Tracking Publisher Notes
cdk-addons 1.26.5 17193 1.26/stable canonical✓ in-cohort
core 16-2.60.2 15925 latest/stable canonical✓ core
core18 20230530 2785 latest/stable canonical✓ base
core20 20230622 1974 latest/stable canonical✓ base
kube-apiserver 1.26.8 3442 1.26/stable canonical✓ in-cohort
kube-controller
kube-proxy 1.26.8 3136 1.26/stable canonical✓ classic,in-cohort
kube-scheduler 1.26.8 3103 1.26/stable canonical✓ in-cohort
kubectl 1.26.8 3063 1.26/stable canonical✓ classic,in-cohort
kubelet 1.26.8 3064 1.26/stable canonical✓ classic,in-cohort
lxd 4.0.9-a29c6f1 24061 4.0/stable/… canonical✓ -
snapd 2.59.5 19457 latest/stable canonical✓ snapd
# ------- Logs
$ grep kube-proxy /var/log/syslog
# [..]
Aug 31 18:39:47 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:47 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:47 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:47 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:47 juju-712203-2-lxd-2 systemd[1]: snap.kube-
Aug 31 18:39:47 juju-712203-2-lxd-2 systemd[1]: snap.kube-
Aug 31 18:39:57 juju-712203-2-lxd-2 systemd[1]: snap.kube-
Aug 31 18:39:57 juju-712203-2-lxd-2 systemd[1]: Stopped Service for snap application kube-proxy.daemon.
Aug 31 18:39:57 juju-712203-2-lxd-2 systemd[1]: Started Service for snap application kube-proxy.daemon.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-apiserver.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 kube-proxy.
Aug 31 18:39:57 juju-712203-2-lxd-2 systemd[1]: snap.kube-
Aug 31 18:39:57 juju-712203-2-lxd-2 systemd[1]: snap.kube-
(END)
# ----- LXD profile
root@k8s-
+------
| NAME | DESCRIPTION | USED BY |
+------
| default | Default LXD profile | 6 |
+------
| juju-kubernetes
+------
root@k8s-
config:
linux.
raw.lxc: |
lxc.
lxc.
lxc.
lxc.cap.drop=
security.nesting: "true"
security.
description: ""
devices:
aadisable:
path: /dev/kmsg
source: /dev/kmsg
type: unix-char
name: juju-kubernetes
used_by:
- /1.0/instances/
description: | updated |
tags: | added: backport-needed |
Changed in charm-kubernetes-master: | |
status: | Fix Committed → Fix Released |
I manually added missing kernel modules to the lxc profile modules: ip_tables, ip6_tables, netlink_ diag,nf_ nat,overlay, rbd,ip_ vs,ip_vs_ rr,ip_vs_ wrr,ip_ vs_sh
linux.kernel_
And restarted the LXD machine
# -----
Now it is not complaining any more about the missing required modules
But I am getting a different error
-- The job identifier is 3100. daemon[ 20359]: I0831 19:34:15.291947 20359 server.go:224] "Warning, all flags other than --config, --write-config-to, and --cleanup are deprecated, please begin using a config file ASAP" daemon[ 20359]: I0831 19:34:15.317546 20359 node.go:163] Successfully retrieved node IP: 192.168.20.167 daemon[ 20359]: I0831 19:34:15.317578 20359 server_ others. go:109] "Detected node IP" address= "192.168. 20.167" daemon[ 20359]: E0831 19:34:15.324909 20359 proxier.go:670] "Failed to read builtin modules file, you can ignore this message when kube-proxy is running inside container without mounting /lib/modules" err="open /lib/modules/ 5.4.0-155- generic/ modules. builtin: no such file or directory" filePath= "/lib/modules/ 5.4.0-155- generic/ modules. builtin" daemon[ 20359]: I0831 19:34:15.327412 20359 proxier.go:680] "Failed to load kernel module with modprobe, you can ignore this message when kube-proxy is running inside container without mounting /lib/modules" moduleName="ip_vs" daemon[ 20359]: I0831 19:34:15.329861 20359 proxier.go:680] "Failed to load kernel module with modprobe, you can ignore this message when kube-proxy is running inside container without mounting /lib/modules" moduleName= "ip_vs_ rr" daemon[ 20359]: I0831 19:34:15.332300 20359 proxier.go:680] "Failed to load kernel module with modprobe, you can ignore this message when kube-proxy is running inside container without mounting /lib/modules" moduleName= "ip_vs_ wrr" daemon[ 20359]: I0831 19:34:15.334656 20359 proxier.go:680] "Failed to load kernel module with modprobe, you can ignore this message when kube-proxy is running inside container without mounting /lib/modules" moduleName= "ip_vs_ sh" daemon[ 20359]: I0831 19:34:15.337175 20359 proxier.go:680] "Failed to load kernel module with modprobe, you can ignore this message when kube-proxy is running inside container without mounting /lib/modules" moduleName= "nf_conntrack" daemon[ 20359]: E0831 19:34:15.337361 20359 server.go:492] "Error running ProxyServer" err="can't use the IPVS proxier: error getting ipset version, error: executable file not found in $PATH" daemon[ 20359]: E0831 19:34:15.337387 20359 run.go:74] "command failed" err="can't use the IPVS proxier: error getting ipset version, error: executable file not found in $PATH"
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 kube-proxy.
Aug 31 19:34:15 juju-712203-0-lxd-3 systemd[1]: snap.kube-pr...