Mac M1安装k8s

一、下载:

下载你docker-mac对应的版本,我的是v1.21.3

git clone -b v1.21.3 https://github.com/AliyunContainerService/k8s-for-docker-desktop.git

二、执行脚本下拉镜像:

进入k8s-for-docker-desktop,执行如下命令

./load_images.sh

upload successful

开启kubernetes

开启 Kubernetes,并等待 Kubernetes 开始运行

部署 Kubernetes dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml

检查 kubernetes-dashboard 应用状态

kubectl get pod -n kubernetes-dashboard

开启 API Server 访问代理

kubectl proxy

通过如下 URL 访问 Kubernetes dashboard

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login

配置控制台访问令牌

对于mac环境
对于Mac环境

TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')
kubectl config set-credentials docker-for-desktop --token="${TOKEN}"
echo $TOKEN

eyJhbGciOiJSUzI1NiIsImtpZCI6IkExNW4tcW1LbmZpT3I3YWhZUXgzbXNDZmx4a0RQSzUxcDQ0NVo1b3A0S2cifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkZWZhdWx0LXRva2VuLWg2cWc2Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImRlZmF1bHQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJjYmVjNGVhOS03NzQ5LTQ0NzAtYjFhYy1hZWYyNGI5YTNlN2YiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06ZGVmYXVsdCJ9.bwREEU7Ac7hnnHU8_Oww2O9a-ymw6foeU8pvG-6YZ35EobuRSRRpTIGc3crnyrxbd2sQFiaQieakkxME2eDD9EoQmsvHK9S7YoLI8HQDW_wByzUqc6n7PW8PYZRuWZuhhhWBF2YHfgIoQ2BCQFivjvWbkyzZ508cgAHJ6B0YWlOc0d55qslW6OxgXVbiX0qnGd5IPcFk97mz_6w9KvWnf011XzxfIiQI97wYTSquSZjP_TsjmEyx9HrLfxAwgp_81SqEeFYWeZ5XED337D4XOxbsh714nnPVpDL_n1EKUextArPJ7OFkysA5HIeLzgxD2z0Mtj94QhV_XSdAfxNFuw

打开url使用token登录,填写上述token即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值