[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Step-by-step guides](../index.md) > Managing a Kubernetes cluster > Getting information about a Kubernetes cluster

# Information about existing Managed Service for Kubernetes clusters

To find out the [Kubernetes cluster](../../concepts/index.md#kubernetes-cluster) `ID` or `NAME`, get a list of Kubernetes clusters in the folder or detailed information about the Kubernetes cluster.

## Getting a list of Kubernetes clusters in a folder {#list}

Get a list of Kubernetes clusters in the default folder.

{% list tabs group=instructions %}

- Management console {#console}

  To get a list of Kubernetes clusters, select a folder in the [management console](https://console.yandex.cloud) and navigate to **Managed Service for&nbsp;Kubernetes**.

- CLI {#cli}

  Run this command:

  ```bash
  yc managed-kubernetes cluster list
  ```

  Result:

  ```text
  +----------------------+------------------+---------------------+---------+---------+-------------------------+-------------------+
  |          ID          |       NAME       |     CREATED AT      | HEALTH  | STATUS  |    EXTERNAL ENDPOINT    | INTERNAL ENDPOINT |
  +----------------------+------------------+---------------------+---------+---------+-------------------------+-------------------+
  | cata9ertn6tc******** | test-k8s-cluster | 2019-04-12 10:00:27 | HEALTHY | RUNNING | https://84.201.150.176/ | https://10.0.0.3/ |
  +----------------------+------------------+---------------------+---------+---------+-------------------------+-------------------+
    ```

- API {#api}

  Use either the [list](../../managed-kubernetes/api-ref/Cluster/list.md) REST API method for the [Cluster](../../managed-kubernetes/api-ref/Cluster/index.md) resource or the [ClusterService/List](../../managed-kubernetes/api-ref/grpc/Cluster/list.md) gRPC API call.

{% endlist %}

## Getting detailed information about a Kubernetes cluster {#get}

To access a Kubernetes cluster, use the `ID` or `NAME` parameters from the [previous](kubernetes-cluster-list.md#list) section.

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select a folder.
  1. Navigate to **Managed Service for&nbsp;Kubernetes**.
  1. Click the name of the Kubernetes cluster.

- CLI {#cli}

  Get detailed information about a Kubernetes cluster:

  ```bash
  yc managed-kubernetes cluster get test-k8s-cluster
  ```

  Result:

  ```text
  id: cata9ertn6tc********
  folder_id: b1g88tflru0e********
  created_at: "2019-04-12T10:00:27Z"
  ...
  ip_allocation_policy:
    cluster_ipv4_cidr_block: 10.13.0.0/16
    service_ipv4_cidr_block: 10.14.0.0/16
  ```

- Terraform {#tf}

  With [Terraform](https://www.terraform.io/), you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.
  
  Terraform is distributed under the [Business Source License](https://github.com/hashicorp/terraform/blob/main/LICENSE). The [Yandex Cloud provider for Terraform](https://github.com/yandex-cloud/terraform-provider-yandex) is distributed under the [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/) license.
  
  For more information about the provider resources, see the relevant documentation on the [Terraform](https://www.terraform.io/docs/providers/yandex/index.html) website or [its mirror](../../../terraform/index.md).

  To get information about a Managed Service for Kubernetes cluster:

  1. If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
     
     
     To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../../terraform/authentication.md) using the appropriate method.

  1. Create a Terraform configuration file with a description of the `yandex_kubernetes_cluster` data source in the `data` section and the requested parameters in the `output` sections (one per section). For example:

      ```hcl
      data "yandex_kubernetes_cluster" "my_cluster" {
        cluster_id = "<cluster_ID>"
      }

      output "external_v4_endpoint" {
        value = data.yandex_kubernetes_cluster.my_cluster.master.0.external_v4_endpoint
      }
      ```

      Where:

      * `external_v4_endpoint`: Name of the variable whose value will appear in the result.
      * `data.yandex_kubernetes_cluster.my_cluster.master.0.external_v4_endpoint`: Requested parameter. In our case, it is the cluster’s public IP address.

      For the list of cluster parameters you can request this way, see [this Terraform provider guide](../../../terraform/data-sources/kubernetes_cluster.md).

      {% note tip %}

      To request all available information about a cluster, add the following `output` section to the file:

      ```hcl
      output "kubernetes_cluster" {
        value = data.yandex_kubernetes_cluster.my_cluster
      }
      ```

      {% endnote %}

  1. Make sure the configuration files are correct:

      1. In the command line, navigate to the folder containing the current Terraform configuration files.

      1. Run this command:

          ```bash
          terraform validate
          ```

          Terraform will display any configuration errors detected in your files.

  1. Run this command:

      ```bash
      terraform apply
      ```

      Terraform will display output variables in the terminal.

  1. To check the result, run the following command by specifying the required variable, e.g.:

      ```bash
      terraform output external_v4_endpoint
      ```

      Result:

      ```text
      "https://158.1**.***.***"
      ```

- API {#api}

  To get detailed information about a Kubernetes cluster, use the [get](../../managed-kubernetes/api-ref/Cluster/get.md) REST API method for the [Cluster](../../managed-kubernetes/api-ref/Cluster/index.md) resource or the [ClusterService/Get](../../managed-kubernetes/api-ref/grpc/Cluster/get.md) gRPC API call.

{% endlist %}