一。安装kubernetes(k8s)

参考:

http://batizhao.github.io/2018/01/18/Running-Kubernetes-Locally-via-Minikube/

https://www.kubernetes.org.cn/installkubectl

使用Kubernetes命令行工具kubectl在Kubernetes上部署和管理应用程序。使用kubectl,可以检查集群资源; 创建,删除和更新组件。

准备工作

说明:安装 xhyve 驱动程序。此处可以不用安装,因为事先快已安装visualBox。

Step1:安装 kubectl

$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/darwin/amd64/kubectl

$ chmod +x ./kubectl
$ sudo mv ./kubectl /usr/local/bin/kubectl $ kubectl version
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v1.9.1", GitCommit:"3a1c9449a956b6026f075fa3134ff92f7d55f812", GitTreeState:"clean", BuildDate:"2018-01-04T11:52:23Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"", Minor:"", GitVersion:"v1.8.0", GitCommit:"0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4", GitTreeState:"clean", BuildDate:"2017-11-29T22:43:34Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}

Step2:安装 Minikube

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.24.1/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

$ minikube version
minikube version: v0.24.1

启动集群

$ minikube start

查看节点

$ kubectl get node

出现问题:

效果:

详细命令 & 错误点 记录:

//Step1:进入kube
$ cd .kube/ //Step2:查看配置文件
$ vim config ######################
tcp4 10.0.56.39. 106.39.162.247. CLOSE_WAIT
tcp4 10.0.56.39. 211.90.25.49. CLOSE_WAIT
tcp4 10.0.56.39. 211.90.25.49. CLOSE_WAIT
tcp4 10.0.56.39. 211.90.25.49. CLOSE_WAIT
tcp4 10.0.56.39. 117.121.101.40. ESTABLISHED
tcp4 10.0.56.39. 58.83.206.244. ESTABLISHED
tcp4 10.0.56.39. 172.20.39.2. ESTABLISHED
tcp4 10.0.56.39. 101.226.211.105. ESTABLISHED
udp4 10.0.56.39. 172.217.161.170.
udp4 10.0.56.39. 216.58.197.98.
udp4 10.0.56.39. 172.217.24.35.
udp4 10.0.56.39. 74.125.203.94.
###################### //Step3
$ ps -ef | grep mini ################
Fri02PM ?? :00.23 /System/Library/PrivateFrameworks/SystemAdministration.framework/XPCServices/writeconfig.xpc/Contents/MacOS/writeconfig
:25PM ?? :20.07 /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless --comment minikube --startvm eafceda8--4cf4-8a83-2b7b20dd03c1 --vrde config
:36PM ttys001 :00.00 grep mini
################# //Step4:
$ minikube status #####################
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
#################### //Step5:
$ kubectl #####################
kubectl controls the Kubernetes cluster manager. Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/ ...
##################### //Step6:
$ which kubectl #######################
/usr/local/bin/kubectl
####################### //Step7:
$ find / -name kubectl //Step8:
$ apt-get #######################
-bash: apt-get: command not found
####################### //Step9:
$ kubectl get node #######################
No resources found.
####################### //Step10:
$ kubectl --version #######################
Error: unknown flag: --version
#######################

解决方案:

//Step1:
ZBMAC:.kube shiyufeng$ brew install wget //Step2:
ZBMAC:.kube shiyufeng$ wget https://storage.googleapis.com/kubernetes-release/release/v1.8.7/bin/darwin/amd64/kubectl //Step3:
ZBMAC:.kube shiyufeng$ chmod +x kubectl //Step4:
ZBMAC:.kube shiyufeng$ ./kubectl get nodes ###############################
NAME STATUS ROLES AGE VERSION
minikube Ready <none> 18m v1.8.0
################################ //OK //Step5:
ZBMAC:.kube shiyufeng$ which kubectl
/usr/local/bin/kubectl //Step6:
ZBMAC:.kube shiyufeng$ mv kubectl /usr/local/bin/ //Step7:
ZBMAC:.kube shiyufeng$ kubectl version
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v1.8.7", GitCommit:"b30876a5539f09684ff9fde266fda10b37738c9c", GitTreeState:"clean", BuildDate:"2018-01-16T21:59:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"", Minor:"", GitVersion:"v1.8.0", GitCommit:"0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4", GitTreeState:"clean", BuildDate:"2017-11-29T22:43:34Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"} //Step7:
ZBMAC:.kube shiyufeng$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready <none> 18m v1.8.0 //Step8:
ZBMAC:.kube shiyufeng$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-addon-manager-minikube / Running 19m
kube-system kube-dns-86f6f55dd5-t9f5x / Running 19m
kube-system kubernetes-dashboard-mxfd7 / Running 19m
kube-system storage-provisioner / Running 19m

