问题描述
我正在学习 Juju,我觉得它很棒,但像往常一样有问题,很少有人能解释它是如何工作的。我希望你们中的任何人都可以指导我。
问题:部署图表仅适用于 LXD 控制器。在 microk8s 中不起作用。我能做什么?为什么会发生这种情况?
列出控制器,有两个。一个 microk8s(已经安装了 Ubuntu 20.04)和
LXD Hypervisor for localhost (that I dont know perfectly what it is)
Controller Model User Access Cloud/Region Models Nodes HA Version
lxd-staging* lxd-staging-model admin superuser localhost/localhost 3 1 none 2.8.7
microk8s-staging microk8s-staging-model admin superuser microk8s/localhost 2 1 - 2.8.7
列出模型,每个控制器一个
administrator@master-ubuntu:~$ juju models -c lxd-staging
Controller: lxd-staging
Model Cloud/Region Type Status Machines Access Last connection
controller localhost/localhost lxd available 1 admin just now
default localhost/localhost lxd available 0 admin 3 minutes ago
lxd-staging-model* localhost/localhost lxd available 0 admin 31 seconds ago
administrator@master-ubuntu:~$ juju models -c microk8s-staging
Controller: microk8s-staging
Model Cloud/Region Type Status Access Last connection
controller microk8s/localhost kubernetes available admin just now
microk8s-staging-model* microk8s/localhost kubernetes available admin never connected
在 LXD 中部署,按预期工作。
administrator@master-ubuntu:~$ juju models
Controller: lxd-staging
Model Cloud/Region Type Status Machines Access Last connection
controller localhost/localhost lxd available 1 admin just now
default localhost/localhost lxd available 0 admin 10 minutes ago
lxd-staging-model* localhost/localhost lxd available 0 admin 8 minutes ago
administrator@master-ubuntu:~$ juju deploy mysql mysqldb
Located charm "cs:mysql-58".
Deploying charm "cs:mysql-58".
在 microk8s 中部署,错误。
administrator@master-ubuntu:~$ juju models
Controller: microk8s-staging
Model Cloud/Region Type Status Access Last connection
controller microk8s/localhost kubernetes available admin just now
microk8s-staging-model* microk8s/localhost kubernetes available admin never connected
administrator@master-ubuntu:~$ juju deploy mysql mysqldb
ERROR series "xenial" in a kubernetes model not valid
解决方法
发生这种情况是因为在编写 Charm 时没有考虑到 Kubernetes。在理想的世界中,这应该无关紧要,但底层子系统确实如此。正在努力纠正此问题,但现在您可以将 MariaDB 用于 Kubernetes。