图片来源github
Kind = Kubernetes in Docker,简单说就是把k8s run在docker上面,少了安装在本机上面的动作,
Kind也是个Kubernetes SIGs project,跟常用的minikube对比,把原本安装在vm上面改到container上面
项目 | minikube | kind |
---|---|---|
runtime | VM | container |
supported | AMD64 | AMD64, ARMv7, ARM64 |
supported container runtimes | Docker,CRI-O,containerd,gvisor | Docker |
memory requirements | 2GB | 8GB |
multi-cluster support | yes | yes |
multi-node support | no | yes |
go
与docker
GO111MODULE="on" go get sigs.k8s.io/[email protected]
执行结果
go: downloading sigs.k8s.io/kind v0.11.1
go: downloading github.com/spf13/cobra v1.1.1
go: downloading github.com/alessio/shellescape v1.4.1
go: downloading k8s.io/apimachinery v0.20.2
go: downloading golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading github.com/evanphx/json-patch v4.9.0+incompatible
go: downloading github.com/pelletier/go-toml v1.8.1
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/evanphx/json-patch/v5 v5.2.0
kind create cluster
执行结果
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.21.1) ?
✓ Preparing nodes ?
✓ Writing configuration ?
✓ Starting control-plane ?️
✓ Installing CNI ?
✓ Installing StorageClass ?
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Thanks for using kind! ?
也是可以使用参数指定cluster的名称
kind create cluster --name test-kind-cluster
需要指定node image版本,可以加上tag
kind create cluster --name tag-version-kind --image kindest/node:v1.21.1
kind不像minikube有自带仪表版,所以需要自行安装
1.安装dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
确认一下有没有正常运作
kubectl get pod -n kubernetes-dashboard
执行结果
NAME READY STATUS RESTARTS AGE
dashboard-metrics-scraper-778b77d469-v85pw 1/1 Running 0 3m5s
kubernetes-dashboard-5cd89984f5-9vtsm 1/1 Running 0 3m5s
2.安装ClusterRoleBinding,提供刚刚建的cluster管理权限存取
kubectl create clusterrolebinding default-admin --clusterrole cluster-admin --serviceaccount=default:default
3.因为仪表板是使用token登入,所以把token汇出
token=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}"|base64 -d)
echo $token
4.使用kubectl proxy进入仪板表
kubectl proxy
5.登入
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
6.填入token就可以看到k8s资讯啦
kind的基础安装就到这边了
<<: Day14 - 动态 新增/删除 Collection 项目(二) - Html Helper
>>: Day6 Director & Match Function
为什麽要用function(函式)? 通常会将statement 放在函数(function)里面,...
其实原本不是要叫这个名字的。原本要叫《官网没教你的「如何把 Vue 写好」》但是太狂了,竟然敢代替官...
在许多的输入中 很重要的核取方块 用於登入的勾选 ,资料的选取等等 利用 checked 判定核取状...
-外部和内部分析 存在为客户服务的组织;他们的需要和要求很重要。组织在开始战略计划之前进行外部和内...
今天大概会聊到的范围 AnnotatedString Text 在 Compose 中显示文字时,...