当前位置:网站首页>TAP 系列文章 2 | Tanzu Application Platform v1.1 安装配置步骤
TAP 系列文章 2 | Tanzu Application Platform v1.1 安装配置步骤
2022-06-10 06:19:00 【VMware中国研发中心】
Tanzu Application Platform v1.1 安装配置步骤

如上图所示,Tanzu Application Platform v1.1 的安装,主要分成以下步骤:
- TAP 安装前的准备;
- 安装 Tanzu CLI 命令行工具与 Tanzu Cluster Essentials(Tanzu K8S 安装包管理套件);
- 根据集群的使用角色,参考前文提到的内容,准备 TAP Profiles 配置文件 tap-values.yaml;
- 安装 Tanzu Application Platform v1.1;
- 验证安装环境 ;
TAP 安装前的准备
注意:Tanzu Application Platform v1.1 的官方安装说明参考如下位置,本文旨在帮助初次安装 TAP 的用户快速配置和构建 TAP 运行环境。
注意:本文安装过程中的桌面 CLI 环境基于 MacOS&Linux 操作系统。对于 Windows CLI 环境的操作请参考官方安装文档。
准备 VMware Tanzu Network 登录账号并下载 TAP 安装包
- 登录 Tanzu Network 注册并下载 Tanzu Application Platfrom v1.1 packages;
- 保证 TAP 的安装 K8S Cluster Worker 的网络能够访问:https://registry.tanzu.vmware.com;
DNS Records 的准备
- 准备应用部署后的访问域名,利用 TAP 部署的应用,部署完成后可以直接利用配置的域名进行访问;安装前需要准备好这个域名;例如:<app-name>.tap-app.example.vmware.com
Kubernetes Cluster 运行环境的准备
当前 TAP v1.1 支持的 Upstream Kubernetes 版本:v1.21,v1.22,v1.23;
当前支持的 K8S 发行版的提供商:
- Azure Kubernetes Service
- Amazon Elastic Kubernetes Service
- Google Kubernetes Engine
- Tanzu Kubernetes Grid multicloud
- vSphere with Tanzu v7.0 U3a
TAP 安装 Tanzu CLI 命令行工具与 Tanzu Cluster Essentials
- 下载 VMware Tanzu Application Platform tanzu-cli,根据安装桌面 OS 下载 (tanzu-framework-bundle-windows, tanzu-framework-bundle-mac, or tanzu-framework-bundle-linux)
- 安装 Tanzu CLI for Linux
# Move to the folder containing the downloaded file.
cd ~/Downloads
# Make a directory to extract the archive into
mkdir tanzu
# Extract the tar archive into your ~/tanzu directory
tar -xvf tanzu-framework-linux-amd64.tar -C ./tanzu
# Change your working directory to the extracted archive directory.
cd tanzu
# Run the install binary to complete the base installation.
sudo install cli/core/v0.11.2/tanzu-core-linux_amd64 /usr/local/bin/tanzu
# Install the Tanzu CLI Plugins
export TANZU_CLI_NO_INIT="true"
tanzu plugin install --local cli all- 验证 Tanzu CLI 的安装
# Expect version: v0.11.2
tanzu version
# Expect the package, secret, apps, services, and accelerator plugins to have a STATUS of 'installed'
tanzu plugin list 安装 TAP Cluster Essentials 套件
前文说过,为了简化、角色化 TAP 的 K8S 环境安装;VMware TAP team 准备了标准化的 TAP 安装套件,简化 TAP 的安装、配置 (模板参数化,定制化)、升级 (Upgrade)、模块参数更新;这些 Ops 功能,由 TAP Cluster Essentials 套件负责帮助客户完成。
下面的安装过程仍然以 Liunx 系统作为客户的参考:
- 登录 Tanzu Network,下载 Cluster Essentials for VMware Tanzu product。
- 下载 tanzu-cluster-essentials-linux-amd64-1.1.0.tgz 到 Linux 桌面 Downloads folder。
- 在 Terminal 中按如下步骤操作:
# Move to the Downloads folder
cd ~/Downloads
# Specify the VMware Cluster Essentials for Tanzu bundle details
export INSTALL_BUNDLE="registry.tanzu.vmware.com/tanzu-cluster-essentials/[email protected]:ab0a3539da241a6ea59c75c0743e9058511d7c56312ea3906178ec0f3491f51d"
export INSTALL_REGISTRY_HOSTNAME="registry.tanzu.vmware.com"
export INSTALL_REGISTRY_USERNAME='' # <- Insert Your Tanzu Network username
export INSTALL_REGISTRY_PASSWORD='' # <- Insert Your Tanzu Network password
# Make a folder for the extracted archive files
mkdir tanzu-cluster-essentials
# Extract the archive
tar -xvf tanzu-cluster-essentials-linux-amd64-1.1.0.tgz -C ./tanzu-cluster-essentials
# Move to the extracted folder
cd tanzu-cluster-essentials
# Install VMware Cluster Essentials for Tanzu
./install.sh- 安装验证如下:
# Ensure that kapp-controller and secretgen-controller are ‘running’
kubectl get pods --all-namespaces安装 Tanzu Application Platform v1.1 – 安装包工具集
前文提到 TAP 的安装需要考虑使用的角色,采用合适的参考架构作为部署参考;下面的安装,假设的使用角色是 Ops 工程师,计划在单一的 K8S 环境中验证 TAP 的全部功能,采用 Full Profile 配置;未来再考虑参考架构中提到的多角色,多集群配置的场景;
事实上,多角色、多集群的 TAP 部署 ( Iterate、Build、Run、TAP GUI),在步骤上跟下面提到的安装完全一致,区别在于 tap-values.yml 文件的参数配置;本文通过 full profiles 的 tap-values.yml 给大家展示,用户可以根据集群的角色,自行裁剪 full profiles 的 tap-values.yml 以满足多集群部署的需求;更为详细的多集群部署需要注意的参数配置,请参考官方 TAP 安装文档;
- 准备 Tanzu Application Platform 应用 bundle 安装环境参数
# Create Tanzu Application Platform Install Environment Variables
export TAP_VERSION="1.1.0"
export TAP_NAMESPACE="tap-install"
export DOMAIN="example.com"
export APPS_DOMAIN="apps.example.com"
# Set the developer’s ‘push’ capable docker container registry details
export DOCKER_SERVER="https://index.docker.io/v1/"
export DOCKER_USERNAME='' # < Insert Your Docker Hub username
export DOCKER_PASSWORD='' # < Insert Your Docker Hub password (or Access Token if 2FA is enabled)
kubectl create ns $TAP_NAMESPACE- 准备 Tanzu Application Platform 应用 bundle Tanzu Network 下载用户配置
tanzu secret registry add tap-registry \ --username $INSTALL_REGISTRY_USERNAME \ --password $INSTALL_REGISTRY_PASSWORD \ --server $INSTALL_REGISTRY_HOSTNAME \ --namespace $TAP_NAMESPACE \ --export-to-all-namespaces \ --yes - 安装 Tanzu Application Platform 应用 bundle
tanzu package repository add tanzu-tap-repository \
--url $INSTALL_REGISTRY_HOSTNAME/tanzu-application-platform/tap-packages:$TAP_VERSION \
--namespace $TAP_NAMESPACE - 安装 Tanzu Application Platform 应用 bundle,验证
# Check for STATUS: “Reconcile succeeded”
tanzu package repository get tanzu-tap-repository --namespace $TAP_NAMESPACE
# Check for a big list of ready to use packages
tanzu package available list --namespace $TAP_NAMESPACE 注意:Tanzu Application Platform 安装的过程中,受到客户网络环境的影响,可能会发生 tanzu CLI 超时退出的情况,这个时候无需对安装过程进行干扰,系统会继续安装,直至安装成功;
安装 Tanzu Application Platform v1.1 – Iterate Profile 开发环境
TAP Iterate Profile 的安装主要针对 Dev 团队这个角色,当然也可以作为 Ops 团队熟悉 TAP 时构建的测试环境;另外,TAP 的 Iterate 环境也比较适合 ISV 作为 COTS 的应用的开发、调试环境;
- 下载并配置 Iterate Profile tap-values.yml
注意: 下面操作的运行依赖于前面章节配置的环境变量;
# Download the template file.
curl -o template-tap-values.yml https://raw.githubusercontent.com/benwilcock/TAPonLAP/main/TAPonLAPv1.1/template-tap-values-nix.yml
# Customize the template using the environment variables you created in step 1.
envsubst < template-tap-values.yml > tap-values.yml
- 安装 TAP Iterate Profile
注意:TAP 的安装依赖于主机 / Host 性能、网络带宽等因素的影响,可能需要比较久的时间;在此期间如果发生 tanzu CLI 退出的情况,无需进行人工调试,等待至少 45min 后再通过基本的 Kubernetes 调试技巧进行故障排查。
tanzu package install tap -p tap.tanzu.vmware.com -v $TAP_VERSION \ --values-file tap-values.yml \ --poll-timeout 45m \ --namespace $TAP_NAMESPACE- 安装 TAP Iterate 环境安装后的验证

