# Installation of Kubectl

* **Kubernetes** also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.**kubectl**, allows you to run commands against Kubernetes clusters.
* If you want to study about kubernetes in detail, open [Kubernetes](https://kubernetes.io/docs/concepts/overview/)

### Why kubectl is using in DIGIT?

There are some other tools like kubelet along with kubectl. kubectl is the command-line interface (CLI) tool for working with a Kubernetes cluster. Kubelet is the technology that applies, creates, updates, and destroys containers on a Kubernetes node.But the only difference is, using kubectl the developer can interacts with kubernetes cluster. So we are using kubectl in DIGIT.

{% hint style="info" %}
Note: If you are using AWS as service to create cluster, You must use a `kubectl` version that is within one minor version difference of your Amazon EKS cluster control plane. For example, a `1.23` `kubectl` client works with Kubernetes `1.22`, `1.23`, and `1.24` clusters
{% endhint %}

### To know kubernetes is installed:

```
kubectl version
```

### To install or update kubectl:

#### In Windows:

* Download the kubectl [latest release v1.25.0](https://dl.k8s.io/release/v1.25.0/bin/windows/amd64/kubectl.exe).\
  or if you have **curl** installed use this command:

```
curl.exe -LO "https://dl.k8s.io/release/v1.25.0/bin/windows/amd64/kubectl.exe"
```

{% hint style="info" %}
If you want to download kubectl desired version just replace the version in above command with your version name
{% endhint %}

* To download **curl** follow the page and proceed the download with curl <https://www.wikihow.com/Install-Curl-on-Windows>
* Append or prepend the `kubectl` binary folder to your `PATH` environment variable. To perform this, complete the following steps:

- [ ] 1.Open the **kubectl.exe** folder in files and copy that folder.

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

* [ ] 2.Create a new folder in **Local Disk(C:)** with name **Kube.**

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

* [ ] 3\. Paste the **kubectl.exe** folder there.
* [ ] 4\. Open **windows** option Search for **Advanced system settings**

<figure><img src="/files/0V5pGoQ4wXvbhV19rX9E" alt=""><figcaption></figcaption></figure>

* [ ] 5\. Click on **Environmental variables** and then **System variables>Path>add** and add your path name i.e `c:\kube`
* [ ] 6\. Save it.

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

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

* Once you install `kubectl`, you can verify its version with the following command:

```
kubectl version --short --client
```

### To install kubectl in linux:

* Open the below link to install kubectl in linux:\
  <https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/>

### To install kubectl in MacOs:

* Open the below link to install kubectl in macos:\
  <https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/>


---

# Agent Instructions: 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:

```
GET https://docs.digit.org/platform/guides/operations-guide/working-with-kubernetes/installation-of-kubectl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
