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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Ubuntu上kubeadm安裝Kubernetes叢集Ubuntu
- centos安裝k8s叢集CentOSK8S
- 在Ubuntu 18.04.1上安裝Hadoop叢集UbuntuHadoop
- 用 edgeadm 一鍵安裝邊緣 K8s 叢集和原生 K8s 叢集K8S
- 安裝Kafka叢集Kafka
- 安裝Consul叢集
- 基於Ubuntu部署企業級kubernetes叢集---k8s叢集容部署UbuntuK8S
- 【K8S】基於單Master節點安裝K8S叢集K8SAST
- 二進位制安裝k8s高可用叢集(七):安裝外掛K8S
- 完整安裝always on叢集
- 快速安裝 kafka 叢集Kafka
- k8s第二回之k8s叢集的安裝K8S
- k8s叢集安裝-kubeadm安裝K8S
- ubuntu安裝docker及k8sUbuntuDockerK8S
- redis-3.0.6 安裝叢集Redis
- redis 5.0 叢集的安裝Redis
- 安裝Zookeeper和Kafka叢集Kafka
- Zookeeper3.4.14(單叢集)、Kafka_2.12-2.2.2(叢集)安裝Kafka
- Redis安裝+叢集+效能監控Redis
- CDH安裝大資料叢集大資料
- CentOS7 安裝PG叢集CentOS
- Cloudera Manager安裝 & 搭建CDH叢集Cloud
- 安裝Greenplum 5.2 叢集實戰
- ARM架構安裝Kubernetes叢集架構
- 第一章 1.1.1節 Kubeadm安裝K8S高可用叢集K8S
- CentOS 7.4 安裝 K8S v1.11.0 叢集所遇到的問題CentOSK8S
- 二進位制安裝k8s高可用叢集(六):Node節點配置K8S
- K8S學習教程(一):使用PetaExpress雲伺服器安裝Minikube 叢集K8SExpress伺服器
- Zookeeper-3.4.10 叢集的安裝配置
- Cassandra安裝及分散式叢集搭建分散式
- Kubernetes安裝之三:etcd叢集的配置
- kubernetes叢集的安裝異常彙總
- Redis安裝之叢集-哨兵模式(sentinel)模式Redis模式
- Linux原始碼安裝RabbitMQ高可用叢集Linux原始碼MQ
- 分散式 PostgreSQL 叢集(Citus)官方安裝指南分散式SQL
- 安裝配置 zookeeper (單機非叢集模式)模式
- docker-compose安裝rocketmq雙主叢集DockerMQ
- 刪除k8s叢集K8S