Centos下安装minikube
https://blog.csdn.net/fishinhouse/article/details/80589683
GitHub minikube
Minikube是什么?
Minikube是一种方便在本地运行Kubernetes的工具.
Minikube 是可以在VM中运行单节点的Kubernetes集群.
Minikube是为了开发或测试在本地启动一个节点的kubernetes集群.
特点
不能启动生产集群,没有高可用性的单节点机器.
可以工作在Windows,Linux,MacOS下.
先决条件
需要安装VirtualBox和Minikube
安装Minikube
- 安装minikube
$curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 82.3M 100 82.3M 0 0 4295k 0 0:00:19 0:00:19 --:--:-- 4896k
- 安装kubectl
$curl -Lo kubectl 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
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 68.9M 100 68.9M 0 0 4756k 0 0:00:14 0:00:14 --:--:-- 5385k
$ sudo mv kubectl /usr/local/bin/
- 配置信息
$ export MINIKUBE_WANTUPDATENOTIFICATION=false
$ export MINIKUBE_WANTREPORTERRORPROMPT=false
$ export MINIKUBE_HOME=$HOME
$ export CHANGE_MINIKUBE_NONE_USER=true
$ mkdir $HOME/.kube || true
$ touch $HOME/.kube/config
$ export KUBECONFIG=$HOME/.kube/config
启动Minikube
$ minikube start --vm-driver=virtualbox
Starting local Kubernetes v1.7.0 cluster...
Starting VM...
Downloading Minikube ISO
97.80 MB / 97.80 MB [==============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Starting cluster components...
Connecting to cluster...
Setting up kubeconfig...
Kubectl is now configured to use the cluster.
$ kubectl get nodes
NAME STATUS AGE VERSION
minikube Ready 5s v1.7.0
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-addon-manager-minikube 1/1 Running 0 2h
kube-system kube-dns-910330662-pkvj6 3/3 Running 0 2h
kube-system kubernetes-dashboard-mg5jt 1/1 Running 0 2h
如果minikube启动提示没有找到VboxManage,可以参考Github上的方法:
此参数告诉Kubernetes组件运行在主机上,而非VM虚拟机上。
如果运行在VM上,Docker只需要VM的驱动程序,而非管理程序。
使用主机模式,请确保Docker的网络连接模拟为桥接(bridge network)。
$ minikube start --vm-driver=none
卸载Docker高版本
1、查看已安装的Docker版本
$ yum list installed | grep docker
2、卸载已安装的Docker版本
yum -y remove docker-ce.x86_64
3、查看Docker版本
yum list docker-ce.x86_64 --showduplicates |sort -r
docker-ce.x86_64 18.05.0.ce-3.el7.centos docker-ce-edge
docker-ce.x86_64 18.04.0.ce-3.el7.centos docker-ce-edge
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 18.02.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 18.01.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.11.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.10.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.07.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.05.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.04.0.ce-1.el7.centos docker-ce-edge
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
4、安装Docker 17.03.0.ce
yum install -y docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch
VirtualBox
https://www.jianshu.com/p/b30cec4f257d
k8s之minikube搭建
本文主要介绍在mac中安装minikube,使用minikube启动k8s
安装 Minikube
> brew cask install virtualbox
> brew install kubectl
> kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.1", GitCommit:"3a1c9449a956b6026f075fa3134ff92f7d55f812", GitTreeState:"clean", BuildDate:"2018-01-04T19:58:48Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4", GitTreeState:"clean", BuildDate:"2017-11-29T22:43:34Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}
#启用autocompletion,对于zsh或者使用了oh-my-zsh
> source <(kubectl completion zsh)
> mv minikube-darwin-amd64 /usr/local/bin/minikube
> chmod +x /usr/local/bin/minikube
> minikube version
minikube version: v0.24.1
> wget https://storage.googleapis.com/minikube/iso/minikube-v0.23.6.iso
> mv ~/Downloads/minikube-v0.23.6.iso ~/.minikube/cache/iso
> wget https://storage.googleapis.com/minikube/k8sReleases/v1.8.0/localkube-linux-amd64
> mv ~/Downloads/localkube-linux-amd64 .minikube/cache/localkube/localkube-v1.8.0
> minikube start
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.
> kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
deployment "hello-minikube" created
> kubectl get pod
NAME READY STATUS RESTARTS AGE
hello-minikube-7844bdb9c6-zwcnr 0/1 ContainerCreating 0 0s
貌似看起来一切正常,可惜等了10几分钟状态依然是ContainerCreating,看了下日志
> minikube logs
> brew install privoxy
#修改的配置
forward-socks5t / 127.0.0.1:1080 .
listen-address 192.168.94.1:8118
#启动
> privoxy /usr/local/etc/privoxy/config
> curl -x http://192.168.94.1:8118 "https://gcr.io/v2/" -v
好了之后,更改启动命令,配置minikube使用代理,NO_PROXY的作用是对于192.168.99.0/24该网段的地址不要走代理,原因是minikube内部启动的容器使用该网段,都代理就不会通了
minikube start --docker-env HTTP_PROXY=http://192.168.94.1:8118 --docker-env HTTPS_PROXY=http://192.168.94.1:8118 --docker-env NO_PROXY=192.168.99.0/24
> kubectl get pod
NAME READY STATUS RESTARTS AGE
hello-minikube-7844bdb9c6-zwcnr 1/1 Running 0 1h
状态已经正常
5.4 暴露端口
可以发现hello-minikube服务已经暴露
> kubectl expose deployment hello-minikube --type=NodePort
> minikube service hello-minikube --url
http://192.168.99.100:31158
> curl "http://192.168.99.100:31158"
CLIENT VALUES:
client_address=172.17.0.1
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.99.100:8080/SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001HEADERS RECEIVED:
accept=*/*
host=192.168.99.100:31158
user-agent=curl/7.43.0
BODY:
-no body in request-%
https://blog.csdn.net/jettery/article/details/79098759
https://yq.aliyun.com/articles/221687
Centos下安装minikube相关推荐
- Centos下安装mysql 总结
一.MySQL安装 Centos下安装mysql 请点开:http://www.centoscn.com/CentosServer/sql/2013/0817/1285.html 二.MySQL的几个 ...
- linux卸载欧朋浏览器,如何在Centos下安装opera浏览器
如何在Centos下安装opera浏览器 ,Opera目前是Linux平台上性能最优的浏览器,而且Opera中国团队本身即定位于Opera的研发中心,主要也是负责全球Linux平台项目的开发,这个版本 ...
- 在CentOS下安装apche+tomcat+mysql+php
在CentOS下安装apche+tomcat+mysql+php 本例中所用到的软件 Apache 2.2 Sun的JDK-1_5_0_12-linux-i586 MySQL: mysql-5.0.4 ...
- Linux(CentOs)下安装Phantomjs + Casperjs
Linux(CentOs)下安装Phantomjs + Casperjs 是参照cnMiss's Blog http://ju.outofmemory.cn/entry/70691的博客进行安装的 1 ...
- CentOS下安装JDK7 转载
转载地址:http://www.cnblogs.com/rilley/archive/2012/02/02/2335395.html CentOS下安装JDK7 下载地址:http://www.ora ...
- centos解压zip命令_2、centos下安装elasticsearch-head
1.下载 https://github.com/mobz/elasticsearch-head/archive/master.zip 2.解压 unzip elasticsearch-head-mas ...
- CentOS 下安装
2016年12月5日15:25:58 ----------------------------------- 通常情况下在centos下安装软件就用yum. 关键是,使用yum你要知道安装包的名字是什 ...
- Centos下安装mysql(二进制版)
Centos下安装mysql(二进制版) 1.下载安装包,选择相应的平台.版本,比如,选择64位Linux平台下的MySQL二进制包"Linux-Generic (glibc 2.5)(x8 ...
- Linux/CentOS下安装Apache/SVN/Subversion图文详解教程
Linux(CentOS)下安装Apache+Subversion(图文教程) 服务器版本和安装软件 服务器版本: RedHatCentOS 5.5 32 bit 安装软件: apr-1.3.5.ta ...
最新文章
- 智在生活 自在慵懒 科沃斯机器人X京东大牌秒杀日主题展亮相无锡
- 源恩教育计算机,源恩计算机二级
- CircleList
- Tomcat发布Web项目的两种方式
- 找不到 快速启动 ,怎么办
- iphone最新款手机_苹果罕见“跌停”!遭遇6年来最惨淡一夜,2019年全球股市第一颗雷引爆...
- 数学差、物理差、英语又烂的放牛娃,后来竟成了清华校长,还做出了诺奖级的研究成果...
- MacOS13系统升级动态壁纸无法安装解决方法
- 用循环队列模拟滑动窗口动态求最值及峰峰值
- ps2硬盘接linux,PS2加装硬盘详细指导
- 全国DNS服务器ip地址
- Win11无线鼠标没反应怎么办?无线鼠标不能用是什么原因?
- 详解木头自动填表浏览器使用方法
- 七夕恋人必备表白源码
- android 程序更换字体颜色,android改变字体的颜色的三种方法
- C语言基础之4:字符串和格式化输入/输出
- java 对接顺丰快递进行寄件操作 (使用RestTemplate 请求)
- 端午临中夏,时清日复长。
- 3.Sunday算法的一个小优化
- 内存映射和多功能LED控制器驱动芯片/带按键扫描的LED驱动芯片(IC)-VK16K33A/B/C,内置RC振荡器,最大16seg和8com
热门文章
- python编程老师岗位需求表_教师岗位需求信息表
- 使用Mybatis如何对Mysql进行分页功能?
- linux之debian自动登录
- Python之魔法方法详解
- vb6实现union数据结构_Redis数据结构与对象编码解析
- 一起来学SpringBoot | 第二篇:SpringBoot配置详解
- 新开博了,欢迎大家来做客!
- 【CNMP系列】CentOS7.0下安装Nginx服务
- 【汇编语言与计算机系统结构笔记08】如何实现循环(Loops),gcc历史上经历了多种转换模式(微体系结构角度解释),Switch语句,跳转表
- ulimit命令学习