Skip to main content

moregeek program

如何安装具有传输层安全性和 azure ad 的 vmware tanzu application platform-多极客编程

如何安装具有传输层安全性和 Azure AD 的 VMware Tanzu Application Platform_应用程序

本文将解决VMware Tanzu Application Platform的安装问题,并使用传输层安全性(TLS)和Microsoft Windows Azure Active Directory(Azure AD)保护UI。但首先,什么是Tanzu应用平台?

VMware Tanzu Application Platform 是一个模块化的应用感知平台,可提供一组丰富的开发人员工具和预先铺就的生产路径。此外,它还允许开发人员在任何合规的公共云或本地 Kubernetes 集群上快速安全地构建和部署软件。

下面是一个很好的图表,说明Tanzu应用程序平台的概念是什么。要更深入地了解 Tanzu Application Platform 的工作原理,请阅读 Gowtham Shankar 的这篇文章。

如何安装具有传输层安全性和 Azure AD 的 VMware Tanzu Application Platform_.net_02

安装 Tanzu 应用程序平台非常简单,但这篇文章仍然会帮助解决一些问题。

  1. 首先,请查看先决条件。
  2. 您还需要有权访问 VMware Tanzu Network。
  3. 从 Tanzu 网络下载适用于您的操作系统的 Tanzu 命令行界面 (CLI),然后将其解压缩。
  4. 接下来,您需要在此处下载 Cluster Essentials for VMware Tanzu。
  5. 确保您已接受所有适用的 EULA。
  6. 您还需要一个域,并专门为Tanzu应用程序平台开辟一个子域。请注意,注册表是必需的 - 对于下面的所有示例,将使用 Harbor。

解决了所有这些问题,让我们开始设置一些有用的导出。

export INSTALL_BUNDLE=registry.tanzu.vmware.com/tanzu-cluster-essentials/cluster-essentials-bundle@sha256:ab0a3539da241a6ea59c75c0743e9058511d7c56312ea3906178ec0f3491f51d
export INSTALL_REGISTRY_HOSTNAME=registry.tanzu.vmware.com
export INSTALL_REGISTRY_USERNAME=TANZU-NET-USER
export INSTALL_REGISTRY_PASSWORD=TANZU-NET-PASSWORD
export TAP_VERSION=1.1.0

请注意,以上内容适用于 Tanzu 应用程序平台 1.1.x。如果您尝试安装比此版本更早的版本,则需要查看 Tanzu 应用程序平台文档以获得正确的 I。​​INSTALL_BUNDLE​​​​NSTALL_BUNDLE​

创建一个命名空间以将 Tanzu 应用程序平台安装到其中。

kubectl create ns tap-install

现在,您需要 cd 到解压缩 Tanzu Cluster Essentials 的目录中。

cd $HOME/tanzu-cluster-essentials ## Or wherever you have cluster-essentials untarred

运行安装程序脚本。

./install.sh --yes

如果一切顺利完成,您可以继续将 kapp 复制到我们的路径。

sudo cp $HOME/tanzu-cluster-essentials/kapp /usr/local/bin/kapp ##Or wherever you have cluster-essentials untarred

接下来,安装 Tanzu CLI。

export TANZU_CLI_NO_INIT=true
cd $HOME/tanzu  # or wherever you downloaded the cli
install cli/core/VERSION/tanzu-core-darwin_amd64 /usr/local/bin/tanzu

请务必检查您的版本。

tanzu version

确认版本后,完成插件的全新安装。

tanzu plugin clean

cd $HOME/tanzu # again wherever you have downloaded this
tanzu plugin install --local cli all # make sure you are not in the cli directory when you do this go one directory above it

检查插件。

tanzu plugin list

需要创建容器注册表机密(即 Docker 注册表机密)。

tanzu secret registry add tap-registry \
--username ${INSTALL_REGISTRY_USERNAME} --password ${INSTALL_REGISTRY_PASSWORD} \
--server ${INSTALL_REGISTRY_HOSTNAME} \
--export-to-all-namespaces --yes --namespace tap-install

通过运行以下命令将 Tanzu 应用程序平台包存储库添加到群集:

tanzu package repository add tanzu-tap-repository \
--url registry.tanzu.vmware.com/tanzu-application-platform/tap-packages:$TAP_VERSION \
--namespace tap-install

