本地k8s环境搭建工具kind、microk8s安装;windows 包管理工具Chocolatey;lens k8s可视化工具
类似工具还有minik8sChocolatey windows安装cmd 管理运行@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET
类似工具还有minik8s
Chocolatey windows安装
Chocolatey类似mac的homebrew工具
cmd 终端管理运行
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Windows PowerShell安装
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
安装kind
windows
choco install kind
linux:
安装kind:
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind
安装kubectl:
yum install -y kubectl-1.16.3
或
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
添加环境变量:
vim /etc/profile
最后添加一行
export PATH="/home/loong/loong/:$PATH"
最后保存生效
source /etc/profile
ubuntu microk8s安装:
参考:https://cn.ubuntu.com/blog/how-to-install-microk8s-on-ubuntu
https://www.jianshu.com/p/02fd2540fab2
1、先安装包管理器snap
sudo apt install snapd
2、安装microk8s
sudo snap install microk8s --classic
3、启动
sudo microk8s.start
kind运行k8s服务
确保docker desktop正常运行
kind create cluster
查看状态
kubectl create clusterrolebinding test:anonymous --clusterrole=cluster-admin --user=system:anonymous
kubectl cluster-info --context kind-kind
kubectl get all --all-namespaces
kubectl exec -it -n jenkins jenkin***768-kr7vf sh
kubectl describe pod jenkin***768-kr7vf -n jenkins
kubectl logs -f jenkin***68-kr7vf -n jenkins
##docker里也可以看到对应运行的容器
docker ps
docker exec kind-control-plane crictl ps ##可以查看容器里运行的进程
lens k8s可视化工具
参考:https://blog.kelu.org/tech/2020/08/22/kuernetes-kind-cluster.html
https://blog.csdn.net/qq_24794401/article/details/106846770
直接下载安装:https://k8slens.dev/
更多推荐
所有评论(0)