Kubernetes之安装minikube

厌伴老儒烹瓠叶,强随举子踏槐花。这篇文章主要讲述Kubernetes之安装minikube相关的知识,希望能为你提供帮助。
https://www.cnblogs.com/pack27/p/12202687.html(https://www.cnblogs.com/pack27/p/12202687.html
https://www.jianshu.com/p/18441c7434a6
一,安装docker

#Step 2:安装必要包 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 # Step 2: 添加软件源信息 sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # Step 3: 更新并安装Docker-CE sudo yum makecache fast sudo yum -y install docker-ce # Step 4: 开启Docker服务 sudo service docker start systemctl enable docker

二,安装kubectl
下载二进制包https://github.com/kubernetes/kubernetes/releases
解压 后把可执行程序kubectl移动至/usr/local/bin
三,安装minikube
下载
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

安装
mv minikube-linux-amd64 minikube chmox +x minikube mv minikube /usr/local/bin/ #安装需要设置成国内源 minikube start --image-repository=\'registry.cn-hangzhou.aliyuncs.com/google_containers\'

查看
# kubectl get cs,node NAMESTATUSMESSAGEERROR componentstatus/schedulerHealthyok componentstatus/controller-managerHealthyok componentstatus/etcd-0Healthy{"health":"true"}NAMESTATUSROLESAGEVERSION node/k8s-minikubeReadymaster17mv1.17.3

创建一个测试用例
kubectl run nginx --image=nginx --port=80 kubectl expose deployment nginx --port=80 --target-port=80 --type=NodePort

查看
# kubectl get node,svc NAMESTATUSROLESAGEVERSION node/k8s-minikubeReadymaster19mv1.17.3NAMETYPECLUSTER-IPEXTERNAL-IPPORT(S)AGE service/kubernetesClusterIP10.96.0.1< none> 443/TCP19m service/nginxNodePort10.106.214.5< none> 80:30807/TCP15m

【Kubernetes之安装minikube】能使用node加NodePort端口访问即可,单机minikube搭建完成,可由于开发及测试。

    推荐阅读