获取 Tanzu 应用程序平台包存储库的状态,并通过运行以下命令确保状态更新成功为“协调”:

tanzu package repository get tanzu-tap-repository --namespace tap-install

接下来,需要创建 Tanzu 应用程序平台值文件。下面是一些简单的选项,但同样,我们的最终目标是在最终安装中使用 TLS 和 Azure AD。

您可以​​在此处​​找到值文件的示例。下面是标准 Tanzu 应用程序平台值文件的示例。

profile: full
ceip_policy_disclosed: true # Installation fails if this is set to 'false'
buildservice:
kp_default_repository: myharbor.com/tap/build-service
kp_default_repository_username: YOUR_REGISTRY_USER
kp_default_repository_password: YOUR_REGISTRY_PASSWORD
tanzunet_username: YOUR_TANZU_USERNAME
tanzunet_password: YOUR_TANZU_PASSWORD
descriptor_name: "full"
enable_automatic_dependency_updates: true
supply_chain: basic

cnrs:
domain_name: tap.alexanderbrash.dev
domain_template: "{{.Name}}-{{.Namespace}}.{{.Domain}}"

ootb_supply_chain_basic:
registry:
server: myharbor.com
repository: "tap/supply-chain"
gitops:
ssh_secret: ""

learningcenter:
ingressDomain: "learningcenter.tap.alexanderbrash.dev"

tap_gui:
service_type: ClusterIP
ingressEnabled: "true"
ingressDomain: "tap.alexanderbrash.dev"
app_config:
app:
baseUrl: http://tap-gui.tap.alexanderbrash.dev #Note this must be called tap-gui I tried tap-ui and it did not work
catalog:
locations:
- type: url
target: https://github.com/badraoul/tap-test/blob/main/blank/catalog-info.yaml
backend:
baseUrl: http://tap-gui.tap.alexanderbrash.dev #Note this must be called tap-gui I tried tap-ui and it did not work
cors:
origin: http://tap-gui.tap.alexanderbrash.dev #Note this must be called tap-gui I tried tap-ui and it did not work

metadata_store:
app_service_type: LoadBalancer # (optional) Defaults to LoadBalancer. Change to NodePort for distributions that don't support LoadBalancer

grype:
namespace: "default" # (optional) Defaults to default namespace.
targetImagePullSecret: "tap-registry"

contour:
envoy:
service:
type: LoadBalancer

以下是使用 亚马逊云科技网络负载均衡器 (AWS NLB) 的示例。

profile: full
ceip_policy_disclosed: true # Installation fails if this is set to 'false'
buildservice:
kp_default_repository: myharbor.com/tap/build-service
kp_default_repository_username: HARBOR_USER
kp_default_repository_password: HARBOR_PASSWORD
tanzunet_username: TANZU_NET_USER
tanzunet_password: TANZU_NET_PASSWORD
descriptor_name: "tap-1.0.0-full"
enable_automatic_dependency_updates: true
supply_chain: basic

cnrs:
domain_name: alexanderbrash.dev

ootb_supply_chain_basic:
registry:
server: myharbor.com
repository: "tap/supply-chain"
gitops:
ssh_secret: ""

learningcenter:
ingressDomain: "lab.alexanderbrash.dev"

tap_gui:
service_type: ClusterIP
ingressEnabled: "true"
ingressDomain: "alexanderbrash.dev"
app_config:
app:
baseUrl: http://tap-gui.alexanderbrash.dev
catalog:
locations:
- type: url
target: https://github.com/badraoul/tap-test/blob/main/blank/catalog-info.yaml
backend:
baseUrl: http://tap-gui.alexanderbrash.dev
cors:
origin: http://tap-gui.alexanderbrash.dev

metadata_store:
app_service_type: LoadBalancer # (optional) Defaults to LoadBalancer. Change to NodePort for distributions that don't support LoadBalancer

grype:
namespace: "default" # (optional) Defaults to default namespace.
targetImagePullSecret: "tap-registry"

contour:
infrastructure_provider: aws
envoy:
service:
aws:
LBType: nlb

Below is the desired outcome and an example of using TLS.

profile: full
ceip_policy_disclosed: true # Installation fails if this is set to 'false'
buildservice:
kp_default_repository: myharbor.com/tap/build-service
kp_default_repository_username: HARBOR_USER
kp_default_repository_password: HARBOR_PASSWORD
tanzunet_username: TANZU_NET_USER
tanzunet_password: TANZU_NET_PASSWORD
descriptor_name: "full"
enable_automatic_dependency_updates: true
supply_chain: basic

