版本:
docker: 19.03.5
kubernetes: 1.17.0
istio: 1.4.3
步骤一:给ubuntu换源
https://www.cnblogs.com/lfri/p/10612037.html
步骤二:装docker
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce=5:19.03.5~3-0~ubuntu-xenial
sudo docker --version
https://www.cnblogs.com/jiyang2008/p/9014960.html
步骤三:装kubernetes(k8s)
sudo apt install -y kubelet-1.17.0 kubeadm-1.17.0 kubectl-1.17.0
如果不能执行,就把版本号去掉,默认安装最新版本
kubeadm config images list
显示需要拉取的Images,如果提示权限,前面加sudo
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.17.0 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.17.0 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.17.0 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.17.0 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.4.3-0 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.6.5
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1 k8s.gcr.io/pause:3.1 docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.17.0 k8s.gcr.io/kube-apiserver:v1.17.0 docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.17.0 k8s.gcr.io/kube-controller-manager:v1.17.0 docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.17.0 k8s.gcr.io/kube-scheduler:v1.17.0 docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.17.0 k8s.gcr.io/kube-proxy:v1.17.0 docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.4.3-0 k8s.gcr.io/etcd:3.4.3-0 docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.6.5 k8s.gcr.io/coredns:1.6.5
执行Init
kubeadm init --kubernetes-version=v1.17.0 --pod-network-cidr 192.168.0.0/16
出现cgroupd有关错误:
cd /etc/docker sudo touch daemon.json sudo vim daemon.json // 添加内容: { "exec-opts":["native.cgroupdriver=systemd"] }
sudo service docker restart sudo systemctl status docker
出现swap有关错误:
swapoff -a
再次执行init命令:
按照提示添加:
执行完继续执行:
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl get pod -n kube-system // 查看状态
步骤四:安装istio
我是直接安装的最新版本
mkdir istio cd istio curl -L https://git.io/getLatestIstio | sh -
下载速度很慢,建议...
下载完后在istio目录下会有个istio-1.4.3文件夹
vim /etc/profile
添加上面提示的路径。
source /etc/profile echo $PATH
istioctl verify-install
查看版本:
istioctl version --remote=false
k8s和istio安装成功!
参考:
https://blog.csdn.net/weixin_42711936/article/details/96897915
https://blog.csdn.net/weixin_42711936/article/details/97041456
https://blog.csdn.net/weixin_42711936/article/details/99311796
https://blog.csdn.net/weixin_34378767/article/details/92211061
https://www.cnblogs.com/liuluopeng/p/12098071.html
表示万分感谢!
原文地址:https://www.cnblogs.com/SamNicole1809/p/12172887.html