使用Ubuntu單機測試

安裝MicroK8,使用snap安裝。Microk8s是輕量級的,可以在Ubuntu上本地部署所有Kubernetes服務。適用於:

  • 筆記本電腦:在本地開發微服務

  • 工作站:在本地開發和培訓機器學習模型

  • CI管道:快速創建臨時Kubernetes以測試微服務

  • 物聯網設備:將可升級的Kubernetes嵌入您的物聯網設備中以輕鬆進行升級

  • 小型邊緣雲:為邊緣雲創建簡單的Kubernetes集群

sudo microk8s.start

sudo microk8s.status

sudo snap alias microk8s.kubectl kubectl

sudo kubectl

sudo kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:16443
sudo microk8s.kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1
sudo microk8s.kubectl get pods
sudo usermod -a -G microk8s $USER

snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks

sudo apparmor_parser -r /etc/apparmor.d/*snap-confine*
sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap-confine*

Last updated