Ubuntu 18.04
Kubernete 在 JUJU 上
我尝试删除节点上的污点:
kubectl get nodes -o json | jq .items[].spec.taints [ { "effect": "NoSchedule", "key": "node.kubernetes.io/unreachable", "timeAdded": "2019-06-12T20:38:52Z" } ] [ { "effect": "NoSchedule", "key": "node.kubernetes.io/unreachable", "timeAdded": "2019-06-12T20:38:57Z" } ] [ { "effect": "NoSchedule", "key": "node.kubernetes.io/unreachable", "timeAdded": "2019-06-12T20:39:00Z" } ]
with this command:
kubectl patch node juju-06819a-0-lxd-70 -p '{"spec":{"taints":[]}}'
node/juju-06819a-0-lxd-70 patched rastin@cloudrnd1:~/.kube$ kubectl patch node juju-06819a-0-lxd-71 -p '{"spec":{"taints":[]}}' node/juju-06819a-0-lxd-71 patched rastin@cloudrnd1:~/.kube$ kubectl patch node juju-06819a-0-lxd-72 -p '{"spec":{"taints":[]}}' node/juju-06819a-0-lxd-72 patched
什么都没发生,所有的污点仍然存在!
答案1
我在这里找到了解决方案,但稍作改动:
https://github.com/charmed-kubernetes/bundle/wiki/Deploying-on-LXD#the-profile
在装有 LXD 的机器上,我更改了配置文件以使用“dir”:
name: juju-##MODEL## config: boot.autostart: "true" linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay raw.lxc: | lxc.apparmor.profile=unconfined lxc.mount.auto=proc:rw sys:rw lxc.cap.drop= security.nesting: "true" security.privileged: "true" description: "" devices: aadisable: path: /sys/module/nf_conntrack/parameters/hashsize source: /dev/null type: disk aadisable1: path: /sys/module/apparmor/parameters/enabled source: /dev/null type: disk
然后我将这个配置文件应用到我的 LXC:
sudo lxc profile assign <container-name> default Profiles default applied to <container-name>
您可以通过运行以下命令获取“容器名称”:$lxc list
然后我重新启动了所有容器:
$sudo lxc restart --all
现在所有节点都已准备就绪:
$kubectl get nodes NAME STATUS ROLES AGE VERSION container#1 Ready <none> 6d v1.14.2 container#2 Ready <none> 6d v1.14.2 container#3 Ready <none> 3d v1.14.2