cnrs:
domain_name: tap-lab.alexanderbrash.net
domain_template: "{{.Name}}-{{.Namespace}}.{{.Domain}}"
default_tls_secret: tls-certs/tap-lab-alexbrash-net-wldcrd

ootb_supply_chain_basic:
registry:
server: myharbor.com
repository: "tap/supply-chain"
gitops:
ssh_secret: ""

learningcenter:
ingressDomain: "learningcenter.tap-lab.alexanderbrash.net"

tap_gui:
service_type: ClusterIP
ingressEnabled: "true"
ingressDomain: "tap-lab.alexanderbrash.net"
tls:
secretName: tap-lab-alexbrash-net-wldcrd
namespace: tls-certs
app_config:
app:
baseUrl: https://tap-gui.tap-lab.alexanderbrash.net
catalog:
locations:
- type: url
target: https://github.com/badraoul/tap-test/blob/main/blank/catalog-info.yaml
backend:
baseUrl: https://tap-gui.tap-lab.alexanderbrash.net
cors:
origin: https://tap-gui.tap-lab.alexanderbrash.net

metadata_store:
app_service_type: LoadBalancer # (optional) Defaults to LoadBalancer. Change to NodePort for distributions that don't support LoadBalancer

grype:
namespace: "default" # (optional) Defaults to default namespace.
targetImagePullSecret: "tap-registry"

contour:
envoy:
service:
type: LoadBalancer

要使 TLS 正常工作,您需要为 Envoy 创建一个 TLS 委派和一个命名空间来保存 TLS 机密。

因此,首先,创建命名空间。

kubectl create ns tls-certs

接下来,生成 TLS 委派资源。

cat <<EOF > tls-delegation.yaml
apiVersion: projectcontour.io/v1
kind: TLSCertificateDelegation
metadata:
name: tap-lab-alexbrash-net-wldcrd
namespace: tls-certs
spec:
delegations:
- secretName: tap-lab-alexbrash-net-wldcrd
targetNamespaces:
- "*"

EOF
kubectl apply -f tls-delegation.yaml

现在,在 TLS 证书命名空间中创建证书。

kubectl create secret tls tap-lab-alexbrash-net-wldcrd --key cert-key.pem --cert cert.pem -n tls-certs

之后,添加 Azure AD。默认情况下,Tanzu 应用程序平台 GUI 使用来宾帐户,但 Backstage 支持不同的身份验证提供程序(您可以在此处找到列表)。

将 TLS 添加到 Tanzu 应用程序平台 GUI 的另一个原因是需要启用身份验证。

