<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.16 </button>

- [Latest](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/latest/troubleshooting/get-cluster-info)
- [Version 1.16](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/troubleshooting/get-cluster-info.md.txt)
- [Earlier versions (unsupported)](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/getting-support.md.txt#version-support)

<br />

This document describes how to use the `bmctl get` command to retrieve important
configuration and credential information for your existing clusters. This
information can be helpful in troubleshooting cluster problems.

## Getting cluster configuration details

After you create
[admin](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/admin-cluster-creation.md.txt),
[hybrid](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/hybrid-cluster-creation.md.txt),
[standalone](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/standalone-cluster-creation.md.txt),
or [user](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/user-cluster-creation.md.txt)
clusters with the `bmctl get config` command.

Use the following command to retrieve all custom resources for a self-managing
cluster, such as an admin cluster:

```bash
bmctl get config --cluster CLUSTER_NAME  --kubeconfig ADMIN_KUBECONFIG_PATH
```

Replace the following:

- <var translate="no">CLUSTER_NAME</var>: the name of the target cluster.

- <var translate="no">ADMIN_KUBECONFIG_PATH</var>: the path to the admin cluster `kubeconfig`
  file.

Use the following command to retrieve all custom resources for a user cluster:

Note that `bmctl` supports the use of `--kubeconfig` as an alias for the
`--admin-kubeconfig` flag.

```bash
bmctl get config --cluster CLUSTER_NAME --admin-kubeconfig ADMIN_KUBECONFIG_PATH
```

Replace the following:

- <var translate="no">CLUSTER_NAME</var>: the name of the target user cluster.

- <var translate="no">ADMIN_KUBECONFIG_PATH</var>: the path to the admin cluster `kubeconfig`
  file.

In either case, the custom resources are written to a YAML file,
`bmctl-workspace/CLUSTER_NAME/CLUSTER_NAME-TIMESTAMP.yaml`.
The <var translate="no">TIMESTAMP</var> in the file name indicates the date and time the file
was created.

The YAML file produced by the `bmctl get config` command will look something
like this:

```yaml
---
apiVersion: v1
kind: Namespace
metadata:
 name: cluster-admin1
---
apiVersion: baremetal.cluster.gke.io/v1
kind: Cluster
metadata:
 name: admin1
 namespace: cluster-admin1
spec:
 clusterNetwork:
   services:
     cidrBlocks:
     - 10.96.0.0/20
   pods:
     cidrBlocks:
     - 192.168.0.0/16
 controlPlane:
   nodePoolSpec:
     nodes:
     - address: 172.18.0.13
 loadBalancer:
   mode: bundled
   ports:
     controlPlaneLBPort: 6443
   vips:
     controlPlaneVIP: 172.18.0.254
 storage:
   lvpShare:
     path: /mnt/localpv-share/
     storageclassname: standard
     numpvundersharedpath: 5
   lvpNodeMounts:
     path: /mnt/localpv-disk
     storageclassname: node-disk
 authentication:
   oidc:
     issuerURL: https://accounts.google.com
     kubectlRedirectURL: http://localhost:9879/callback
     clientID: 611080206796-9qq355g2q1coed5t78ckfmm1c6ini3et.apps.googleusercontent.com
     clientSecret: FTPbx3INYJcxBSQhMRlbk3tX
     username: email
     scopes: email
     extraParams: prompt=consent,access_type=offline
 clusterOperations:
   projectID: baremetal-test
   location: us-central1
 type: admin
 anthosBareMetalVersion: 0.0.0
 bypassPreflightCheck: false
---
apiVersion: baremetal.cluster.gke.io/v1
kind: NodePool
metadata:
 name: nodepool1
 namespace: cluster-admin1
spec:
 clusterName: admin1
 nodes:
 - address: 172.18.0.9
```

## Getting cluster credentials

Use the `bmctl get credentials` command to retrieve credentials for a given
user cluster.

Use the following command to retrieve all custom resources for a user cluster:

Note that `bmctl` supports the use of `--kubeconfig` as an alias for the
`--admin-kubeconfig` flag.

```bash
bmctl get credentials --cluster CLUSTER_NAME --admin-kubeconfig ADMIN_KUBECONFIG_PATH
```

Replace the following:

- <var translate="no">CLUSTER_NAME</var>: the name of the target user cluster.

- <var translate="no">ADMIN_KUBECONFIG_PATH</var>: the path to the admin cluster `kubeconfig`
  file.

In either case, the cluster's credentials are written to a file,
`bmctl-workspace/CLUSTER_NAME/CLUSTER_NAME-TIMESTAMP-kubeconfig`.
The <var translate="no">TIMESTAMP</var> in the file name indicates the date and time the file
was created.

Because this file contains authentication credentials for your
cluster, you should store it in a secure location with restricted access.