// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-manage/hcp-manage-openstack.adoc

:_mod-docs-content-type: PROCEDURE
[id="hcp-openstack-accessing_{context}"]
= Accessing the hosted cluster

[role="_abstract"]
You can access hosted clusters on {rh-openstack-first} by extracting the kubeconfig secret directly from resources by using the `oc` CLI.

The _hosted cluster (hosting)_ namespace has hosted cluster resources and the access secrets. The _hosted control plane_ namespace is where the hosted control plane runs.

The secret name formats are as follows:

** `kubeconfig` secret: `<hosted_cluster_namespace>-<name>-admin-kubeconfig`. For example, `clusters-hypershift-demo-admin-kubeconfig`.
** `kubeadmin` password secret: `<hosted_cluster_namespace>-<name>-kubeadmin-password`. For example, `clusters-hypershift-demo-kubeadmin-password`.

The `kubeconfig` secret has a Base64-encoded `kubeconfig` field. The `kubeadmin` password secret is also Base64-encoded; you can extract it and then use the password to log in to the API server or console of the hosted cluster.

.Prerequisites

* The `oc` CLI is installed.

.Procedure

. Extract the `admin-kubeconfig` secret by entering the following command:
+
[source,terminal]
----
$ oc extract -n <hosted_cluster_namespace> \
  secret/<hosted_cluster_name>-admin-kubeconfig \
  --to=./hostedcluster-secrets --confirm
----
+
.Example output
----
hostedcluster-secrets/kubeconfig
----

. View a list of nodes of the hosted cluster to verify your access by entering the following command:
+
[source,terminal]
----
$ oc --kubeconfig ./hostedcluster-secrets/kubeconfig get nodes
----