k8s安装完成!

Mac016--安装kubernetes(k8s)的更多相关文章

  1. 开启和安装Kubernetes k8s 基于Docker For Windows

    0.最近发现,Docker For Windows Stable在Enable Kubernetes这个问题上是有Bug的,建议切换到Edge版本,并且采用下文AliyunContainerServi ...

  2. Centos7安装Kubernetes k8s v1.16.0 国内环境

    一. 为什么是k8s v1.16.0? 最新版的v1.16.2试过了,一直无法安装完成,安装到kubeadm init那一步执行后,报了很多错,如:node xxx not found等.centos ...

  3. centos7安装kubernetes k8s 1.18

    可以参考其他网友的阿里云搭建k8s高可用集群(1.17.3) https://www.cnblogs.com/gmmy/p/12372805.html 准备四台centos7虚拟机,用来安装k8s集群 ...

  4. centos7安装kubernetes k8s 1.16

    #初始化服务器 echo 'export LC_ALL="en_US.UTF-8"' >> /etc/profile source /etc/profile #!/bi ...

  5. Kubernetes k8s 基于Docker For Windows

      开启和安装Kubernetes k8s 基于Docker For Windows   0.最近发现,Docker For Windows Stable在Enable Kubernetes这个问题上 ...

  6. centos7.3 kubernetes/k8s 1.10 离线安装 --已验证

    本文介绍在centos7.3使用kubeadm快速离线安装kubernetes 1.10. 采用单master,单node(可以多node),占用资源较少,方便在笔记本或学习环境快速部署,不适用于生产 ...

  7. kubernetes系列03—kubeadm安装部署K8S集群

    本文收录在容器技术学习系列文章总目录 1.kubernetes安装介绍 1.1 K8S架构图 1.2 K8S搭建安装示意图 1.3 安装kubernetes方法 1.3.1 方法1:使用kubeadm ...

  8. kubernetes(k8s) Prometheus+grafana监控告警安装部署

    主机数据收集 主机数据的采集是集群监控的基础:外部模块收集各个主机采集到的数据分析就能对整个集群完成监控和告警等功能.一般主机数据采集和对外提供数据使用cAdvisor 和node-exporter等 ...

  9. ubuntu16.04 docker kubernetes(k8s) istio 安装

    版本: docker: 19.03.5 kubernetes: 1.17.0 istio: 1.4.3 步骤一:给ubuntu换源 https://www.cnblogs.com/lfri/p/106 ...

随机推荐

  1. 免费申请 QQ 免费靓号

    打开网址:https://ssl.zc.qq.com/v3/index-chs.html?type=3 说明:靓号一般分为 9位靓号 or 带有寓意的号码 激活规则:获取的"靓号" ...

  2. Apache 的 php.ini 配置文件详解

    [root@taokey ~]# grep -v ";" /application/php/lib/php.ini [PHP] engine = On  ——→  是否启用 PHP ...

  3. Result window is too large, from + size must be less than or equal to: [10000] but was [78440]. See the scroll api for a more efficient way to request large data sets

    {"error":{"root_cause":[{"type":"query_phase_execution_exception& ...

  4. Maven 添加其他Maven组件配置问题

    在父工程的pom文件里,添加如下配置 <project> <!--其它配置--> <modules> <module>A项目文件夹</module ...

  5. Nginx和Apache 转发网络问题

    Linux 环境下,Apache 正常安装,httpd.conf也已正常配置,经测试80端口也已开通,但在外网测试时仍然是提示503错误.经过查资料和分析怀疑是SELinux的原因,于是查看果然是: ...

  6. 10年前文章_iscsi initiator 设置

    发现和查找 target, iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260 登录 iscsiadmin -m node -l 退出登录 ...

  7. 动态SQL的注意

    MyBatis的动态SQL元素. 元素 说明 <if> 判断语句,用于单条件分支判断 <choose>(<when>.<otherwise>) 相当于j ...

  8. 【串线篇】spring boot嵌入式Servlet容器自动配置原理

    EmbeddedServletContainerAutoConfiguration:嵌入式的Servlet容器自动配置? @AutoConfigureOrder(Ordered.HIGHEST_PREC ...

  9. 洛谷P3768 简单的数学题 莫比乌斯反演+杜教筛

    题意简述 求出这个式子 \[ \sum_{i=1}^n\sum_{j=1}^n ij(i,j) \bmod p \] 做法 先用莫比乌斯反演拆一下式子 \[ \begin{split} \sum_{i ...

  10. 最简单的注册美区Apple ID方法

    最简单方法注册苹果美区Apple ID 1.打开苹果官网链接 苹果官网 2. 点击右下角的 United States 3. 点击图片中的选项 4.点击右上角的选项创建新的Apple ID 注意是新的 ...