vCPU
在您可以安装 OpenShift Container Platform 之前,必须配置 Microsoft Azure 帐户。
所有可通过公共端点使用的 Azure 资源都受资源名称限制,您无法创建使用某些术语的资源。有关 Azure 限制的术语列表,请参阅 Azure 文档中的解决保留的资源名称错误。 |
OpenShift Container Platform 集群使用许多 Microsoft Azure Stack Hub 组件,并且默认的Azure Stack Hub 中的配额类型会影响您安装 OpenShift Container Platform 集群的能力。
下表总结了其限制可能会影响您安装和运行 OpenShift Container Platform 集群的 Azure Stack Hub 组件。
组件 | 默认情况下所需的组件数量 | 描述 | ||||||
---|---|---|---|---|---|---|---|---|
vCPU |
56 |
默认集群需要 56 个 vCPU,因此您必须增加帐户限制。 默认情况下,每个集群都会创建以下实例:
由于引导程序、控制平面和工作机器使用的是 要部署更多工作节点、启用自动缩放、部署大型工作负载或使用不同实例类型,必须进一步增加帐户的 vCPU 限制,以确保集群能够部署所需的机器。 |
||||||
虚拟网络 (VNet) |
1 |
每个默认集群需要一个虚拟网络 (VNet),其中包含两个子网。 |
||||||
网络接口 |
7 |
每个默认集群需要七个网络接口。如果创建更多机器或已部署的工作负载创建负载均衡器,则集群将使用更多网络接口。 |
||||||
网络安全组 |
2 |
每个集群都会为 VNet 中的每个子网创建网络安全组。默认集群会为控制平面和计算节点子网创建网络安全组。
|
||||||
网络负载均衡器 |
3 |
每个集群都会创建以下负载均衡器
如果应用程序创建更多 Kubernetes |
||||||
公共 IP 地址 |
2 |
公共负载均衡器使用公共 IP 地址。引导机器也使用公共 IP 地址,以便您可以通过 SSH 连接到该机器以在安装过程中排除故障。引导节点的 IP 地址仅在安装期间使用。 |
||||||
私有 IP 地址 |
7 |
内部负载均衡器、三台控制平面机器中的每台和三台工作机器中的每台都使用私有 IP 地址。 |
要在 Azure Stack Hub 上成功安装 OpenShift Container Platform,必须在 Azure Stack Hub DNS 区域中创建 DNS 记录。DNS 区域必须是该域的权威区域。要将注册商的 DNS 区域委派给 Azure Stack Hub,请参阅 Microsoft 关于Azure Stack Hub 数据中心 DNS 集成的文档。
您的 Microsoft Azure Stack Hub 帐户必须具有您使用的订阅的以下角色:
所有者
要在 Azure 门户上设置角色,请参阅 Microsoft 文档中的使用基于角色的访问控制管理对 Azure Stack Hub 中资源的访问。
由于 OpenShift Container Platform 及其安装程序使用 Azure 资源管理器创建 Microsoft Azure 资源,因此必须创建服务主体来表示它。
安装或更新Azure CLI。
您的 Azure 帐户具有您使用的订阅所需的权限。
注册您的环境
$ az cloud register -n AzureStackCloud --endpoint-resource-manager <endpoint> (1)
1 | 指定 Azure 资源管理器端点,`https://management.<region>.<fqdn>/`。 |
有关详细信息,请参阅Microsoft 文档。
设置活动环境
$ az cloud set -n AzureStackCloud
更新您的环境配置以使用 Azure Stack Hub 的特定 API 版本。
$ az cloud update --profile 2019-03-01-hybrid
登录到 Azure CLI
$ az login
如果您处于多租户环境中,还必须提供租户 ID。
如果您的 Azure 帐户使用订阅,请确保您正在使用正确的订阅。
查看可用帐户列表并记录要用于集群的订阅的tenantId
值。
$ az account list --refresh
[
{
"cloudName": AzureStackCloud",
"id": "9bab1460-96d5-40b3-a78e-17b15e978a80",
"isDefault": true,
"name": "Subscription Name",
"state": "Enabled",
"tenantId": "6057c7e9-b3ae-489d-a54e-de3f6bf6a8ee",
"user": {
"name": "[email protected]",
"type": "user"
}
}
]
查看您的活动帐户详细信息,并确认tenantId
值与您要使用的订阅匹配。
$ az account show
{
"environmentName": AzureStackCloud",
"id": "9bab1460-96d5-40b3-a78e-17b15e978a80",
"isDefault": true,
"name": "Subscription Name",
"state": "Enabled",
"tenantId": "6057c7e9-b3ae-489d-a54e-de3f6bf6a8ee", (1)
"user": {
"name": "[email protected]",
"type": "user"
}
}
1 | 确保tenantId 参数的值是正确的订阅 ID。 |
如果您没有使用正确的订阅,请更改活动订阅。
$ az account set -s <subscription_id> (1)
1 | 指定订阅 ID。 |
验证订阅 ID 更新。
$ az account show
{
"environmentName": AzureStackCloud",
"id": "33212d16-bdf6-45cb-b038-f6565b61edda",
"isDefault": true,
"name": "Subscription Name",
"state": "Enabled",
"tenantId": "8049c7e9-c3de-762d-a54e-dc3f6be6a7ee",
"user": {
"name": "[email protected]",
"type": "user"
}
}
记录输出中的tenantId
和id
参数值。您在 OpenShift Container Platform 安装过程中需要这些值。
为您的帐户创建服务主体
$ az ad sp create-for-rbac --role Contributor --name <service_principal> \ (1)
--scopes /subscriptions/<subscription_id> (2)
--years <years> (3)
1 | 指定服务主体名称。 |
2 | 指定订阅 ID。 |
3 | 指定年数。默认情况下,服务主体一年后过期。使用--years 选项可以延长服务主体的有效期。 |
Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>'
The output includes credentials that you must protect. Be sure that you do not
include these credentials in your code or check the credentials into your source
control. For more information, see https://aka.ms/azadsp-cli
{
"appId": "ac461d78-bf4b-4387-ad16-7e32e328aec6",
"displayName": <service_principal>",
"password": "00000000-0000-0000-0000-000000000000",
"tenantId": "8049c7e9-c3de-762d-a54e-dc3f6be6a7ee"
}
记录上一个输出中的appId
和password
参数值。您在 OpenShift Container Platform 安装过程中需要这些值。
安装 OpenShift Container Platform 集群
按照使用 ARM 模板在 Azure Stack Hub 上安装集群,在 Azure Stack Hub 上使用用户预配的基础架构安装 OpenShift Container Platform 集群。