2.2. Creating a Workload Identity Federation cluster using the OCM CLI


You can create an OpenShift Dedicated on Google Cloud cluster with Workload Identity Federation (WIF) using the OpenShift Cluster Manager CLI (ocm) in interactive or non-interactive mode.

Prerequisites

  • You have created a WIF configuration. For more information, see "Creating a Workload Identity Federation configuration".
  • You have downloaded the latest version of the OpenShift Cluster Manager CLI (ocm) for your operating system from the Downloads page on OpenShift Cluster Manager.

Procedure

You can create a WIF cluster using the interactive or the non-interactive mode.

In interactive mode, cluster attributes are displayed automatically as prompts during the creation of the cluster. You enter the values for those prompts based on specified requirements in the fields provided.

In non-interactive mode, you specify the values for specific parameters within the command.

  • Based on your mode preference, run one of the following commands to create an OpenShift Dedicated cluster on Google Cloud with WIF configuration:

    • Create a cluster in interactive mode by running the following command:

      $ ocm create cluster --interactive

      where:

      --interactive
      Specifies that the cluster is created in interactive mode. This mode prompts you to enter the required configuration options during cluster creation. If you do not include this parameter, the cluster is created in non-interactive mode by default.
    • Create a cluster in non-interactive mode by running the following command. The following example is made up of optional and required parameters and might differ from your non-interactive mode command. Parameters not identified as optional are required. For additional details about these and other parameters, run the ocm create cluster --help flag command in you terminal window.

      $ ocm create cluster <cluster_name> \
      --provider=gcp \
      --ccs=true \
      --wif-config <wif_name> \
      --dns-zone-id <dns_zone_id> \
      --region <gcp_region> \
      --subscription-type=marketplace-gcp \
      --marketplace-gcp-terms=true \
      --version <version> \
      --multi-az=true  \
      --enable-autoscaling=true \
      --min-replicas=3 \
      --max-replicas=6 \
      --secure-boot-for-shielded-vms=true
      --channel-group <channel_group_name>

      where:

      <cluster_name>
      Specifies the name of the cluster. Replace <cluster_name> with a name for your cluster.
      --provider=gcp
      Specifies the cloud provider for the cluster.
      --ccs=true
      Specifies that the cluster is a Customer Cloud Subscription (CCS) cluster.
      --wif-config <wif_name>
      Specifies the name of the WIF configuration to assign to the cluster. Replace <wif_name> with the name of your WIF configuration.
      --dns-zone-id <dns_zone_id>
      Optional. Specifies the DNS zone ID to use for the cluster. Replace <dns_zone_id> with the ID of your DNS zone. For more information about this parameter, see Creating a managed DNS zone in the Additional resources section.
      --region <gcp_region>
      Specifies the Google Cloud region where the new cluster will be deployed. Replace <gcp_region> with the desired Google Cloud region.
      --subscription-type=marketplace-gcp
      Optional. Specifies the subscription billing model for the cluster.
      --marketplace-gcp-terms=true
      Confirms that you have accepted the Google Cloud Marketplace terms and agreements for the OpenShift Dedicated product listing. This parameter is required if you provided a value of marketplace-gcp for the subscription-type parameter.
      --version <version>

      Specifies the desired OpenShift Dedicated version. This parameter is optional. However, if an OpenShift Dedicated version is specified, the version must also be supported by the assigned WIF configuration. If a version is specified that is not supported by the assigned WIF configuration, cluster creation will fail. If this occurs, update the assigned WIF configuration to the desired version or create a new WIF configuration with the desired version. If you do not specify a version, the cluster is created with the default version for the assigned WIF configuration.

      For more information about supported versions for WIF configurations, see "Creating a Workload Identity Federation configuration".

      --multi-az=true
      Specifies that the cluster is deployed to multiple data centers. This parameter is optional.
      --enable-autoscaling=true
      Enables autoscaling of compute nodes. This parameter is optional.
      --min-replicas=3
      Specifies the minimum number of compute nodes. This parameter is optional.
      --max-replicas=6
      Specifies the maximum number of compute nodes. This parameter is optional.
      --secure-boot-for-shielded-vms=true
      Enables Secure Boot, which allows the use of Shielded VMs in the Google Cloud. This parameter is optional.
      --channel-group <channel_group_name>
      Specifies the name of the channel group you want to assign the cluster to. Channel group options include stable and eus. Replace <channel_group_name> with the desired channel group. This parameter is optional.
重要

If your cluster deployment fails during installation, certain resources created during the installation process are not automatically removed from your Google Cloud account. To remove these resources from your Google Cloud account, you must delete the failed cluster. For more information, see "Deleting an OpenShift Dedicated cluster on Google Cloud".

Verification

  • To verify that the cluster was created successfully, run the following command:

    $ ocm get cluster <cluster_name>

    If the cluster was created successfully, the output displays the cluster state as ready.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部