$ rosa create cluster --cluster-name=<cluster_name> --debug
使用Red Hat OpenShift Service on AWS (ROSA) CLI (rosa
) 管理对象,例如添加dedicated-admin
用户,管理集群和调度集群升级。
要访问只能通过HTTP代理服务器访问的集群,您可以设置 |
这些常用命令和参数可用于Red Hat OpenShift Service on AWS (ROSA) CLI (rosa
)。
将指定软件的最新兼容版本下载到当前目录中的存档文件中。解压缩存档的内容并将内容添加到您的路径中以使用该软件。要下载最新的ROSA CLI,请指定rosa
。要下载最新的OpenShift CLI,请指定oc
。
$ rosa download <software>
显示ROSA CLI (rosa
) 的常规帮助信息以及可用命令的列表。此选项也可作为参数使用,以显示父命令(例如version
或create
)的帮助信息。
显示ROSA CLI的常规帮助。
$ rosa --help
显示version
的常规帮助。
$ rosa version --help
Red Hat OpenShift Service on AWS (ROSA) CLI (rosa
) 使用具有子命令的父命令来管理对象。父命令为create
、edit
、delete
、list
和describe
。并非所有父命令都可以与所有子命令一起使用。有关更多信息,请参阅描述子命令的特定参考主题。
本节描述集群和资源的create
命令。
为您的集群创建所需的帐户范围角色和策略资源。
$ rosa create account-roles [flags]
选项 | 定义 |
---|---|
--debug |
启用调试模式。 |
-i, --interactive |
启用交互模式。 |
-m, --mode string |
如何执行操作。有效选项为
|
--path string |
帐户范围角色和策略(包括Operator策略)的Amazon资源名称 (ARN) 路径。 |
--permissions-boundary string |
用于设置帐户角色权限边界的策略的ARN。 |
--prefix string |
所有生成的AWS资源的用户定义前缀。默认为 |
--profile string |
使用您凭据文件中的特定AWS配置文件。 |
-y, --yes |
自动回答yes以确认操作。 |
创建一个集群管理员,并使用自动生成的密码登录集群。
$ rosa create admin --cluster=<cluster_name>|<cluster_id>
选项 | 定义 |
---|---|
--cluster <cluster_name>|<cluster_id> |
必填。要添加到身份提供商 (IDP) 的集群名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile string |
指定凭证文件中的 AWS 配置文件。 |
创建一个集群管理员,可以登录名为 mycluster
的集群。
$ rosa create admin --cluster=mycluster
为启用了外部身份验证的托管控制平面集群创建应急凭证。
$ rosa create break-glass-credential --cluster=<cluster_name> [arguments]
选项 | 定义 |
---|---|
--cluster <cluster_name>|<cluster_id> |
必填。将添加应急凭证的集群名称或 ID。 |
--expiration |
可选:应急凭证在过期前可使用的时长。过期时长必须至少为 10 分钟,最多为 24 小时。如果未输入值,则过期时长默认为 24 小时。 |
--username |
可选。应急凭证的用户名。如果未输入值,则会为您生成一个随机用户名。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--region |
指定 AWS 区域,覆盖 |
--yes |
自动回答 |
将应急凭证添加到名为 mycluster
的集群。
$ rosa create break-glass-credential --cluster=mycluster
使用交互模式将应急凭证添加到名为 mycluster
的集群。
$ rosa create break-glass-credential --cluster=mycluster -i
创建一个新集群。
$ rosa create cluster --cluster-name=<cluster_name> [arguments]
选项 | 定义 | ||
---|---|---|---|
--additional-compute-security-group-ids <sec_group_id> |
一个或多个附加安全组的标识符,与与集群一起创建的标准机器池一起使用的默认安全组一起使用。有关附加安全组的更多信息,请参阅附加资源下的安全组的要求。 |
||
--additional-infra-security-group-ids <sec_group_id> |
一个或多个附加安全组的标识符,与与集群一起创建的 infra 节点一起使用的默认安全组一起使用。有关附加安全组的更多信息,请参阅附加资源下的安全组的要求。 |
||
--additional-control-plane-security-group-ids <sec_group_id> |
一个或多个附加安全组的标识符,与与集群一起创建的控制平面节点一起使用的默认安全组一起使用。有关附加安全组的更多信息,请参阅附加资源下的安全组的要求。 |
||
--additional-allowed-principals <arn> |
要添加到托管控制平面的 VPC 端点服务的其他允许的 Principal ARN 的逗号分隔列表,以允许自动接受其他 VPC 端点连接请求。 |
||
--cluster-name <cluster_name> |
必填。集群的名称。与 |
||
--compute-machine-type <instance_type> |
集群中计算节点的实例类型。这决定了分配给每个计算节点的内存和 vCPU 量。有关有效实例类型的更多信息,请参阅ROSA 服务定义中的AWS 实例类型。 |
||
--controlplane-iam-role <arn> |
要附加到控制平面实例的 IAM 角色的 ARN。 |
||
--create-cluster-admin |
可选。作为集群创建的一部分,为您的集群创建一个本地管理员用户( |
||
--cluster-admin-user |
可选。与 |
||
--cluster-admin-password |
可选。与 |
||
--disable-scp-checks |
指示在尝试安装集群时是否禁用云权限检查。 |
||
--dry-run |
模拟创建集群。 |
||
--domain-prefix |
可选:与 |
||
--ec2-metadata-http-tokens string |
配置对 EC2 实例使用 IMDSv2。有效值为 |
||
--enable-autoscaling |
启用计算节点的自动缩放。默认情况下,自动缩放设置为 |
||
--etcd-encryption |
启用在 AWS 上的 Red Hat OpenShift Service(经典架构)集群上对 ETCD 键值进行加密。 |
||
--etcd-encryption-kms-arn |
使用在 AWS Key Management Service 中管理的客户管理的密钥启用 ETCD 存储的加密。 |
||
--host-prefix <subnet> |
分配给每个节点的子网前缀长度(整数)。例如,如果主机前缀设置为 |
||
--machine-cidr <address_block> |
ROSA 在安装集群时使用的 IP 地址块 (ipNet),例如
|
||
--max-replicas <number_of_nodes> |
启用自动缩放时指定计算节点的最大数量。默认值: |
||
--min-replicas <number_of_nodes> |
启用自动缩放时指定计算节点的最小数量。默认值: |
||
--multi-az |
部署到多个数据中心。 |
||
--no-cni |
创建一个没有容器网络接口 (CNI) 插件的集群。然后,客户可以自带 CNI 插件并在集群创建后安装它。 |
||
--operator-roles-prefix <string> |
OpenShift 安装程序所需的运算符使用的所有 IAM 角色使用的前缀。如果您未指定前缀,则会自动生成一个前缀。 |
||
--pod-cidr <address_block> |
分配 Pod IP 地址的 IP 地址块 (ipNet),例如
|
||
--private |
将主 API 端点和应用程序路由限制为直接的专用连接。 |
||
--private-link |
指定使用 AWS PrivateLink 在 VPC 和服务之间提供专用连接。使用 |
||
--region <region_name> |
您的工作程序池所在的 AWS 区域的名称,例如 |
||
--replicas n |
每个可用区要预配的工作节点数量。单区域集群至少需要 2 个节点。多区域集群至少需要 3 个节点。默认值:单区域集群为 |
||
--role-arn <arn> |
OpenShift Cluster Manager 用于创建集群的安装程序角色的 ARN。如果您尚未创建帐户角色,则需要此参数。 |
||
--service-cidr <address_block> |
服务使用的IP地址块 (ipNet),例如,
|
||
--sts | --non-sts |
指定是使用AWS安全令牌服务(STS)还是IAM凭证(非STS)来部署集群。 |
||
--subnet-ids <aws_subnet_id> |
安装集群时使用的AWS子网ID,例如, 使用 |
||
--support-role-arn string |
Red Hat站点可靠性工程师(SRE)用来访问集群帐户以提供支持的角色的ARN。 |
||
--tags |
在AWS中用于Red Hat OpenShift Service on AWS创建的资源上的标签。标签可以帮助您在AWS中管理、识别、组织、搜索和筛选资源。标签用逗号分隔,例如:“key value, foo bar”。
|
||
--version string |
将用于安装集群或集群资源的ROSA版本。对于 |
||
--worker-iam-role string |
将附加到计算实例的IAM角色的ARN。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
创建一个名为mycluster
的集群。
$ rosa create cluster --cluster-name=mycluster
使用特定的AWS区域创建一个集群。
$ rosa create cluster --cluster-name=mycluster --region=us-east-2
在默认工作节点机器池上启用自动伸缩功能创建一个集群。
$ rosa create cluster --cluster-name=mycluster -region=us-east-1 --enable-autoscaling --min-replicas=2 --max-replicas=5
添加外部身份提供程序,而不是OpenShift OAuth2服务器。
您只能在具有HCP集群的ROSA上使用外部身份验证提供程序。 |
$ rosa create external-auth-provider --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--claim-mapping-groups-claim <string> |
必填。描述如何将来自ID令牌的信息转换为集群身份的规则。 |
--claim-validation-rule <strings> |
用于验证令牌声明以对用户进行身份验证的规则。输入将采用 |
--claim-mapping-username-claim <string> |
应用于构建集群身份用户名的声明的名称。 |
--cluster <cluster_name>|<cluster_id> |
必填。将添加IDP的集群的名称或ID。 |
--console-client-id <string> |
来自OIDC提供商的用于OpenShift集群管理器 Web控制台的OIDC客户端的标识符。 |
--console-client-secret <string> |
与控制台应用程序注册相关的密钥。 |
--issuer-audiences <strings> |
一个用于检查传入令牌的受众数组。有效令牌必须在其受众声明中包含至少一个这些值。 |
--issuer-ca-file <string> |
向服务器发出请求时要使用的PEM编码证书文件的路径。 |
--issuer-url <string> |
令牌发行者的服务URL。 |
--name <string> |
用于引用外部身份验证提供程序的名称。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定来自您的凭据文件的AWS配置文件字符串。 |
将Microsoft Entra ID身份提供程序添加到名为mycluster
的集群。
$ rosa create external-auth-provider --cluster=mycluster --name <provider_name> --issuer-audiences <audience_id> --issuer-url <issuing id> --claim-mapping-username-claim email --claim-mapping-groups-claim groups
添加身份提供程序(IDP)以定义用户如何登录到集群。
$ rosa create idp --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster <cluster_name>|<cluster_id> |
必填。将添加IDP的集群的名称或ID。 |
--ca <path_to_file> |
向服务器发出请求时要使用的PEM编码证书文件的路径,例如, |
--client-id |
来自注册应用程序的客户端ID(字符串)。 |
--client-secret |
来自注册应用程序的客户端密钥(字符串)。 |
--mapping-method |
指定新身份(字符串)在登录时如何映射到用户。默认值: |
--name |
身份提供程序的名称(字符串)。 |
--type |
身份提供程序的类型(字符串)。选项: |
选项 | 定义 |
---|---|
--hostname |
与托管的GitHub Enterprise实例一起使用的可选域(字符串)。 |
--organizations |
指定登录访问的组织。只有至少属于列出组织(字符串)之一的成员才能登录。 |
--teams |
指定登录访问的团队。只有至少属于列出团队(字符串)之一的成员才能登录。格式为 |
选项 | 定义 |
---|---|
--host-url |
GitLab提供程序的主机URL(字符串)。默认值: |
选项 | 定义 |
---|---|
--hosted-domain |
将用户限制为Google Apps域(字符串)。 |
选项 | 定义 |
---|---|
--bind-dn |
在搜索阶段要绑定的域名(字符串)。 |
--bind-password |
在搜索阶段要绑定的密码(字符串)。 |
--email-attributes |
其值应用作电子邮件地址的属性列表(字符串)。 |
--id-attributes |
其值应用作用户ID的属性列表(字符串)。默认值: |
--insecure |
不与服务器建立TLS连接。 |
--name-attributes |
其值应用作显示名称的属性列表(字符串)。默认值: |
--url |
指定用于LDAP搜索参数的RFC 2255 URL(字符串)。 |
--username-attributes |
其值应用作首选用户名的属性列表(字符串)。默认值: |
选项 | 定义 |
---|---|
--email-claims |
用作电子邮件地址的声明列表(字符串)。 |
--extra-scopes |
在授权令牌请求期间,除了 |
--issuer-url |
OpenID 提供商声明的颁发者标识符的 URL(字符串)。它必须使用 HTTPS 方案,且不包含 URL 查询参数或片段。 |
--name-claims |
用作显示名称的声明列表(字符串)。 |
--username-claims |
配置用户时用作首选用户名声明列表(字符串)。 |
--groups-claims |
用作组名称的声明列表(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
将 GitHub 身份提供商添加到名为 mycluster
的集群。
$ rosa create idp --type=github --cluster=mycluster
按照交互式提示添加身份提供商。
$ rosa create idp --cluster=mycluster --interactive
添加入口端点以启用对集群的 API 访问。
$ rosa create ingress --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster <cluster_name>|<cluster_id> |
必需:将添加入口的集群的名称或 ID。 |
--label-match |
入口的标签匹配(字符串)。格式必须是键值对的逗号分隔列表。如果未指定标签,则所有路由都将公开在两个路由器上。 |
--private |
将应用程序路由限制为直接的私有连接。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
将内部入口添加到名为 mycluster
的集群。
$ rosa create ingress --private --cluster=mycluster
将公共入口添加到名为 mycluster
的集群。
$ rosa create ingress --cluster=mycluster
添加具有路由选择器标签匹配的入口。
$ rosa create ingress --cluster=mycluster --label-match=foo=bar,bar=baz
创建一个自定义 KubeletConfig
对象,以允许自定义配置机器池中的节点。对于 AWS 上的 Red Hat OpenShift Service 集群,这些设置是集群范围的。对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,每个机器池的配置可能不同。
$ rosa create kubeletconfig --cluster=<cluster_name|cluster_id> --name=<kubeletconfig_name> --pod-pids-limit=<number> [flags]
选项 | 定义 |
---|---|
--pod-pids-limit <number> |
必需。与 |
-c, --cluster <cluster_name>|<cluster_id> |
必需。创建 |
--name |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,此参数为必需。对于 AWS 上的 Red Hat OpenShift Service,此参数为可选,因为集群只有一个 |
-i, --interactive |
启用交互模式。 |
-h, --help |
显示此命令的帮助。 |
有关设置集群 PID 限制的更多信息,请参阅配置 PID 限制。
将机器池添加到现有集群。
$ rosa create machinepool --cluster=<cluster_name> | <cluster_id> --replicas=<number> --name=<machinepool_name> [arguments]
选项 | 定义 |
---|---|
--additional-security-group-ids <sec_group_id> |
一个或多个附加安全组的标识符,与该机器池的默认安全组一起使用。有关附加安全组的更多信息,请参阅附加资源下的安全组要求。 |
--cluster <cluster_name>|<cluster_id> |
必需:将添加机器池的集群的名称或 ID。 |
--disk-size |
设置机器池的磁盘卷大小(以 GiB 或 TiB 为单位)。默认为 300 GiB。 对于 4.13 版或更早版本的 ROSA(经典架构)集群,最小磁盘大小为 128 GiB,最大值为 1 TiB。对于 4.14 版及更高版本的集群,最小值为 128 GiB,最大值为 16 TiB。 对于使用 HCP 的 ROSA 集群,最小磁盘大小为 75 GiB,最大值为 16384 GiB。 |
--enable-autoscaling |
启用或禁用计算节点的自动缩放。要启用自动缩放,请将此参数与 |
--instance-type |
应使用的实例类型(字符串)。默认值: |
--kubelet-configs <kubeletconfig_name> |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,任何要应用于机器池中节点的 |
--labels |
机器池的标签(字符串)。格式必须是键值对的逗号分隔列表。此列表会持续覆盖对节点标签所做的任何修改。 |
--max-replicas |
启用自动缩放时指定计算节点的最大数量。 |
--min-replicas |
启用自动缩放时指定计算节点的最小数量。 |
--max-surge |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群, 默认值为 |
--max-unavailable |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群, 默认值为 |
--name |
必需:机器池的名称(字符串)。 |
--replicas |
未配置自动缩放时必需。此机器池的机器数量(整数)。 |
--tags |
将用户定义的标签应用于 ROSA 在 AWS 中创建的所有资源。标签用逗号分隔,例如: |
--taints |
机器池的污点。此字符串值应格式化为 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
以交互方式将机器池添加到名为 mycluster
的集群。
$ rosa create machinepool --cluster=mycluster --interactive
添加一个名为 mp-1
的机器池,并启用自动缩放。
$ rosa create machinepool --cluster=mycluster --enable-autoscaling --min-replicas=2 --max-replicas=5 --name=mp-1
向集群添加一个名为 mp-1
的机器池,其中包含 3 个 m5.xlarge
副本。
$ rosa create machinepool --cluster=mycluster --replicas=3 --instance-type=m5.xlarge --name=mp-1
将机器池 (mp-1
) 添加到使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,配置 6 个副本和以下升级行为
允许在升级期间最多配置 2 个多余节点。
确保在升级期间最多只有 3 个节点不可用。
$ rosa create machinepool --cluster=mycluster --replicas=6 --name=mp-1 --max-surge=2 --max-unavailable=3
向集群添加带有标签的机器池。
$ rosa create machinepool --cluster=mycluster --replicas=2 --instance-type=r5.2xlarge --labels=foo=bar,bar=baz --name=mp-1
向集群添加带有标签的机器池。
$ rosa create machinepool --cluster=mycluster --replicas=2 --instance-type=r5.2xlarge --tags='foo bar,bar baz' --name=mp-1
创建网络,该网络通过 AWS CloudFormation 模板创建任何必要的 AWS 资源。此辅助命令旨在帮助创建和配置 VPC 以与使用 HCP 的 ROSA 一起使用。此命令还支持零出口集群。
运行此命令会在您的 AWS 帐户中创建资源。 |
对于自定义或高级配置,强烈建议直接使用 AWS CLI 的 |
$ rosa create network [flags]
选项 | 定义 |
---|---|
<模板名称> |
允许您使用自定义模板。模板必须位于模板文件夹中,结构为 |
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template to create a ROSA Quickstart default VPC.
This CloudFormation template may not work with rosa CLI versions later than 1.2.47.
Please ensure that you are using the compatible CLI version before deploying this template.
Parameters:
AvailabilityZoneCount:
Type: Number
Description: "Number of Availability Zones to use"
Default: 1
MinValue: 1
MaxValue: 3
Region:
Type: String
Description: "AWS Region"
Default: "us-west-2"
Name:
Type: String
Description: "Name prefix for resources"
VpcCidr:
Type: String
Description: CIDR block for the VPC
Default: '10.0.0.0/16'
Conditions:
HasAZ1: !Equals [!Ref AvailabilityZoneCount, 1]
HasAZ2: !Equals [!Ref AvailabilityZoneCount, 2]
HasAZ3: !Equals [!Ref AvailabilityZoneCount, 3]
One:
Fn::Or:
- Condition: HasAZ1
- Condition: HasAZ2
- Condition: HasAZ3
Two:
Fn::Or:
- Condition: HasAZ3
- Condition: HasAZ2
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidr
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: Name
Value: !Ref Name
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
S3VPCEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref VPC
ServiceName: !Sub "com.amazonaws.${Region}.s3"
VpcEndpointType: Gateway
RouteTableIds:
- !Ref PublicRouteTable
- !Ref PrivateRouteTable
SubnetPublic1:
Condition: One
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: !Select [0, !Cidr [!Ref VpcCidr, 6, 8]]
AvailabilityZone: !Select [0, !GetAZs '']
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub "${Name}-Public-Subnet-1"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
- Key: 'kubernetes.io/role/elb'
Value: '1'
SubnetPrivate1:
Condition: One
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: !Select [1, !Cidr [!Ref VpcCidr, 6, 8]]
AvailabilityZone: !Select [0, !GetAZs '']
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: !Sub "${Name}-Private-Subnet-1"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
- Key: 'kubernetes.io/role/internal-elb'
Value: '1'
SubnetPublic2:
Condition: Two
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: !Select [2, !Cidr [!Ref VpcCidr, 6, 8]]
AvailabilityZone: !Select [1, !GetAZs '']
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub "${Name}-Public-Subnet-2"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
- Key: 'kubernetes.io/role/elb'
Value: '1'
SubnetPrivate2:
Condition: Two
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: !Select [3, !Cidr [!Ref VpcCidr, 6, 8]]
AvailabilityZone: !Select [1, !GetAZs '']
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: !Sub "${Name}-Private-Subnet-2"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
- Key: 'kubernetes.io/role/internal-elb'
Value: '1'
SubnetPublic3:
Condition: HasAZ3
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: !Select [4, !Cidr [!Ref VpcCidr, 6, 8]]
AvailabilityZone: !Select [2, !GetAZs '']
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub "${Name}-Public-Subnet-3"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
- Key: 'kubernetes.io/role/elb'
Value: '1'
SubnetPrivate3:
Condition: HasAZ3
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: !Select [5, !Cidr [!Ref VpcCidr, 6, 8]]
AvailabilityZone: !Select [2, !GetAZs '']
MapPublicIpOnLaunch: false
Tags:
- Key: Name
Value: !Sub "${Name}-Private-Subnet-3"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
- Key: 'kubernetes.io/role/internal-elb'
Value: '1'
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: !Ref Name
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
AttachGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref VPC
InternetGatewayId: !Ref InternetGateway
ElasticIP1:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
Tags:
- Key: Name
Value: !Ref Name
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
ElasticIP2:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
Tags:
- Key: Name
Value: !Ref Name
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
ElasticIP3:
Condition: HasAZ3
Type: AWS::EC2::EIP
Properties:
Domain: vpc
Tags:
- Key: Name
Value: !Ref Name
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
NATGateway1:
Condition: One
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt ElasticIP1.AllocationId
SubnetId: !Ref SubnetPublic1
Tags:
- Key: Name
Value: !Sub "${Name}-NAT-1"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
NATGateway2:
Condition: Two
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt ElasticIP2.AllocationId
SubnetId: !Ref SubnetPublic2
Tags:
- Key: Name
Value: !Sub "${Name}-NAT-2"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
NATGateway3:
Condition: HasAZ3
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt ElasticIP3.AllocationId
SubnetId: !Ref SubnetPublic3
Tags:
- Key: Name
Value: !Sub "${Name}-NAT-3"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
PublicRouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: !Ref Name
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
PublicRoute:
Type: AWS::EC2::Route
DependsOn: AttachGateway
Properties:
RouteTableId: !Ref PublicRouteTable
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
PrivateRouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: !Sub "${Name}-Private-Route-Table"
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
- Key: 'service'
Value: 'ROSA'
PrivateRoute:
Type: AWS::EC2::Route
Properties:
RouteTableId: !Ref PrivateRouteTable
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !If
- One
- !Ref NATGateway1
- !If
- Two
- !Ref NATGateway2
- !If
- HasAZ3
- !Ref NATGateway3
- !Ref "AWS::NoValue"
PublicSubnetRouteTableAssociation1:
Condition: One
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref SubnetPublic1
RouteTableId: !Ref PublicRouteTable
PublicSubnetRouteTableAssociation2:
Condition: Two
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref SubnetPublic2
RouteTableId: !Ref PublicRouteTable
PublicSubnetRouteTableAssociation3:
Condition: HasAZ3
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref SubnetPublic3
RouteTableId: !Ref PublicRouteTable
PrivateSubnetRouteTableAssociation1:
Condition: One
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref SubnetPrivate1
RouteTableId: !Ref PrivateRouteTable
PrivateSubnetRouteTableAssociation2:
Condition: Two
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref SubnetPrivate2
RouteTableId: !Ref PrivateRouteTable
PrivateSubnetRouteTableAssociation3:
Condition: HasAZ3
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId: !Ref SubnetPrivate3
RouteTableId: !Ref PrivateRouteTable
SecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "Authorize inbound VPC traffic"
VpcId: !Ref VPC
SecurityGroupIngress:
- IpProtocol: -1
FromPort: 0
ToPort: 0
CidrIp: "10.0.0.0/16"
SecurityGroupEgress:
- IpProtocol: -1
FromPort: 0
ToPort: 0
CidrIp: 0.0.0.0/0
Tags:
- Key: Name
Value: !Ref Name
- Key: 'service'
Value: 'ROSA'
- Key: 'rosa_managed_policies'
Value: 'true'
- Key: 'rosa_hcp_policies'
Value: 'true'
EC2VPCEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref VPC
ServiceName: !Sub "com.amazonaws.${Region}.ec2"
PrivateDnsEnabled: true
VpcEndpointType: Interface
SubnetIds:
- !If [One, !Ref SubnetPrivate1, !Ref "AWS::NoValue"]
- !If [Two, !Ref SubnetPrivate2, !Ref "AWS::NoValue"]
- !If [HasAZ3, !Ref SubnetPrivate3, !Ref "AWS::NoValue"]
SecurityGroupIds:
- !Ref SecurityGroup
KMSVPCEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref VPC
ServiceName: !Sub "com.amazonaws.${Region}.kms"
PrivateDnsEnabled: true
VpcEndpointType: Interface
SubnetIds:
- !If [One, !Ref SubnetPrivate1, !Ref "AWS::NoValue"]
- !If [Two, !Ref SubnetPrivate2, !Ref "AWS::NoValue"]
- !If [HasAZ3, !Ref SubnetPrivate3, !Ref "AWS::NoValue"]
SecurityGroupIds:
- !Ref SecurityGroup
STSVPCEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref VPC
ServiceName: !Sub "com.amazonaws.${Region}.sts"
PrivateDnsEnabled: true
VpcEndpointType: Interface
SubnetIds:
- !If [One, !Ref SubnetPrivate1, !Ref "AWS::NoValue"]
- !If [Two, !Ref SubnetPrivate2, !Ref "AWS::NoValue"]
- !If [HasAZ3, !Ref SubnetPrivate3, !Ref "AWS::NoValue"]
SecurityGroupIds:
- !Ref SecurityGroup
EcrApiVPCEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref VPC
ServiceName: !Sub "com.amazonaws.${Region}.ecr.api"
PrivateDnsEnabled: true
VpcEndpointType: Interface
SubnetIds:
- !If [One, !Ref SubnetPrivate1, !Ref "AWS::NoValue"]
- !If [Two, !Ref SubnetPrivate2, !Ref "AWS::NoValue"]
- !If [HasAZ3, !Ref SubnetPrivate3, !Ref "AWS::NoValue"]
SecurityGroupIds:
- !Ref SecurityGroup
EcrDkrVPCEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
VpcId: !Ref VPC
ServiceName: !Sub "com.amazonaws.${Region}.ecr.dkr"
PrivateDnsEnabled: true
VpcEndpointType: Interface
SubnetIds:
- !If [One, !Ref SubnetPrivate1, !Ref "AWS::NoValue"]
- !If [Two, !Ref SubnetPrivate2, !Ref "AWS::NoValue"]
- !If [HasAZ3, !Ref SubnetPrivate3, !Ref "AWS::NoValue"]
SecurityGroupIds:
- !Ref SecurityGroup
Outputs:
VPCId:
Description: "VPC Id"
Value: !Ref VPC
Export:
Name: !Sub "${Name}-VPCId"
VPCEndpointId:
Description: The ID of the VPC Endpoint
Value: !Ref S3VPCEndpoint
Export:
Name: !Sub "${Name}-VPCEndpointId"
PublicSubnets:
Description: "Public Subnet Ids"
Value: !Join [",", [!If [One, !Ref SubnetPublic1, !Ref "AWS::NoValue"], !If [Two, !Ref SubnetPublic2, !Ref "AWS::NoValue"], !If [HasAZ3, !Ref SubnetPublic3, !Ref "AWS::NoValue"]]]
Export:
Name: !Sub "${Name}-PublicSubnets"
PrivateSubnets:
Description: "Private Subnet Ids"
Value: !Join [",", [!If [One, !Ref SubnetPrivate1, !Ref "AWS::NoValue"], !If [Two, !Ref SubnetPrivate2, !Ref "AWS::NoValue"], !If [HasAZ3, !Ref SubnetPrivate3, !Ref "AWS::NoValue"]]]
Export:
Name: !Sub "${Name}-PrivateSubnets"
EIP1AllocationId:
Description: Allocation ID for ElasticIP1
Value: !GetAtt ElasticIP1.AllocationId
Export:
Name: !Sub "${Name}-EIP1-AllocationId"
EIP2AllocationId:
Description: Allocation ID for ElasticIP2
Value: !GetAtt ElasticIP2.AllocationId
Export:
Name: !Sub "${Name}-EIP2-AllocationId"
EIP3AllocationId:
Condition: HasAZ3
Description: Allocation ID for ElasticIP3
Value: !GetAtt ElasticIP3.AllocationId
Export:
Name: !Sub "${Name}-EIP3-AllocationId"
NatGatewayId:
Description: The NAT Gateway IDs
Value: !Join [",", [!If [One, !Ref NATGateway1, !Ref "AWS::NoValue"], !If [Two, !Ref NATGateway2, !Ref "AWS::NoValue"], !If [HasAZ3, !Ref NATGateway3, !Ref "AWS::NoValue"]]]
Export:
Name: !Sub "${Name}-NatGatewayId"
InternetGatewayId:
Description: The ID of the Internet Gateway
Value: !Ref InternetGateway
Export:
Name: !Sub "${Name}-InternetGatewayId"
PublicRouteTableId:
Description: The ID of the public route table
Value: !Ref PublicRouteTable
Export:
Name: !Sub "${Name}-PublicRouteTableId"
PrivateRouteTableId:
Description: The ID of the private route table
Value: !Ref PrivateRouteTable
Export:
Name: !Sub "${Name}-PrivateRouteTableId"
EC2VPCEndpointId:
Description: The ID of the EC2 VPC Endpoint
Value: !Ref EC2VPCEndpoint
Export:
Name: !Sub "${Name}-EC2VPCEndpointId"
KMSVPCEndpointId:
Description: The ID of the KMS VPC Endpoint
Value: !Ref KMSVPCEndpoint
Export:
Name: !Sub "${Name}-KMSVPCEndpointId"
STSVPCEndpointId:
Description: The ID of the STS VPC Endpoint
Value: !Ref STSVPCEndpoint
Export:
Name: !Sub "${Name}-STSVPCEndpointId"
EcrApiVPCEndpointId:
Description: The ID of the ECR API VPC Endpoint
Value: !Ref EcrApiVPCEndpoint
Export:
Name: !Sub "${Name}-EcrApiVPCEndpointId"
EcrDkrVPCEndpointId:
Description: The ID of the ECR DKR VPC Endpoint
Value: !Ref EcrDkrVPCEndpoint
Export:
Name: !Sub "${Name}-EcrDkrVPCEndpointId"
选项 | 定义 |
---|---|
--template-dir |
允许您指定模板目录的路径。覆盖 |
--param 名称 |
定义您的网络名称。使用自定义模板文件时,此参数为必填参数。 |
--param 地区 |
定义您的网络地区。使用自定义模板文件时,此参数为必填参数。 |
--param <各种> |
可用的参数取决于模板。在模板目录中使用 |
--mode=manual |
提供用于创建网络堆栈的 AWS 命令。 |
使用常规参数和标志创建基本网络。
$ rosa create network rosa-quickstart-default-vpc --param Tags=key1=value1,key2=value2 --param Name=example-stack --param Region=us-west-2
为您的集群创建所需的 ocm-role 资源。
$ rosa create ocm-role [flags]
选项 | 定义 |
---|---|
--admin |
为角色启用管理员功能。 |
--debug |
启用调试模式。 |
-i, --interactive |
启用交互模式。 |
-m, --mode string |
如何执行操作。有效选项为
|
--path string |
OCM 角色和策略的 ARN 路径。 |
--permissions-boundary string |
用于设置 OCM 角色权限边界的策略的 ARN。 |
--prefix string |
所有生成的AWS资源的用户定义前缀。默认为 |
--profile string |
使用您凭据文件中的特定AWS配置文件。 |
-y, --yes |
自动回答“yes”以确认操作。 |
有关使用 rosa create ocm-role
命令创建的 OCM 角色的更多信息,请参阅 *账户级 IAM 角色和策略参考*。
为您的集群创建所需的 user-role 资源。
$ rosa create user-role [flags]
选项 | 定义 |
---|---|
--debug |
启用调试模式。 |
-i, --interactive |
启用交互模式。 |
-m, --mode string |
如何执行操作。有效选项为
|
--path string |
用户角色和策略的 ARN 路径。 |
--permissions-boundary string |
用于设置用户角色权限边界的策略的 ARN。 |
--prefix string |
所有生成的 AWS 资源的用户定义前缀,默认为 |
--profile string |
使用您凭据文件中的特定AWS配置文件。 |
-y, --yes |
自动回答“yes”以确认操作。 |
有关使用 rosa create user-role
命令创建的用户角色的更多信息,请参阅 *了解 AWS 账户关联*。
请参阅 AWS 实例类型,了解受支持的实例类型的列表。
请参阅 账户级 IAM 角色和策略参考,了解集群创建所需的 IAM 角色列表。
请参阅 了解 AWS 账户关联,了解有关 OCM 角色和用户角色的更多信息。
请参阅 附加自定义安全组,了解安全组要求的信息。
本节介绍集群和资源的 edit
命令。
允许编辑现有集群。
$ rosa edit cluster --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--additional-allowed-principals <arn> |
要添加到托管控制平面的 VPC 端点服务的其他允许的主体 ARN 的逗号分隔列表,以启用自动接受其他 VPC 端点连接请求。 |
--cluster |
必需:要编辑的集群的名称或 ID(字符串)。 |
--private |
将主 API 端点限制为直接的私有连接。 |
--enable-delete-protection=true |
启用删除保护功能。 |
--enable-delete-protection=false |
禁用删除保护功能。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
编辑名为 mycluster
的集群以使其成为私有集群。
$ rosa edit cluster --cluster=mycluster --private
在名为 mycluster
的集群上交互式地编辑所有集群选项。
$ rosa edit cluster --cluster=mycluster --interactive
编辑集群的默认应用程序路由器。
有关编辑非默认应用程序路由器的信息,请参阅 *附加资源*。 |
$ rosa edit ingress --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将添加 Ingress 的集群的名称或 ID(字符串)。 |
--cluster-routes-hostname |
用于 OAuth、控制台和下载的组件路由主机名。 |
--cluster-routes-tls-secret-ref |
用于 OAuth、控制台和下载的组件路由 TLS 密钥引用。 |
--excluded-namespaces |
Ingress 排除的命名空间。格式为逗号分隔列表 |
--label-match |
入口的标签匹配(字符串)。格式必须是键值对的逗号分隔列表。如果未指定标签,则所有路由都将公开在两个路由器上。 |
--lb-type |
负载均衡器的类型。选项包括 |
--namespace-ownership-policy |
Ingress 的命名空间所有权策略。选项包括 |
--private |
将应用程序路由限制为直接的私有连接。 |
--route-selector |
Ingress 的路由选择器。格式为键值对的逗号分隔列表。如果没有指定标签,则所有路由都将在两个路由器上公开。对于旧版 Ingress 支持,这些是包含标签,否则将被视为排除标签。 |
--wildcard-policy |
Ingress 的通配符策略。选项包括 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
在名为 mycluster
的集群上创建一个 ID 为 a1b2
的附加 Ingress 作为私有连接。
$ rosa edit ingress --private --cluster=mycluster a1b2
更新名为 mycluster
的集群上 ID 为 a1b2
的附加 Ingress 的路由选择器。
$ rosa edit ingress --label-match=foo=bar --cluster=mycluster a1b2
使用子域名标识符 apps
更新名为 mycluster
的集群的默认 Ingress。
$ rosa edit ingress --private=false --cluster=mycluster apps
更新 apps2
Ingress 的负载均衡器类型。
$ rosa edit ingress --lb-type=nlb --cluster=mycluster apps2
编辑机器池中的自定义 KubeletConfig
对象。
$ rosa edit kubeletconfig --cluster=<cluster_name|cluster_id> --name=<kubeletconfig_name> --pod-pids-limit=<number> [flags]
选项 | 定义 |
---|---|
-c, --cluster <cluster_name>|<cluster_id> |
必需。将编辑 |
-i, --interactive |
启用交互模式。 |
--pod-pids-limit <number> |
必需。与 |
--name |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,此参数为必需。对于 AWS 上的 Red Hat OpenShift Service,此参数为可选,因为集群只有一个 |
-h, --help |
显示此命令的帮助。 |
有关设置集群 PID 限制的更多信息,请参阅配置 PID 限制。
允许编辑集群中的机器池。
$ rosa edit machinepool --cluster=<cluster_name_or_id> <machinepool_name> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:要编辑的集群的名称或 ID(字符串),将在其上编辑附加机器池。 |
--enable-autoscaling |
启用或禁用计算节点的自动缩放。要启用自动缩放,请将此参数与 |
--labels |
机器池的标签(字符串)。格式必须是键值对的逗号分隔列表。编辑此值仅影响机器池新创建的节点(通过增加节点数量创建),不影响现有节点。此列表会持续覆盖对节点标签所做的任何修改。 |
--kubelet-configs <kubeletconfig_name> |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,任何要应用于机器池中节点的 |
--max-replicas |
启用自动缩放时指定计算节点的最大数量。 |
--min-replicas |
启用自动缩放时指定计算节点的最小数量。 |
--max-surge |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群, 默认值为 |
--max-unavailable |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群, 默认值为 |
--node-drain-grace-period |
指定升级或替换机器池时的节点 drain 缓冲时间。(仅适用于具有 HCP 集群的 ROSA)。 |
--replicas |
未配置自动缩放时必需。此机器池的机器数量(整数)。 |
--taints |
机器池的污点。此字符串值应格式化为以逗号分隔的 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
在名为 mycluster
的集群上,为名为 mp1
的机器池设置 4 个副本。
$ rosa edit machinepool --cluster=mycluster --replicas=4 mp1
在名为 mycluster
的集群上,启用名为 mp1
的机器池的自动缩放。
$ rosa edit machinepool --cluster=mycluster --enable-autoscaling --min-replicas=3 --max-replicas=5 mp1
在名为 mycluster
的集群上,禁用名为 mp1
的机器池的自动缩放。
$ rosa edit machinepool --cluster=mycluster --enable-autoscaling=false --replicas=3 mp1
修改名为 mycluster
的集群上名为 mp1
的机器池的自动缩放范围。
$ rosa edit machinepool --max-replicas=9 --cluster=mycluster mp1
在使用托管控制平面 (HCP) 集群的 AWS 上的 Red Hat OpenShift Service (ROSA) 中,编辑 mp1
机器池以在升级期间添加以下行为
允许在升级期间最多配置 2 个多余节点。
确保在升级期间最多只有 3 个节点不可用。
$ rosa edit machinepool --cluster=mycluster mp1 --max-surge=2 --max-unavailable=3
将 KubeletConfig
对象与 ROSA HCP 集群上现有的 high-pid-pool
机器池关联。
$ rosa edit machinepool -c mycluster --kubelet-configs=set-high-pids high-pid-pool
有关编辑非默认应用程序路由器的信息,请参阅 配置 Ingress 控制器。
本节介绍集群和资源的 delete
命令。
从指定的集群中删除集群管理员。
$ rosa delete admin --cluster=<cluster_name> | <cluster_id>
选项 | 定义 |
---|---|
--cluster |
必需:要添加到身份提供者 (IDP) 的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
从名为 mycluster
的集群中删除集群管理员。
$ rosa delete admin --cluster=mycluster
删除集群。
$ rosa delete cluster --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:要删除的集群的名称或 ID(字符串)。 |
--watch |
监视集群卸载日志。 |
--best-effort |
跳过已知会导致集群删除过程失败的集群销毁链中的步骤。您应该谨慎使用此选项,建议您在使用 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
删除名为 mycluster
的集群。
$ rosa delete cluster --cluster=mycluster
从集群中删除外部身份验证提供程序。
$ rosa delete external-auth-provider <name_of_external_auth_provider> --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需。将从中删除外部身份验证提供程序的集群的名称或 ID 字符串。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定来自您的凭据文件的AWS配置文件字符串。 |
--yes |
自动回答 |
从名为 mycluster
的集群中删除名为 exauth-1
的身份提供程序。
$ rosa delete external-auth-provider exauth-1 --cluster=mycluster
从集群中删除特定的身份提供者 (IDP)。
$ rosa delete idp --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将从中删除 IDP 的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
从名为 mycluster
的集群中删除名为 github
的身份提供者。
$ rosa delete idp github --cluster=mycluster
从集群中删除非默认应用程序路由器 (Ingress)。
$ rosa delete ingress --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将从中删除 Ingress 的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
从名为 mycluster
的集群中删除 ID 为 a1b2
的 Ingress。
$ rosa delete ingress --cluster=mycluster a1b2
从名为 mycluster
的集群中删除子域名名为 apps2
的辅助 Ingress。
$ rosa delete ingress --cluster=mycluster apps2
从集群中删除自定义 KubeletConfig
对象。
$ rosa delete kubeletconfig --cluster=<cluster_name|cluster_id> [flags]
选项 | 定义 |
---|---|
-c, --cluster <cluster_name>|<cluster_id> |
必需。要删除 |
-h, --help |
显示此命令的帮助。 |
--name |
对于使用托管控制平面 (HCP) 的 AWS 上的 Red Hat OpenShift Service (ROSA) 集群,此参数为必需。对于 AWS 上的 Red Hat OpenShift Service,此参数为可选,因为集群只有一个 |
-y, --yes |
自动回答 |
从集群中删除机器池。
$ rosa delete machinepool --cluster=<cluster_name> | <cluster_id> <machine_pool_id>
选项 | 定义 |
---|---|
--cluster |
必需:将从中删除机器池的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--interactive |
启用交互模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
从名为 mycluster
的集群中删除 ID 为 mp-1
的机器池。
$ rosa delete machinepool --cluster=mycluster mp-1
本节介绍如何将 Red Hat 托管服务附加组件安装和卸载到集群。
在集群上安装托管服务附加组件。
$ rosa install addon --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将安装附加组件的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
使用您的凭证文件中的特定 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
将 dbaas-operator
附加组件安装添加到名为 mycluster
的集群。
$ rosa install addon --cluster=mycluster dbaas-operator
从集群中卸载托管服务附加组件。
$ rosa uninstall addon --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将卸载附加组件的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
使用您的凭证文件中的特定 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
从名为 mycluster
的集群中删除 dbaas-operator
附加组件安装。
$ rosa uninstall addon --cluster=mycluster dbaas-operator
本节介绍集群和资源的 list
和 describe
命令。
列出托管服务附加组件安装。
$ rosa list addons --cluster=<cluster_name> | <cluster_id>
选项 | 定义 |
---|---|
--cluster |
必需:要列出其附加组件的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出集群的所有破坏性凭证。
$ rosa list break-glass-credential [arguments]
选项 | 定义 |
---|---|
--cluster <cluster_name>|<cluster_id> |
必需。已添加破坏性凭证的集群的名称或 ID。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出名为 mycluster
的集群的所有破坏性凭证。
$ rosa list break-glass-credential --cluster=mycluster
列出您所有的集群。
$ rosa list clusters [arguments]
选项 | 定义 |
---|---|
--count |
要显示的集群数量(整数)。默认值: |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出集群的任何外部身份验证提供程序。
$ rosa list external-auth-provider --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出其外部身份验证提供程序的集群的名称或 ID 字符串。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定来自您的凭据文件的AWS配置文件字符串。 |
列出名为 mycluster
的集群的任何外部身份验证提供程序。
$ rosa list external-auth-provider --cluster=mycluster
列出集群的所有身份提供者 (IDP)。
$ rosa list idps --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出其 IDP 的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出名为mycluster
的集群的所有身份提供商 (IDP)。
$ rosa list idps --cluster=mycluster
列出集群的所有 API 和入口端点。
$ rosa list ingresses --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出其 IDP 的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出名为mycluster
的集群的所有 API 和入口端点。
$ rosa list ingresses --cluster=mycluster
列出可用于 ROSA 的所有可用实例类型。可用性基于帐户的 AWS 配额。
$ rosa list instance-types [arguments]
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--output |
输出格式。允许的格式为 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出所有实例类型。
$ rosa list instance-types
列出在集群上配置的KubeletConfig
对象。
$ rosa list kubeletconfigs --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出机器池的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
列出名为mycluster
的集群上的所有KubeletConfig
对象。
$ rosa list kubeletconfigs --cluster=mycluster
列出在集群上配置的机器池。
$ rosa list machinepools --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出机器池的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出名为mycluster
的集群上的所有机器池。
$ rosa list machinepools --cluster=mycluster
列出当前 AWS 帐户的所有可用区域。
$ rosa list regions [arguments]
选项 | 定义 |
---|---|
--multi-az |
列出提供对多个可用区支持的区域。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出所有可用区域。
$ rosa list regions
列出所有可用的和已安排的集群版本升级。
$ rosa list upgrades --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出可用升级的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出名为mycluster
的集群的所有可用升级。
$ rosa list upgrades --cluster=mycluster
列出指定集群的集群管理员和专用管理员用户。
$ rosa list users --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将列出集群管理员的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出名为mycluster
的集群的所有集群管理员和专用管理员。
$ rosa list users --cluster=mycluster
列出可用于创建集群的所有 OpenShift 版本。
$ rosa list versions [arguments]
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
列出所有 OpenShift Container Platform 版本。
$ rosa list versions
显示指定cluster-admin
用户的详细信息以及登录集群的命令。
$ rosa describe admin --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需: |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
描述名为mycluster
的集群的cluster-admin
用户。
$ rosa describe admin --cluster=mycluster
显示托管服务附加组件的详细信息。
$ rosa describe addon <addon_id> | <addon_name> [arguments]
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
描述名为dbaas-operator
的附加组件。
$ rosa describe addon dbaas-operator
显示特定集群的紧急访问凭据的详细信息。
$ rosa describe break-glass-credential --id=<break_glass_credential_id> --cluster=<cluster_name>| <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:集群的名称或 ID(字符串)。 |
--id |
必需:紧急访问凭据的 ID(字符串)。 |
--kubeconfig |
可选:从紧急访问凭据中检索 kubeconfig。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
显示集群的详细信息。
$ rosa describe cluster --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--get-role-policy-bindings |
列出附加到分配给集群的 STS 角色的策略。 |
描述名为mycluster
的集群。
$ rosa describe cluster --cluster=mycluster
显示自定义KubeletConfig
对象的详细信息。
$ rosa describe kubeletconfig --cluster=<cluster_name|cluster_id> [flags]
选项 | 定义 |
---|---|
-c, --cluster <cluster_name>|<cluster_id> |
必需。要查看 |
-h, --help |
显示此命令的帮助。 |
--name |
可选。指定要描述的 |
-o, --output string |
-o, --output string |
描述在集群上配置的特定机器池。
$ rosa describe machinepool --cluster=[<cluster_name>|<cluster_id>] --machinepool=<machinepool_name> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:集群的名称或 ID(字符串)。 |
--machinepool |
必需:机器池的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
描述名为mycluster
的集群上名为mymachinepool
的机器池。
$ rosa describe machinepool --cluster=mycluster --machinepool=mymachinepool
本节描述集群和资源的revoke
命令。
撤销启用了外部身份验证的指定托管控制平面集群的所有紧急访问凭据。
$ rosa revoke break-glass-credential --cluster=<cluster_name> | <cluster_id>
选项 | 定义 |
---|---|
--cluster |
必需:将从中删除紧急访问凭据的集群的名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
--yes |
自动回答 |
撤销名为mycluster
的集群的紧急访问凭据。
$ rosa revoke break-glass-credential --cluster=mycluster
本节描述对象的upgrade
命令用法。
安排集群升级。
$ rosa upgrade cluster --cluster=<cluster_name> | <cluster_id> [arguments]
选项 | 定义 |
---|---|
--cluster |
必需:将安排升级的集群的名称或 ID(字符串)。 |
--interactive |
启用交互模式。 |
--version |
集群将升级到的 OpenShift Container Platform 版本(字符串)。 |
--schedule-date |
升级将在协调世界时 (UTC) 指定时间运行的下一个日期(字符串)。格式: |
--schedule-time |
升级将在协调世界时 (UTC) 指定日期运行的下一个时间。格式: |
--node-drain-grace-period [1] |
设置升级期间尊重 pod 中断预算保护的工作负载的宽限期(字符串)。此宽限期之后,任何受 pod 中断预算保护且尚未成功从节点中移除的工作负载都将被强制逐出。默认值: |
--control-plane [2] |
升级集群的托管控制平面。 |
仅限经典集群
仅限 ROSA with HCP 集群
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
交互式地安排名为mycluster
的集群的升级。
$ rosa upgrade cluster --cluster=mycluster --interactive
在名为mycluster
的集群上安排一小时内的集群升级。
$ rosa upgrade cluster --cluster=mycluster --version 4.5.20
取消已安排的集群升级。
$ rosa delete upgrade --cluster=<cluster_name> | <cluster_id>
选项 | 定义 |
---|---|
--cluster |
必填:将取消升级的集群名称或 ID(字符串)。 |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--yes |
自动回答 |
升级在具有 HCP 集群的 ROSA 上配置的特定机器池。
机器池的 |
$ rosa upgrade machinepool --cluster=<cluster_name> <machinepool_name>
选项 | 定义 |
---|---|
--cluster |
必需:集群的名称或 ID(字符串)。 |
--schedule-date |
升级将在协调世界时 (UTC) 指定时间运行的下一个日期(字符串)。格式: |
--schedule-time |
升级将在协调世界时 (UTC) 指定日期运行的下一个时间。格式: |
选项 | 定义 |
---|---|
--help |
显示此命令的帮助。 |
--debug |
启用调试模式。 |
--profile |
指定凭证文件中的 AWS 配置文件(字符串)。 |
升级名为mycluster
的集群上的机器池。
$ rosa upgrade machinepool --cluster=mycluster