1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/hcp-virt-create-hc-cli.adoc
2025-09-09 17:56:24 +00:00

80 lines
3.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-disconnected/hcp-deploy-dc-virt.adoc
// * hosted_control_planes/hcp-deploy/hcp-deploy-virt.adoc
:_mod-docs-content-type: PROCEDURE
[id="hcp-virt-create-hc-cli_{context}"]
= Creating a hosted cluster with the KubeVirt platform by using the CLI
To create a hosted cluster, you can use the hosted control plane command-line interface (CLI), `hcp`.
.Procedure
. Create a hosted cluster with the KubeVirt platform by entering the following command:
+
[source,terminal]
----
$ hcp create cluster kubevirt \
--name <hosted_cluster_name> \// <1>
--node-pool-replicas <node_pool_replica_count> \// <2>
--pull-secret <path_to_pull_secret> \// <3>
--memory <value_for_memory> \// <4>
--cores <value_for_cpu> \// <5>
--etcd-storage-class=<etcd_storage_class> <6>
----
<1> Specify the name of your hosted cluster, for example, `my-hosted-cluster`.
<2> Specify the node pool replica count, for example, `3`. You must specify the replica count as `0` or greater to create the same number of replicas. Otherwise, no node pools are created.
<3> Specify the path to your pull secret, for example, `/user/name/pullsecret`.
<4> Specify a value for memory, for example, `6Gi`.
<5> Specify a value for CPU, for example, `2`.
<6> Specify the etcd storage class name, for example, `lvm-storageclass`.
+
[NOTE]
====
You can use the `--release-image` flag to set up the hosted cluster with a specific {product-title} release.
====
+
A default node pool is created for the cluster with two virtual machine worker replicas according to the `--node-pool-replicas` flag.
. After a few moments, verify that the hosted control plane pods are running by entering the following command:
+
[source,terminal]
----
$ oc -n clusters-<hosted-cluster-name> get pods
----
+
.Example output
[source,terminal]
----
NAME READY STATUS RESTARTS AGE
capi-provider-5cc7b74f47-n5gkr 1/1 Running 0 3m
catalog-operator-5f799567b7-fd6jw 2/2 Running 0 69s
certified-operators-catalog-784b9899f9-mrp6p 1/1 Running 0 66s
cluster-api-6bbc867966-l4dwl 1/1 Running 0 66s
.
.
.
redhat-operators-catalog-9d5fd4d44-z8qqk 1/1 Running 0 66s
----
+
A hosted cluster that has worker nodes that are backed by KubeVirt virtual machines typically takes 10-15 minutes to be fully provisioned.
.Verification
* To check the status of the hosted cluster, see the corresponding `HostedCluster` resource by entering the following command:
+
[source,terminal]
----
$ oc get --namespace clusters hostedclusters
----
+
See the following example output, which illustrates a fully provisioned `HostedCluster` object:
+
----
NAMESPACE NAME VERSION KUBECONFIG PROGRESS AVAILABLE PROGRESSING MESSAGE
clusters my-hosted-cluster <4.x.0> example-admin-kubeconfig Completed True False The hosted control plane is available
----
+
Replace `<4.x.0>` with the supported {product-title} version that you want to use.