Docker+kubectl+Minikube+Helm+Istio安裝
安裝環境
VMware
CentOS7 mini
CPU 4核
內存 4G
Docker 安裝
yum install docker -y
systemctl enable docker
systemctl start docker
更換阿里雲鏡像倉庫,需要在阿里雲註冊
vi /etc/docker/daemon.json
阿里雲Docker鏡像,點擊獲取
{
“registry-mirrors”: [“https://xxxxxxx.mirror.aliyuncs.com”] /這裏輸入阿里給你分配到的鏡像url/
}
kubectl 安裝
添加阿里雲yum鏡像源
cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
yum install -y kubectl
Minikube安裝
下載地址
http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v0.30.0/minikube-linux-amd64
chmod +x minikube
mv minikube /usr/local/bin
無VM方式啓動minikube,需要有docker
minikube start --image-repository=‘registry.cn-hangzhou.aliyuncs.com/google_containers’ --driver=none
驗證,所有pod均正常啓動則沒問題
kubectl get pod -n kube-system
注:內存不足可能會導致kube-system pod 經常重啓
helm安裝
使用的是helm3,不再區分客戶端和服務端,下載即可使用
下載地址,選擇3.0.0+版本
https://github.com/helm/helm/releases
chmod +x helm
mv helm /usr/local/bin
istio安裝
helm repo add istio.io https://storage.googleapis.com/istio-release/releases/1.3.4/charts/
helm repo update
kubectl create namespace istio-system
helm install istio.io/istio-init --namespace istio-system --generate-name
驗證 kubectl get crds | grep ‘istio.io’ | wc -l
打印 23 即說明前面步驟沒有問題
helm install istio.io/istio --generate-name --namespace istio-system
注:CPU或內存不足會導致某些istio pod無法啓動,處於pending
具體原因查看
kubectl describe pod pod-name -n istio-system