如何在本地运行Kubernetes?
Posted 分布式实验室
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在本地运行Kubernetes?相关的知识,希望对你有一定的参考价值。
brew install kubernetes-cli
brew upgrade kubernetes-cli
$ kubectl version --client --short=true
Client Version: v1.8.5
brew cask install virtual box
brew cask install minikube
brew cask reinstall minikube
~ $ minikube version
minikube version: v0.24.1
~ $ minikube start
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Downloading Minikube ISO
140.01 MB / 140.01 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading localkube binary
148.25 MB / 148.25 MB [============================================] 100.00% 0s
0 B / 65 B [----------------------------------------------------------] 0.00%
65 B / 65 B [======================================================] 100.00% 0sSetting 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 config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* minikube minikube minikube
~ $ kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready <none> 1m v1.8.0
~ $ kubectl version --short=true
Client Version: v1.8.5
Server Version: v1.8.0
~ $ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* minikube minikube minikube
docker-for-desktop docker-for-desktop-cluster docker-for-desktop
~ $ kubectl config use-context docker-for-desktop
Switched to context "docker-for-desktop".
~ $ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* docker-for-desktop docker-for-desktop-cluster docker-for-desktop
minikube minikube minikube
~ $ kubectl get nodes
NAME STATUS ROLES AGE VERSION
docker-for-desktop Ready master 23h v1.8.2
$ docker version
Client:
Version: 17.12.0-rc1-kube_beta
API version: 1.35
Go version: go1.9.2
Git commit: a36c9215a7f8d5da5231d2cca353375bcb27efe3
Built: Thu Dec 7 17:33:49 2017
OS/Arch: darwin/amd64
Orchestrator: kubernetes
Server:
Engine:
Version: 17.12.0-ce-rc2
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: f9cde63
Built: Tue Dec 12 06:45:30 2017
OS/Arch: linux/amd64
Experimental: true
~ $ kubectl version --short=true
Client Version: v1.8.2
Server Version: v1.8.0
https://beta.docker.com/
https://github.com/aws-samples/aws-workshop-for-kubernetes
以上是关于如何在本地运行Kubernetes?的主要内容,如果未能解决你的问题,请参考以下文章
Kubernetes 学习总结(36)—— Kubernetes 本地运行的四种方法
Kubernetes 学习总结(36)—— Kubernetes 本地运行的四种方法
Kubernetes 学习总结(36)—— Kubernetes 本地运行的四种方法