安装 Tanzu Application Platform v1.1 – Full Profile 环境
TAP full profile 的安装过程跟 TAP Iterate profile 非常接近,主要的不同点就是 tap-values.yml 的准备;客户可以自行参考 TAP v1.1 官方安装手册中的 full profile 建议的 tap-values.yml,作为安装初始配置,进行定制化,位置如下:
https://docs.vmware.com/en/Tanzu-Application-Platform/1.1/tap/GUID-install.html#install-profile
- 安装 TAP Full Profile
注意:TAP 的安装依赖于主机 / Host 性能、网络带宽等因素的影响,可能需要比较久的时间;在此期间如果发生 tanzu CLI 退出的情况,无需进行人工调试,等待至少 45min 后再通过基本的 Kubernetes 调试技巧进行故障排查。
tanzu package install tap -p tap.tanzu.vmware.com -v $TAP_VERSION \ --values-file tap-values.yml \ --poll-timeout 45m \ --namespace $TAP_NAMESPACETanzu Application Platform v1.1 部署后,功能验证
- 创建应用运行 Domain 与租户配置
运行在 TAP 中的托管应用,通过 Kubernetes Namespace 进行租户隔离;同时根据租户应用所在的 Namespace,分配一个访问应用的 URL,供应用的使用者访问;
下面的步骤,用来创建租户应用的 Kubernetes Namespace:
# Set the developer namespace value to 'default'
export TAP_DEV_NAMESPACE="default"
# Create a namespace for the developer to work in
kubectl create ns $TAP_DEV_NAMESPACE
# Add the secret for the BUILD Container Registry
tanzu secret registry add registry-credentials \
--server $DOCKER_SERVER \
--username $DOCKER_USERNAME \
--password $DOCKER_PASSWORD \
--namespace $TAP_DEV_NAMESPACE
# Obtain the service accounts file
curl -o serviceaccounts.yml https://raw.githubusercontent.com/benwilcock/TAPonLAP/main/TAPonLAPv1.1/serviceaccounts.yml
# Add the necessary RBAC Roles, Accounts, Bindings etc...
kubectl -n $TAP_DEV_NAMESPACE apply -f "serviceaccounts.yml" - 创建 TAP 托管的 Web 类型应用
在 TAP 的环境中,可以运行不同类型 (风格) 的应用,例如:传统 Spring MVC 风格的应用,或者基于 Microservice 架构的 API 风格的应用,比如:SpringBoot + Spring Cloud Service 类型的应用;下面的例子,演示一个基于 Spring Boot 的 API 风格的应用通过 TAP 进行安装、运行和访问和托管;其它风格的应用的部署,参考官方文档或者咨询 VMware 专家;
利用 Tanzu TAP 运行基于 K8S 的 Web 或者 API 应用,无需使用者提前进行 OCI 镜像的打包;平台服务负责应用 OCI 镜像的构建与 K8S 部署模板的实例化;TAP 开箱即用的模板引擎,甚至还负责应用的配置管理与蓝绿发布,K8S Reliability 等模板的实例化,极大的简化了 Dev 对 K8S 的应用流程;
# Create the workload
tanzu apps workload create tanzu-java-web-app \
--git-repo https://github.com/sample-accelerators/tanzu-java-web-app \
--git-branch main \
--type web \
--label app.kubernetes.io/part-of=tanzu-java-web-app \
--label tanzu.app.live.view=true \
--label tanzu.app.live.view.application.name=tanzu-java-web-app \
--annotation autoscaling.knative.dev/minScale=1 \
--namespace $TAP_DEV_NAMESPACE \
--yes
# Watch the platform build the workload. Press Ctrl-C to exit.
tanzu apps workload tail tanzu-java-web-app --since 10m --timestamp安装成功后的验证如下:

