Ubuntu 安裝k8s叢集
前言
一.修改 ubuntu 配置
關閉 swap 記憶體
swapoff -a
配置免密登入
二.安裝docker
docker 的安裝
sudo apt install docker.io
docker --version
docker 的配置
三.安裝kubeadm、kubectl以及kubelet
apt-get update && apt-get install -y apt-transport-https
curl | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
root@master01:/app# systemctl start kubelet root@master01:/app# systemctl enable kubelet
四. 配置master 節點
1.系統配置預檢查
2.準備映象
root@master01:/app# kubeadm config images list k8s.gcr.io/kube-apiserver:v1.23.5 k8s.gcr.io/kube-controller-manager:v1.23.5 k8s.gcr.io/kube-scheduler:v1.23.5 k8s.gcr.io/kube-proxy:v1.23.5 k8s.gcr.io/pause:3.6 k8s.gcr.io/etcd:3.5.1-0 k8s.gcr.io/coredns/coredns:v1.8.6
root@master01:/app# kubeadm config images pull --image-repository=registry.aliyuncs.com/google_containers
root@master01:/app# docker tag registry.aliyuncs.com/google_containers/kube-apiserver:v1.23.5 k8s.gcr.io/kube-apiserver:v1.23.5
3.配置master節點
root@master01:/app# kubeadm init --image-repository registry.aliyuncs.com/google_containers --pod-network-cidr=192.168.0.0/16
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: Then you can join any number of worker nodes by running the following on each as root: kubeadm join 192.168.130.239:6443 --token 6k1i68.aml4dfgyfqwcezkp \ --discovery-token-ca-cert-hash sha256:85eedec31c61177648373d4c7a8a547aa0e0a0816fe91601a99352c84d9545f0
4.配置 kubectl 工具
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=/etc/kubernetes/admin.conf
# 檢視已加入的節點 kubectl get nodes # 檢視叢集狀態 kubectl get cs
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2905751/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos安裝k8s叢集CentOSK8S
- Ubuntu上kubeadm安裝Kubernetes叢集Ubuntu
- 在Ubuntu 18.04.1上安裝Hadoop叢集UbuntuHadoop
- 用 edgeadm 一鍵安裝邊緣 K8s 叢集和原生 K8s 叢集K8S
- 安裝 REDIS 叢集Redis
- 安裝Kafka叢集Kafka
- 【K8S】基於單Master節點安裝K8S叢集K8SAST
- 二進位制安裝k8s高可用叢集(七):安裝外掛K8S
- k8s第二回之k8s叢集的安裝K8S
- 完整安裝always on叢集
- 安裝Consul叢集
- 快速安裝 kafka 叢集Kafka
- FastDFS 叢集 安裝 配置AST
- 基於Ubuntu部署企業級kubernetes叢集---k8s叢集容部署UbuntuK8S
- ubuntu安裝docker及k8sUbuntuDockerK8S
- k8s叢集安裝-kubeadm安裝K8S
- redis-3.0.6 安裝叢集Redis
- redis 5.0 叢集的安裝Redis
- 安裝Zookeeper和Kafka叢集Kafka
- 安裝Greenplum 5.2 叢集實戰
- Cloudera Manager安裝 & 搭建CDH叢集Cloud
- Redis安裝+叢集+效能監控Redis
- CDH安裝大資料叢集大資料
- CentOS7 安裝PG叢集CentOS
- CentOS6.5 安裝Zookeeper叢集CentOS
- CentOS6.5安裝Twemproxy叢集CentOS
- CentOS6.5 安裝Storm叢集CentOSORM
- CentOS6.5 安裝Kafka叢集CentOSKafka
- CentOS6.5 安裝Spark叢集CentOSSpark
- Redis叢集環境安裝指南Redis
- centos安裝redis3.0.0叢集CentOSRedisS3
- CentOS 7.4 安裝 K8S v1.11.0 叢集所遇到的問題CentOSK8S
- 二進位制安裝k8s高可用叢集(六):Node節點配置K8S
- 第一章 1.1.1節 Kubeadm安裝K8S高可用叢集K8S
- k8s之叢集管理K8S
- 多k8s叢集管理K8S
- k8s 叢集升級K8S
- 刪除k8s叢集K8S