标签:tar 容器 download upd href off create map and
一、版本策略
1、kube-apiserver HA升级,小版本号最多差1(必须最先升级apiserver)
例:最新为1.18,其余均为1.18或1.17
2、kubelet,不可高于kube-apiserver,最多差两个版本
例:最新api-server为1.18 kubelet可选为1.18,1.17,1.16
若api-server为1.18,1.17 kubelet可选为1.17,1.16
3、kube-controller-manager, kube-scheduler, and cloud-controller-manager 不得高于apiserver,最多差1个版本,最好同一版本
例:最新apiserver为1.18 kube-controller-manager, kube-scheduler, and cloud-controller-manager可选为1.18,1.17
若apiserver为1.18,1.17 kube-controller-manager, kube-scheduler, and cloud-controller-manager可选为1.17
4、kubectl 可比apiserver搞一个版本或低一个版本
例:最新apiserver为1.17 kubectl可选为1.18,1.17,1.16
若apiserver为1.17,1.16 kubectl可选为1.17,1.16
5,升级策略
1>3>2>4
二、容器引擎
官方文档推荐docker版本为19.03.4,同时1.13.1、17.03、17.06、17.09、18.06 和 18.09 版本也是可以的。
ubuntu:
<!--
# Install Docker CE
## Set up the repository:
### Install packages to allow apt to use a repository over HTTPS
apt-get update && apt-get install \
apt-transport-https ca-certificates curl software-properties-common
### Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
-->
# 安装 Docker CE
## 设置仓库
### 安装软件包以允许 apt 通过 HTTPS 使用存储库
apt-get update && apt-get install \
apt-transport-https ca-certificates curl software-properties-common
### 新增 Docker 的 官方 GPG 秘钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
<!--
### Add Docker apt repository.
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
## Install Docker CE.
apt-get update && apt-get install \
containerd.io=1.2.10-3 \
docker-ce=5:19.03.4~3-0~ubuntu-$(lsb_release -cs) \
docker-ce-cli=5:19.03.4~3-0~ubuntu-$(lsb_release -cs)
# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
-->
### 添加 Docker apt 仓库
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
## 安装 Docker CE
apt-get update && apt-get install docker-ce=18.06.2~ce~3-0~ubuntu
# 设置 daemon
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
<!--
# Restart docker.
systemctl daemon-reload
systemctl restart docker
-->
# 重启 docker.
systemctl daemon-reload
systemctl restart docker
centos
<!--
# Install Docker CE
## Set up the repository
### Install required packages.
yum install yum-utils device-mapper-persistent-data lvm2
### Add Docker repository.
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
## Install Docker CE.
yum update && yum install \
containerd.io-1.2.10 \
docker-ce-19.03.4 \
docker-ce-cli-19.03.4
## Create /etc/docker directory.
mkdir /etc/docker
# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
-->
# 安装 Docker CE
## 设置仓库
### 安装所需包
yum install yum-utils device-mapper-persistent-data lvm2
### 新增 Docker 仓库。
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
## 安装 Docker CE.
yum update && yum install docker-ce-18.06.2.ce
## 创建 /etc/docker 目录。
mkdir /etc/docker
# 设置 daemon。
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
<!--
# Restart Docker
systemctl daemon-reload
systemctl restart docker
-->
# 重启 Docker
systemctl daemon-reload
systemctl restart docker
三、内核升级
CentOS 7.x 系统自带的 3.10.x 内核存在一些 Bugs,导致运行的 Docker、Kubernetes 不稳定,例如:
(1)、 在重启docker过程中,机器宕机重启
(2)、 部署服务时,出现机器crush问题
1、下载内核rpm包
2、将rpm包安装
yum -y install kernel-ml-devel-4.14.15-1.el7.elrepo.x86_64.rpm && yum -y install kernel-ml-4.14.15-1.el7.elrepo.x86_64.rpm
3、查看内核
awk -F\‘ ‘$1=="menuentry " {print i++ " : " $2}‘ /etc/grub2.cfg
0 : CentOS Linux (4.14.15-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)
2 : CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
3 : CentOS Linux (0-rescue-063ec330caa04d4baae54c6902c62e54) 7 (Core)
4、设置内核
grub2-set-default 0
5、重启
reboot
参考资料
https://kubernetes.io/zh/
标签:tar 容器 download upd href off create map and
原文地址:https://www.cnblogs.com/devopsxu/p/13182017.html