结束语
Tanzu Application Platform 的安装具有高度的可定制以满足不同场景,角色,可用性等配置与安装需求;相信读者在实践 TAP 的安装过程中,一定会遇到特殊的配置场景,环境等因素导致安装失败;这种情况,请阅读 TAPv1.0 官方安装手册,里面有更为详细的配置与环境说明;Troubleshooting 技巧与工具的使用,以及遇到特殊问题后的 Support 渠道说明;
作者简介:
毕建华,VMware 大中华区应用现代化部门高级解决方案架构师。多年来一直从事云原生相关领域工作,包括系统设计以及参与多种容器调度平台开发,部署,运维工作;包括,基于 Mesos、DCOS 平台,开发 Dbaas 框架;参与 Kubernetes 开源项目 KUDO 的开发与推广;CNCF 认证 CKA 工程师;VMware 认证 Spring Professional 工程师。
来源|公众号:VMwareTanzu 云原生
边栏推荐
- 解决wireshark中npcap安装失败问题
- Leetcode第 79 场双周赛-完成所有题目
- Déterminer si le processus a des privilèges d'administrateur
- ECMAScript 6语法新增(简记)
- Write the data in the JSON file to the database
- 基于对应点关系的——两片点云剔除(保留)重复点
- Time complexity and space complexity
- 问题:拦截导弹
- Position coding in self attention mechanism
- Flink 系例 之 CountWindowAll
猜你喜欢

