【发布时间】:2021-07-02 14:57:26
【问题描述】:
最近我确实在使用仿生 ubuntu 和 lxc 的旧双核 AMD 机器上使用 kubeadm 安装了 kubernetes。
这是我在网上找到的 lxc 个人资料:
config:
limits.cpu: "2"
limits.memory: 2GB
limits.memory.swap: "false"
linux.kernel_modules: nf_conntrack_ipv4,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
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"
description: LXD profile for Kubernetes
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: k8s
used_by:
- /1.0/containers/kmaster1
- /1.0/containers/kworker1
我确实跑了:
# mount --make-rshared /
# lxc config device add "kmaster1" "kmsg" unix-char source="/dev/kmsg" path="/dev/kmsg"
# lxc config device add "kworker1" "kmsg" unix-char source="/dev/kmsg" path="/dev/kmsg"
kube-proxy 无法运行,因为此错误消息:
write /sys/module/nf_conntrack/parameters/hashsize: operation not supported
所以我确实通过编辑kube-proxy 配置并将连接跟踪设置为零来修复它。
之后我确实将flannel 部署为cni。
我的 Pod 现在无法访问默认集群 IP 10.96.0.1,但是服务在那里:
#kubectl describe svc kubernetes
Name: kubernetes
Namespace: default
Labels: component=apiserver
provider=kubernetes
Annotations: <none>
Selector: <none>
Type: ClusterIP
IP Families: <none>
IP: 10.96.0.1
IPs: 10.96.0.1
Port: https 443/TCP
TargetPort: 6443/TCP
Endpoints: 10.46.157.182:6443
Session Affinity: None
Events: <none>
可能禁用连接跟踪会产生问题,并且正在使用NAT,我不知道。
有什么办法解决吗?
【问题讨论】:
标签: kubernetes lxc flannel lxd