我是靠谱客的博主 友好大白,最近开发中收集的这篇文章主要介绍实战:部署K8S,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

https://blog.51cto.com/14154700/category16.html/p2
192.168.37.128 master
192.168.37.129 node01
192.168.37.130 node02

问题1、初始化提示时host连接被拒绝,需要在maste的host上配置localhost对的解析

kubeadm init --apiserver-advertise-address=0.0.0.0 --apiserver-cert-extra-sans=127.0.0.1 --image-repository=registry.aliyuncs.com/google_containers --ignore-preflight-errors=all --kubernetes-version=v1.19.0 --service-cidr=10.10.0.0/16 --pod-network-cidr=10.122.0.0/16

https://blog.csdn.net/tianyouyexin/article/details/95225036

https://blog.51cto.com/yw666/2489128

https://www.lagou.com/lgeduarticle/8789.html


[addons] Applied essential addon: kube-proxy

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

  export KUBECONFIG=/etc/kubernetes/admin.conf

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.37.128:6443 --token lbetx8.izbcgwhgmllog5ez
    --discovery-token-ca-cert-hash sha256:52f3952b86d6898d486ccb132d88b18ab1284316aed5d8e1ba5399a7ba6f4c6f
[root@master ~]#

问题2、下载kubernetes-dashboard失败,提示443拒绝,https://blog.csdn.net/witton/article/details/107085155,
https://www.jianshu.com/p/be2a12a8bc0b 可以自行下载此文件https://github.com/kubernetes/dashboard/blob/master/aio/deploy/recommended.yaml        

wget  https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc7/aio/deploy/recommended.yaml

登录token
eyJhbGciOiJSUzI1NiIsImtpZCI6Ik9mTTVpenAyS2NVUm4ybTNVSVZyNEt0enFpNTRhbDdlRXZjY0JVbEVzakkifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdG9rZW4tNGc1bnAiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGFzaGJvYXJkLWFkbWluIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiZDJkYWFjYTQtMTk4Ny00ZmQ2LWJmMjItNDdkYThlYTcxMTBiIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmRhc2hib2FyZC1hZG1pbiJ9.NVCNBx2ZIwRnEth-zTlaCylxFPTA5RKzScpkKQ8as24ZtmdXgf3cwpFrYWMk1gqf60xiDBHDz7DBWN8S8FOf17jRAJNSLT-Fq8nWelESRJZYBsZGxgdXWTigDDAbUSjogsntGN7oak9Drqt22vyjU9fYPVzDddB8q3L-uYbzeshVVYxT9bSvQ8N1osIcO7Xhm_BcnvpOS8d2QrKbGFCEUp7WA4zNSfXejYFyVjJewdGk35JXMniSnIaGZmQCpYC39CvLe5_Lq1lo44SbsyDjKRGwgBCrEamjK2Bw1Pedbq95RhDSu_NuqGfRwaCN_QhAs8-dfi7diWlfg50A1HEkeA


讲node加入到master  https://www.cnblogs.com/caoxb/p/11243472.html

集群测试  https://blog.51cto.com/3241766/2405624     https://www.cnblogs.com/caoxb/p/11243472.html

node节点异常https://www.cnblogs.com/lph970417/p/11805934.html  node节点也要安装和master节点一样的网络

由于节点异常部署了错误的pod,删除错误的pod  https://www.cnblogs.com/effortsing/p/10496547.html
docker启动和停止https://blog.csdn.net/qq_35971258/article/details/88730237

dashboard使用https://www.alibabacloud.com/help/zh/doc-detail/86507.htm    https://help.aliyun.com/document_detail/86507.html

扩缩容https://blog.51cto.com/14320361/2464655


kubectl set image deployment nginx web=nginx:1.15

最后

以上就是友好大白为你收集整理的实战:部署K8S的全部内容,希望文章能够帮你解决实战:部署K8S所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部