序
之前使用multipass裝ubuntu,然后再用microk8s搭建k8s,這會直接用orbstack及kind在本地搭建k8s及istio
安裝
orbstack
通過orbstack這個地址下載,主要是開銷低,用來替代docker desktop
添加國內(nèi)源
~/.orbstack/config/docker.json
{
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"https://registry.hub.docker.com"
]
}
重啟orbstack
安裝go
brew install go
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
安裝kind
go install sigs.k8s.io/kind@v0.20.0
export PATH=$HOME/go/bin:$PATH
kind create cluster
Creating cluster "kind" ...
?? Ensuring node image (kindest/node:v1.27.3) ??
?? Ensuring node image (kindest/node:v1.27.3) ??
? Ensuring node image (kindest/node:v1.27.3) ??
? Preparing nodes ??
? Writing configuration ??
?? Starting control-plane ???
?? Starting control-plane ???
?? Starting control-plane ???
?? Starting control-plane ???
? 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
Have a nice day! ??
使用
kubectl cluster-info --context kind-kind
Kubernetes control plane is running at https://127.0.0.1:51562
CoreDNS is running at https://127.0.0.1:51562/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5d78c9869d-2rjmk 1/1 Running 0 2m9s
kube-system coredns-5d78c9869d-n72hp 1/1 Running 0 2m9s
kube-system etcd-kind-control-plane 1/1 Running 0 2m23s
kube-system kindnet-tjvh9 1/1 Running 0 2m10s
kube-system kube-apiserver-kind-control-plane 1/1 Running 0 2m24s
kube-system kube-controller-manager-kind-control-plane 1/1 Running 0 2m23s
kube-system kube-proxy-sjg2h 1/1 Running 0 2m10s
kube-system kube-scheduler-kind-control-plane 1/1 Running 0 2m23s
local-path-storage local-path-provisioner-6bc4bddd6b-hpzrd 1/1 Running 0 2m9s
安裝istio
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.2.5 sh -
或者下載https://github.com/istio/istio/releases/download/1.18.2/istio-1.18.2-osx-arm64.tar.gz
解壓,并將istio-1.18.2/bin添加到PATH中文章來源:http://www.zghlxwxcb.cn/news/detail-621750.html
istioctl install --set profile=demo -y
? Istio core installed
? Istiod installed
? Egress gateways installed
? Ingress gateways installed
? Installation complete Making this installation the default for injection and validation.
kubectl get ns
NAME STATUS AGE
default Active 75m
istio-system Active 104s
kube-node-lease Active 75m
kube-public Active 75m
kube-system Active 75m
local-path-storage Active 75m
? ~ kubectl get pods -n istio-system
NAME READY STATUS RESTARTS AGE
istio-egressgateway-75db994b58-jdztx 1/1 Running 0 61s
istio-ingressgateway-79bb75ddbb-965t8 1/1 Running 0 61s
istiod-68cb9f5cb6-jksg5 1/1 Running 0 115s
小結(jié)
使用orbstack及kind在本地搭建k8s及istio顯得極為輕量,首先orbstack比multipass起個machine輕量許多,其次kind比k3s,minikube更為輕量,雖然是單節(jié)點(diǎn),但是特別適合學(xué)習(xí)和研究。文章來源地址http://www.zghlxwxcb.cn/news/detail-621750.html
doc
- orbstack
- kind
- 安裝istio
到了這里,關(guān)于使用kind在mac本地搭建k8s及istio的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!