随笔 - 404  文章 - 4  评论 - 0  阅读 - 25万

Kubernetes集群部署方式

  • 官方推荐的三种部署方式

  • minikube

Minikube是一个工具,可以在本地快速运行一个单点的Kubernetes,仅用于尝试Kubernetes或日常开发的用户使用。

部署地址:https://kubernetes.io/docs/setup/minikube/

  • kubeadm

Kubeadm工具,提供kubeadm init和kubeadm join,用于快速部署Kubernetes集群

部署地址:https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/

  • 二进制

推荐,从官方下载发行版的二进制包手动部署每个组件,组成Kubernets集群

下载地址:https://github.com/kubernetes/kubernetes/releases

  • kubeadm工具部署Kubernetes集群 

192.168.10.81 k8s-master  CentOS7.4
192.168.10.82 k8s-node1  CentOS7.4
192.168.10.83 k8s-node2  CentOS7.4

[root@k8s-master ~]# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
The connection to the server raw.githubusercontent.com was refused - did you specify the right host or port?

解决方案:https://blog.csdn.net/weixin_38074756/article/details/109231865

# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.10.81 k8s-master
192.168.10.82 k8s-node1
192.168.10.83 k8s-node2

185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.1111.133 raw.githubusercontent.com

kubeadm join 192.168.10.81:6443 --token cou3lz.por1p02ys9qcscc5 \
--discovery-token-ca-cert-hash sha256:dbcf75532c6eec7b17d74148432f042b57c656f69e6c0a946178f61247ba165d

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@k8s-master ~]# kubectl get nodes
NAME         STATUS   ROLES    AGE     VERSION
k8s-master   Ready    master   24m     v1.18.3
k8s-node1    Ready    <none>   2m52s   v1.18.3
k8s-node2    Ready    <none>   2m42s   v1.18.3
[root@k8s-master ~]# kubectl get pod --all-namespaces
NAMESPACE     NAME                                 READY   STATUS    RESTARTS   AGE
kube-system   coredns-7ff77c879f-p5v7b             1/1     Running   0          24m
kube-system   coredns-7ff77c879f-zdxp9             1/1     Running   0          24m
kube-system   etcd-k8s-master                      1/1     Running   0          24m
kube-system   kube-apiserver-k8s-master            1/1     Running   0          24m
kube-system   kube-controller-manager-k8s-master   1/1     Running   0          24m
kube-system   kube-flannel-ds-2lw2m                1/1     Running   0          2m55s
kube-system   kube-flannel-ds-b79pn                1/1     Running   0          3m55s
kube-system   kube-flannel-ds-jh5kv                1/1     Running   0          2m45s
kube-system   kube-proxy-fgkzn                     1/1     Running   0          2m55s
kube-system   kube-proxy-lrh86                     1/1     Running   0          24m
kube-system   kube-proxy-xv4v2                     1/1     Running   0          2m45s
kube-system   kube-scheduler-k8s-master            1/1     Running   0          24m
[root@k8s-master ~]#

  

 

 

 

 

 

https://www.cnblogs.com/ltzhang/p/13544528.html

 

posted on   HelonTian  阅读(93)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示