4 篇文章带有标签 “cluster-setup”

安装Kubernetes 1.26.0

Master 节点

查询可用安装包的信息

$ apt-cache madison kubeadm | head
kubeadm |  1.26.0-00 | https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 Packages
kubeadm |  1.25.5-00 | https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 Packages

切换 root 用户

su - root

更新

apt -y update
apt -y install docker-ce docker-ce-cli containerd.io
apt -y install kubelet=1.26.0-00 kubeadm=1.26.0-00 kubectl=1.26.0-00

安装 Kubernetes $ kubeadm reset -f $ kubeadm init --kubernetes-version=1.26.0 --image-repository=registry.aliyuncs.

安装Kubernetes Dashboard

用户界面 Dashboard

Dashboard 是基于网页的 Kubernetes 用户界面。您可以使用 Dashboard 将容器应用部署到 Kubernetes 集群中,也可以对容器应用排错,还能管理集群资源。您可以使用 Dashboard 获取运行在集群中的应用的概览信息,也可以创建或者修改 Kubernetes 资源(如 Deployment,Job,DaemonSet 等等)。例如,您可以对 Deployment 实现弹性伸缩、发起滚动升级、重启 Pod 或者使用向导创建新的应用。

部署 Dashboard

安装 Dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml

过几分钟后您将看到 kubernetes-dashboard 名字空间下会有 Pod 运行。

安装Kubernetes 1.21.5

删除 Kubernetes 旧版本,安装 Kubernetes 1.21.5。

必备安装

每台服务器都需要

root 登录

su - root

设置时区

timedatectl set-timezone Asia/Shanghai

设置主机名

hostnamectl set-hostname new-hostname

安装 Docker-CE

apt-get -y update
apt-get -y install apt-transport-https ca-certificates curl software-properties-common

# 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | apt-key add -

# 写入软件源信息
add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

# 更新并安装
apt-get -y update
apt-get -y install docker-ce docker-ce-cli containerd.io

minikube

安装

安装 kubectl

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl

安装 minikube

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
install minikube-linux-amd64 /usr/local/bin/minikube

启动 Kubernetes 集群 # minikube start --force 😄 Centos 8.1.1911 (amd64) 上的 minikube v1.22.