> For the complete documentation index, see [llms.txt](https://docs.cloudassert.com/hybr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudassert.com/hybr/features/cloud-cost-management/getting-started/kubernetes.md).

# Kubernetes

[Kubernetes](https://kubernetes.io/docs/concepts/overview/), also known as K8s, is an open-source system for automating the deployment, scaling, and management of containerized applications.

1. **Planet Scale:** Designed on the same principles that allow Google to run billions of containers a week, Kubernetes can scale without increasing your operations team.
2. **Never Outgrow:** Whether testing locally or running a global enterprise, Kubernetes flexibility grows with you to deliver your applications consistently and easily no matter how complex your need is.
3. **Run K8s Anywhere:** Kubernetes is open source giving you the freedom to take advantage of on-premises, hybrid, or public cloud infrastructure, letting you effortlessly move workloads to where it matters to you.

### Pre-requisite for Kubernetes Resource collection

&#x20;1\. To Collect the Kubernetes environment resource, we need to have the Kubernetes environment setup in the public cloud or private cloud, or any other environment.

2. If Hybr collects the Kubernetes Resource, we have to provide the kubeconfig file to connect to the cluster

To connect to a remote Kubernetes cluster using a Kube config file, you first need to obtain the configuration file from the cluster administrator or from the cloud provider where the cluster is hosted. Here's how you can obtain the Kube config file:

1. If the cluster is hosted on a cloud provider, check their documentation for instructions on how to obtain the Kube config file. For example,&#x20;

* if the cluster is on Google Cloud Platform (GCP), you can use the `gcloud` command-line tool to retrieve the Kube config file:

{% code title="GCP Kubenetes Cluster" %}

```bash
gcloud container clusters get-credentials <CLUSTER_NAME> --zone <ZONE> --project <PROJECT_ID>
```

{% endcode %}

* &#x20;if the cluster is on Azure, you can use the `azure cli` tool to retrieve the Kube config file:

{% code title="AKS Cluster" %}

```bash
az aks get-credentials --resource-group <RESOURCE_GROUP> --name <CLUSTER_NAME>
```

{% endcode %}

* if the cluster is on AWS, you can use the `aws cli` tool to retrieve the Kube config file:

{% code title="EKS Cluster" %}

```bash
aws eks update-kubeconfig --name <CLUSTER_NAME> --region <REGION>
```

{% endcode %}

2. If the cluster is self-hosted, ask the cluster administrator to provide you with the Kube config file. They can generate the file using the `kubectl config` command and send it to you:

```
kubectl config view --flatten > <OUTPUT_FILE>
```

Replace \<PATH\_TO\_CONFIG\_FILE> with the path to the configuration file on the remote cluster, and \<OUTPUT\_FILE> with the path where you want to save the configuration file on your local machine.

3. If you already have access to the cluster via SSH, you can copy the Kube config file from the remote cluster to your local machine using the scp command:

```
scp <REMOTE_USER>@<REMOTE_HOST>:<PATH_TO_CONFIG_FILE> <LOCAL_PATH>
```

Replace `<REMOTE_USER>`, `<REMOTE_HOST>`, `<PATH_TO_CONFIG_FILE>`, and `<LOCAL_PATH>` with the appropriate values for your cluster.

### Onboarding Kubernetes resource in HYBR:

1. Log into the Hybr Admin portal and navigate to Reporting → Data Sources -> Connections page.

<figure><img src="/files/l4jhzdbSLxci4YHy9Z0W" alt=""><figcaption></figcaption></figure>

2. Click on the Create Connection button and Choose Kubernetes in the 'Category' Select box and provide the connection name and choose 'Kubernetes API Endpoint' as Endpoint

<figure><img src="/files/Bwa1tv5IlsDOlmJ0QSYA" alt=""><figcaption></figcaption></figure>

3. &#x20;Choose the Kube.config file which you have fetched from the server and provide the cluster name

<figure><img src="/files/KzX37vWtYhoX6oNVT9JN" alt=""><figcaption></figcaption></figure>

It will start collecting the Kubernetes Resources data in the background. You can see the resources in the Reporting → Resources -> Kubernetes Resources

<figure><img src="/files/mwp9qsfH6DSUrPcSG0gs" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloudassert.com/hybr/features/cloud-cost-management/getting-started/kubernetes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