在Azure门户中,转到“Azure Active Directory”,然后在“应用注册”下单击“新注册”。从这里,只需为其命名,然后在“支持的帐户类型”下为您的组织选择适当的选项。(在此示例中,选择了默认选项。最后,在“重定向URI”下,为平台选择“Web”。

如何安装具有传输层安全性和 Azure AD 的 VMware Tanzu Application Platform_应用程序_03

接下来,输入以下统一资源标识符 (URI):

https://tap-gui.yourdomain/api/auth/microsoft/handler/frame

然后,需要创建客户端密码。在“证书和机密”下,选择“新建客户端机密”,然后按照提示操作。请注意,您的客户端密钥是“值”而不是密钥 ID。 (我犯了这个错误,并且正在解决为什么有一段时间不起作用。

对于值文件,您将需要以下三件事:

  1. 客户端标识
  2. 租户标识
  3. 客户端密码

您的值文件现在将如下所示:

profile: full
ceip_policy_disclosed: true # Installation fails if this is set to 'false'
buildservice:
kp_default_repository: HARBOR_REGISTRY_URL/tap/build-service
kp_default_repository_username: HARBOR_USER
kp_default_repository_password: HARBOR_PASSWORD
tanzunet_username: TANZU_NET_USER
tanzunet_password: TANZU_NET_PASSWORD
descriptor_name: "full"
enable_automatic_dependency_updates: true
supply_chain: basic

cnrs:
domain_name: tap.alexanderbrash.dev
domain_template: "{{.Name}}-{{.Namespace}}.{{.Domain}}"
default_tls_secret: tls-certs/tap-alexbrash-dev-wildcard

ootb_supply_chain_basic:
registry:
server: HARBOR_REGISTRY_URL
repository: "tap/supply-chain"
gitops:
ssh_secret: ""

learningcenter:
ingressDomain: "learningcenter.tap.alexanderbrash.dev"

tap_gui:
service_type: ClusterIP
ingressEnabled: "true"
ingressDomain: "tap.alexanderbrash.dev"
tls:
secretName: tap-alexbrash-dev-wildcard
namespace: tls-certs
app_config:
auth:
allowGuestAccess: false
environment: development
providers:
microsoft:
development:
clientId: AZURE_CLIENTID
clientSecret: AZURE_CLIENT_SECRET
tenantId: AZURE_TENANTID
app:
baseUrl: https://tap-gui.tap.alexanderbrash.dev
catalog:
locations:
- type: url
target: https://github.com/badraoul/tap-test/blob/main/blank/catalog-info.yaml
backend:
baseUrl: https://tap-gui.tap.alexanderbrash.dev
cors:
origin: https://tap-gui.tap.alexanderbrash.dev

metadata_store:
app_service_type: LoadBalancer # (optional) Defaults to LoadBalancer. Change to NodePort for distributions that don't support LoadBalancer

grype:
namespace: "default" # (optional) Defaults to default namespace.
targetImagePullSecret: "tap-registry"

contour:
envoy:
service:
type: LoadBalancer

解决了所有这些问题,让我们安装Tanzu应用程序平台。

tanzu package install tap -p tap.tanzu.vmware.com -v $TAP_VERSION --values-file tap-values.yml -n tap-install

您需要确保所有包都成功协调。

tanzu package installed list -n tap-install

请注意:安装时间取决于群集中的可用资源。考虑到这一点,我建议至少四个 m5.x 大节点(即四个节点是 4vCPU 和 16GB RAM,至少 70GB 磁盘空间)。

成功的对帐如下图所示:

如何安装具有传输层安全性和 Azure AD 的 VMware Tanzu Application Platform_应用程序_04

就是这样 — 您现在已启动并运行 Tanzu 应用程序平台!

©著作权归作者所有:来自51CTO博客作者Spring_Learnin的原创作品,请联系作者获取转载授权,否则将追究法律责任

api key management with api portal 和 spring cloud gateway for kubernetes-多极客编程

Ignacio Lozano,Karine Pires和Chris Sterling为这篇博文做出了贡献。在当今的数字化转型世界中,API 几乎存在于每个软件产品中。许多团队负责部署和管理大型 API 组合。但是,API 的规模和复杂性也使控制和管理访问变得复杂。具体而言,了解粒度用法并发现见解和利用率可能很困难。使用 API Portal for VMware Tanzu 和 Spring Cl

将全局命名空间和零信任策略与 vmware tanzu service mesh 结合使用-多极客编程

VMware Tanzu Service Mesh 提供联合 Istio 服务,为企业客户带来核心开源项目之外的重要价值,提高应用程序安全性、弹性和多云运营。启用此附加值的 Tanzu 服务网格的主要构造是全局命名空间 (GNS) 的概念。GNS 允许平台运营商和开发人员使用 Tanzu Service Mesh 连接应用程序服务,而无需指定(甚至不知道)任何底层基础设施详细信息,因为所有网格操作

#yyds干货盘点# 名企真题专题:游戏任务标记-多极客编程

1.简述:描述游戏里面有很多各式各样的任务,其中有一种任务玩家只能做一次,这类任务一共有1024个,任务ID范围[1,1024]。请用32个unsigned int类型来记录着1024个任务是否已经完成。初始状态都是未完成。 输入两个参数,都是任务ID,需要设置第一个ID的任务为已经完成;并检查第二个ID的任务是否已经完成。 输出一个参数,如果第二个ID的任务已经完成输出1,如果未完成输出0。如果

折腾了我一周,原来netty网络编程就是这么个破玩意儿!!!-多极客编程

1、阻塞 阻塞模式下,相关方法都会导致线程暂停 ServerSocketChannel.accept 会在没有连接建立时让线程暂停 SocketChannel.read 会在通道中没有数据可读时让线程暂停 阻塞的表现其实就是线程暂停了,暂停期间不会占用 cpu,但线程相当于闲置 单线程下,阻塞方法之间相互影响,几乎不能正常工作,需要多线程支持 但多线程下,有新的问题,体现在以下方面 32

mybatis详解-多极客编程

Hello,我是CoderBug,今天我们来学习Mybatis.1.什么是Mybatis?MyBatis 是一个 Java 持久层框架,它提供了一种简单的方法来映射 Java 对象到数据库表中。它允许你使用简单的 SQL 或存储过程来访问数据库,而无需手写任何 JDBC 代码。2. Mybatis有哪些优点?MyBatis 的主要优点之一是它的灵活性。它提供了很多的配置选项,允许你根据需要自定义映

dubbo 3 之 triple 流控反压原理解析-多极客编程

作者:顾欣 Triple 是 Dubbo 3 提出的基于 HTTP2 的开放协议,旨在解决 Dubbo 2 私有协议带来的互通性问题。 Triple 基于 HTTP/2 定制自己的流控,支持通过特定的异常通知客户端业务层服务端负载高情况,保护了服务端被大流量击垮,提高系统高可用能力。 一、流控反压现状 客户端和服务器端在接收数据的时候有一个缓冲区来临时存储数据,但是缓冲区的大小是有限制的,所以

python-多极客编程

字符串的定义 字符串类型是 Python里面最常见的类型。我们可以简单地通过在引号间包含字符的方式创建它。Python里面单引号和双引号的作用是相同的。字符串是一种直接量或者说是一种标量,这意味着 Python解释器在处理字符串时是把它作为单一值并且不会包含其他 Python类型的。字符串是不可变类型,就是说改变一个字符串的元素需要新建一个新的字符串。字符串是由独立的字符组成的,并且这些字符可以

api key management with api portal 和 spring cloud gateway for kubernetes-多极客编程

Ignacio Lozano,Karine Pires和Chris Sterling为这篇博文做出了贡献。在当今的数字化转型世界中,API 几乎存在于每个软件产品中。许多团队负责部署和管理大型 API 组合。但是,API 的规模和复杂性也使控制和管理访问变得复杂。具体而言,了解粒度用法并发现见解和利用率可能很困难。使用 API Portal for VMware Tanzu 和 Spring Cl

将全局命名空间和零信任策略与 vmware tanzu service mesh 结合使用-多极客编程

VMware Tanzu Service Mesh 提供联合 Istio 服务,为企业客户带来核心开源项目之外的重要价值,提高应用程序安全性、弹性和多云运营。启用此附加值的 Tanzu 服务网格的主要构造是全局命名空间 (GNS) 的概念。GNS 允许平台运营商和开发人员使用 Tanzu Service Mesh 连接应用程序服务,而无需指定(甚至不知道)任何底层基础设施详细信息,因为所有网格操作

冒泡排序-多极客编程

一、冒泡排序的原理二、冒泡排序的逻辑解释三、代码实现四、代码优化一、冒泡排序的原理1、比较相邻的元素。如果第一个比第二个大,就交换他们两个。2、对每一对相邻元素做同样的工作,从开始第一对到结尾的最后一对。在这一点,最后的元素应该会是最大的数。3、针对所有的元素重复以上的步骤,除了最后一个。4、持续每次对越来越少的元素重复上面的步骤,直到没有任何一对数字需要比较。二、冒泡排序的逻辑解释有十个数字:1

折腾了我一周,原来netty网络编程就是这么个破玩意儿!!!-多极客编程

1、阻塞 阻塞模式下,相关方法都会导致线程暂停 ServerSocketChannel.accept 会在没有连接建立时让线程暂停 SocketChannel.read 会在通道中没有数据可读时让线程暂停 阻塞的表现其实就是线程暂停了,暂停期间不会占用 cpu,但线程相当于闲置 单线程下,阻塞方法之间相互影响,几乎不能正常工作,需要多线程支持 但多线程下,有新的问题,体现在以下方面 32

3:tomcat部署web项目-java web-多极客编程

(目录) 3.1 Web 应用程序 一个 web 应用程序是由一组 Servlet,HTML 页面,类,以及其它的资源组成的运行在 web服务器上的完整的应用程序,以一种结构化的有层次的目录形式存在 在 webapps目录下的每一个子目录都是一个独立的 web 应用程序,子目录的名字就是 web 应用程序的名字,用户通过 web应用程序的根目录来访问 web 应用程序中的资源 WEB-INF目录