Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

体验 Kubeadm #309

Open
nonocast opened this issue Jul 6, 2022 · 0 comments
Open

体验 Kubeadm #309

nonocast opened this issue Jul 6, 2022 · 0 comments

Comments

@nonocast
Copy link
Owner

nonocast commented Jul 6, 2022

Version: multipass 1.9.1+mac, ubuntu 20.04, kubeadm 1.24.2, macOS 12.3.1

multipass

  • Multipass 旋风教程 - 知乎
  • 因为kube的配置需要2核1700M内存,所以需要添加参数: multipass launch --name primary --cpus 2 --mem 2000M 20.04

kubeadm

部署Kubernetes的Master节点

  • multipass launch --name primary --cpus 2 --mem 2000M 20.04
  • install docker: sudo apt-get install docker.io
  • Installing kubeadm | Kubernetes
  • kubeadm init
  • 然后会得到join的token: kubeadm join 192.168.64.7:6443 --token sbi9z4.ls0jkyknux490hyp \ --discovery-token-ca-cert-hash sha256:f9ae8a51a2c8a1f7c9bff731cdf1ba97fd945fdd0ea28db532f2e338d6c21338
  • 部署网络插件 kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
  • 通过 kubectl get pods -n kube-system 检查Pod运行状态
  • 最后通过kubectl describe node primary检查运行状态服务是否ready

部署Kubernetes的Worker节点

  • multipass launch --name worker1 --cpus 2 --mem 2000M 20.04
  • install docker: sudo apt-get install docker.io
  • Installing kubeadm | Kubernetes
  • kubeadm join 192.168.64.7:6443 --token sbi9z4.ls0jkyknux490hyp \ --discovery-token-ca-cert-hash sha256:f9ae8a51a2c8a1f7c9bff731cdf1ba97fd945fdd0ea28db532f2e338d6c21338

然后在primary上检查,

~ kubectl get nodes
NAME      STATUS   ROLES           AGE     VERSION
primary   Ready    control-plane   38m     v1.24.2
worker1   Ready    <none>          2m28s   v1.24.2
~  
~ kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS    MESSAGE                         ERROR
controller-manager   Healthy   ok                              
scheduler            Healthy   ok                              
etcd-0               Healthy   {"health":"true","reason":""}   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant