要须心地收汗马,孔孟行世目杲杲。这篇文章主要讲述VMware Tanzu社区版初体验相关的知识,希望能为你提供帮助。
VMware Tanzu社区版
VMware Tanzu Community Edition 是一个功能齐全、易于管理的 Kubernetes 平台,供学习者和用户使用。 它是一个免费的、社区支持的、开源的 VMware Tanzu 发行版,可以在几分钟内在您的本地工作站或您喜欢的云上安装和配置。
Linux Local Bootstrap Machine Prerequisites
1、检查cgroup
linux-mint-002@linux-mint-002:~/tanzu$ sudo docker info | grep -i cgroup
Cgroup Driver: cgroupfs
Cgroup Version: 1
如果 cgroups v2,需要设置 system.unified_cgroup_hierarchy=02、下载tanzu CLI
ll
linux-mint-002@linux-mint-002:< sub> /tanzu$ wget http://192.168.100.18:1234/tce-linux-amd64-v0.9.1.tar.gz
linux-mint-002@linux-mint-002:< /sub> /tanzu$ tar -zxf tce-linux-amd64-v0.9.1.tar.gz
linux-mint-002@linux-mint-002:< sub> /tanzu$ ls
tce-linux-amd64-v0.9.1tce-linux-amd64-v0.9.1.tar.gz
linux-mint-002@linux-mint-002:< /sub> /tanzu$ cd tce-linux-amd64-v0.9.1/
linux-mint-002@linux-mint-002:~/tanzu/tce-linux-amd64-v0.9.1$ ls
bininstall.shuninstall.sh
3、运行install.sh安装
linux-mint-002@linux-mint-002:~/tanzu/tce-linux-amd64-v0.9.1$ ./install.sh
+ ALLOW_INSTALL_AS_ROOT=
+ [[ 1000 -eq 0 ]]
+++ dirname ./install.sh
++ cd .
++ pwd
+ MY_DIR=/home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1
++ uname
+ BUILD_OS=Linux
+ case "${BUILD_OS}" in
+ XDG_DATA_HOME=/home/linux-mint-002/.local/share
+ echo /home/linux-mint-002/.local/share
/home/linux-mint-002/.local/share
++ command -v tanzu
+ TANZU_BIN_PATH=
+ [[ -n \'\' ]]
+ TANZU_BIN_PATH=/usr/local/bin
+ [[ :/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: == *\\:\\/\\h\\o\\m\\e\\/\\l\\i\\n\\u\\x\\-\\m\\i\\n\\t\\-\\0\\0\\2\\/\\b\\i\\n\\:* ]]
+ echo Installing tanzu cli to /usr/local/bin
Installing tanzu cli to /usr/local/bin
+ sudo install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu /usr/local/bin
+ mkdir -p /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-builder /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-cluster /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-conformance /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-diagnostics /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-kubernetes-release /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-login /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-management-cluster /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-package /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-pinniped-auth /home/linux-mint-002/.local/share/tanzu-cli
+ for plugin in "${MY_DIR}"/bin/tanzu-plugin*
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/bin/tanzu-plugin-standalone-cluster /home/linux-mint-002/.local/share/tanzu-cli
+ mkdir -p /home/linux-mint-002/.local/share/tce
+ install /home/linux-mint-002/tanzu/tce-linux-amd64-v0.9.1/uninstall.sh /home/linux-mint-002/.local/share/tce
+ TANZU_PLUGIN_CACHE=/home/linux-mint-002/.cache/tanzu/catalog.yaml
+ [[ -n /home/linux-mint-002/.cache/tanzu/catalog.yaml ]]
+ echo \'Removing old plugin cache from /home/linux-mint-002/.cache/tanzu/catalog.yaml\'
Removing old plugin cache from /home/linux-mint-002/.cache/tanzu/catalog.yaml
+ rm -f /home/linux-mint-002/.cache/tanzu/catalog.yaml
+ tanzu init
| initializing ?successfully initialized CLI
++ tanzu plugin repo list
++ grep tce
+ TCE_REPO=
+ [[ -z \'\' ]]
+ tanzu plugin repo add --name tce --gcp-bucket-name tce-tanzu-cli-plugins --gcp-root-path artifacts
++ tanzu plugin repo list
++ grep core-admin
+ TCE_REPO=
+ [[ -z \'\' ]]
+ tanzu plugin repo add --name core-admin --gcp-bucket-name tce-tanzu-cli-framework-admin --gcp-root-path artifacts-admin
+ echo \'Installation complete!\'
Installation complete!
4、下载kubectl
curl -LO https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
5、创建集群 需要你的资源满足如下要求
6 GB of RAM
15 GB of local machine disk storage for images
4 CPUs
Local Docker Bootstrapping
1、初始化Tanzu 安装接口
linux-mint-002@linux-mint-002:~/tanzu/tce-linux-amd64-v0.9.1$ tanzu management-cluster create --ui -b 192.168.100.66:8080
Validating the pre-requisites...
Serving kickstart UI at http://192.168.100.66:8080
unable to open browser: exit status 3
2、现在可以打开链接,通过浏览器安装配置集群了
3、首先我们部署一个管理集群到docker环境
4、最后点击部署,即可开始创建一个管理集群,也可以用最底下的命令行执行
5、等待部署完成,验证管理集群是否正常
linux-mint-002@linux-mint-002:~/tanzu$tanzu management-cluster get
NAMENAMESPACESTATUSCONTROLPLANEWORKERSKUBERNETESROLES
tanzutkg-systemrunning1/11/1v1.21.2+vmware.1management
Details:
NAMEREADYSEVERITYREASONSINCEMESSAGE
/tanzuTrue6d23h
├─ClusterInfrastructure - DockerCluster/tanzuTrue6d23h
├─ControlPlane - KubeadmControlPlane/tanzu-control-planeTrue6d23h
│ └─Machine/tanzu-control-plane-v9jxwTrue6d23h
└─Workers
└─MachineDeployment/tanzu-md-0
└─Machine/tanzu-md-0-567d7cf787-wkphpTrue6d23h
Providers:
NAMESPACENAMETYPEPROVIDERNAMEVERSIONWATCHNAMESPACE
capd-systeminfrastructure-dockerInfrastructureProviderdockerv0.3.23
capi-kubeadm-bootstrap-systembootstrap-kubeadmBootstrapProviderkubeadmv0.3.23
capi-kubeadm-control-plane-systemcontrol-plane-kubeadmControlPlaneProviderkubeadmv0.3.23
capi-systemcluster-apiCoreProvidercluster-apiv0.3.23
6、获取管理集群的kubeconfig
linux-mint-002@linux-mint-002:~/tanzu$ tanzu management-cluster kubeconfig get tanzu --admin
然后就可以执行kubectl操作管理集群了
linux-mint-002@linux-mint-002:~/tanzu$kubectlget no
NAMESTATUSROLESAGEVERSION
tanzu-control-plane-v9jxwReadycontrol-plane,master6d23hv1.21.2+vmware.1-360497810732255795
tanzu-md-0-567d7cf787-wkphpReady6d23hv1.21.2+vmware.1-360497810732255795
7、创建工作负载集群
linux-mint-002@linux-mint-002:< sub> /tanzu$tanzucluster create tkg-workload --plan dev
linux-mint-002@linux-mint-002:< /sub> /tanzu$tanzucluster list
NAMENAMESPACESTATUSCONTROLPLANEWORKERSKUBERNETESROLESPLAN
tkg-workloaddefaultrunning1/11/1v1.21.2+vmware.1dev
【VMware Tanzu社区版初体验】8、获取工作集群的kubeconfig,并查看集群信心
linux-mint-002@linux-mint-002:< sub> /tanzu$ tanzuclusterkubeconfig get tkg-workload --admin
linux-mint-002@linux-mint-002:< /sub> /tanzu$kubectlconfig get-contexts
CURRENTNAMECLUSTERAUTHINFONAMESPACE
*tanzu-admin@tanzutanzutanzu-admin
tkg-workload-admin@tkg-workloadtkg-workloadtkg-workload-admin
切换kubecontext
linux-mint-002@linux-mint-002:< sub> /tanzu$kubectlconfig use-context tkg-workload-admin@tkg-workload
Switched to context "tkg-workload-admin@tkg-workload".
linux-mint-002@linux-mint-002:< /sub> /tanzu$kubectlget no
NAMESTATUSROLESAGEVERSION
tkg-workload-control-plane-nbddzReadycontrol-plane,master6d2hv1.21.2+vmware.1-360497810732255795
tkg-workload-md-0-c7bc5dc9f-zwjfgReady6d2hv1.21.2+vmware.1-360497810732255795
linux-mint-002@linux-mint-002:~/tanzu$ kubectlget po --all-namespaces
NAMESPACENAMEREADYSTATUSRESTARTSAGE
kube-systemantrea-agent-xwrk62/2Running16d2h
kube-systemantrea-agent-zl6gq2/2Running06d2h
kube-systemantrea-controller-89547f7f5-tgn7z1/1Running06d2h
kube-systemcoredns-8dcb5c56b-lbcqw1/1Running06d2h
kube-systemcoredns-8dcb5c56b-wvzjw1/1Running06d2h
kube-systemetcd-tkg-workload-control-plane-nbddz1/1Running06d2h
kube-systemkube-apiserver-tkg-workload-control-plane-nbddz1/1Running06d2h
kube-systemkube-controller-manager-tkg-workload-control-plane-nbddz1/1Running06d2h
kube-systemkube-proxy-226wj1/1Running06d2h
kube-systemkube-proxy-hwq2q1/1Running06d2h
kube-systemkube-scheduler-tkg-workload-control-plane-nbddz1/1Running06d2h
kube-systemmetrics-server-b9698ff4-rhrw51/1Running06d2h
projectcontourcontour-c48db6f9f-dmcfb1/1Running06d2h
projectcontourcontour-c48db6f9f-zwszk1/1Running06d2h
projectcontourcontour-certgen-v1.18.1-zfcwr0/1Completed06d2h
projectcontourenvoy-n6pld
推荐阅读
- VRRP实验
- HGDB企业版V6逻辑复制搭建
- ACL理论及配置
- 5款国产开源低代码开发平台推荐
- 链路聚合
- C++类和对象--多态
- 自研python常用工具库(prestool)
- Python实现解千千音乐网站中的JS加密算法
- 小码匠数据科学之旅-猿门又多一枚女生