LXC 上的 microk8s:服务 snap.microk8s.daemon-proxy 未运行

LXC 上的 microk8s:服务 snap.microk8s.daemon-proxy 未运行

我在 LXD 容器中安装了 microk8s

snap install microk8s --classic

当我检查实例时,它显示 snap.microk8s.daemon-proxy 没有运行

root@mk8s1:~# microk8s inspect
Inspecting Certificates
Inspecting services
  Service snap.microk8s.daemon-cluster-agent is running
  Service snap.microk8s.daemon-containerd is running
  Service snap.microk8s.daemon-apiserver is running
  Service snap.microk8s.daemon-apiserver-kicker is running
 FAIL:  Service snap.microk8s.daemon-proxy is not running
For more details look at: sudo journalctl -u snap.microk8s.daemon-proxy
  Service snap.microk8s.daemon-kubelet is running
  Service snap.microk8s.daemon-scheduler is running
  Service snap.microk8s.daemon-controller-manager is running
  Copy service arguments to the final report tarball
Inspecting AppArmor configuration
Gathering system information
  Copy processes list to the final report tarball
  Copy snap list to the final report tarball
  Copy VM name (or none) to the final report tarball
  Copy disk usage information to the final report tarball
  Copy memory usage information to the final report tarball
  Copy server uptime to the final report tarball
  Copy current linux distribution to the final report tarball
  Copy openSSL information to the final report tarball
  Copy network configuration to the final report tarball
Inspecting kubernetes cluster
  Inspect kubernetes cluster

Building the report tarball
  Report tarball is at /var/snap/microk8s/1769/inspection-report-20201110_051804.tar.gz
root@mk8s1:~# 

我应该如何在 LXD 容器中设置 microk8s?这就是我所做的。创建配置文件

lxc profile copy default microk8s
cat microk8s.profile | lxc profile edit microk8s

简介如下

name: microk8s
config:
  boot.autostart: "true"
  linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
  raw.lxc: |
    lxc.apparmor.profile=unconfined
    lxc.mount.auto=proc:rw sys:rw cgroup:rw
    lxc.cgroup.devices.allow=a
    lxc.cap.drop=
  security.nesting: "true"
  security.privileged: "true"
description: ""
devices:
  aadisable:
    path: /sys/module/nf_conntrack/parameters/hashsize
    source: /sys/module/nf_conntrack/parameters/hashsize
    type: disk
  aadisable1:
    path: /sys/module/apparmor/parameters/enabled
    source: /dev/null
    type: disk
  aadisable2:
    path: /dev/kmsg
    source: /dev/kmsg
    type: disk

启动容器mk8s1

lxc launch -p default -p microk8s ubuntu:18.04 mk8s1

在容器中运行

apt update && apt dist-upgrade -y && apt install squashfuse -y
snap install microk8s --classic

我在这里遗漏了什么?

答案1

好的。在 LXC 中找到了适合我的解决方案

https://github.com/ubuntu/microk8s/issues/1438

尝试添加--conntrack-max-per-core=0/var/snap/microk8s/current/args/kube-proxy重启 microk8s

相关内容