常用字符串输入流整理(gets()、fgets、getline()、cin.get()、cin.getline())

Getting started with pytorch: training a deep neural network (DNN)

QT---创建对话框3:形状可变对话框的实现
![[prepare for interview] punch in daily interview questions - Summary of MySQL related interview questions (I)](/img/17/44ceaf766836a38ee0176026a14d37.jpg)
[prepare for interview] punch in daily interview questions - Summary of MySQL related interview questions (I)

C # student management system designed to cope with most examination sites involved in the final period

jacoco精确到行整理

Cremb Pro backend sub administrator 403 problem analysis

Analyse de la capture de paquets wireshark

李宏毅老师《机器学习》课程笔记-4.1 Self-attention

error NU1202: Package Volo. Abp. Cli 5.2.1 is not compatible with netcoreapp3.1
随机推荐
ArcGIS application (XVIII) detailed explanation of display accuracy change of ArcGIS vector layer attribute table
将json文件里面的数据写入数据库
词向量:GloVe 模型详解
Marketing strategy and supply forecast report of China's rice industry from 2022 to 2027 (New Edition)
SQL practice: SQL solves problems in recent X days
Machine learning notes - Interpretation of transformer/attention papers
Basic usage of MySQL database
Solution to permission denied in pushing code to coding
OSPF route summary experiment
What is the 8b/10b code?
Flink 系例 之 CountWindow
error NU1202: Package Volo. Abp. Cli 5.2.1 is not compatible with netcoreapp3.1
免费提供 Artalk 服务及数据托管
Wonderful adventures of MySQL
Xshell download, install and use simple tutorial
Alibaba cloud OCR image recognition process
QT上位机 通过EGM实时控制ABB
Position coding in self attention mechanism
Two Sum
SQL practice part: SQL row column conversion and real problems