# Install and Set Up kubectl on macOS

LLMS index: [llms.txt](/llms.txt)

---

## Before you begin

You must use a kubectl version that is within one minor version difference of
your cluster. For example, a v1.36 client can communicate
with v1.35, v1.36,
and v1.37 control planes.
Using the latest compatible version of kubectl helps avoid unforeseen issues.

## Install kubectl on macOS

The following methods exist for installing kubectl on macOS:

- [Install kubectl on macOS](#install-kubectl-on-macos)
  - [Install kubectl binary with curl on macOS](#install-kubectl-binary-with-curl-on-macos)
  - [Install with Homebrew on macOS](#install-with-homebrew-on-macos)
  - [Install with Macports on macOS](#install-with-macports-on-macos)
- [Verify kubectl configuration](#verify-kubectl-configuration)
- [Optional kubectl configurations and plugins](#optional-kubectl-configurations-and-plugins)
  - [Enable shell autocompletion](#enable-shell-autocompletion)
  - [Install `kubectl convert` plugin](#install-kubectl-convert-plugin)

### Install kubectl binary with curl on macOS

1. Download the latest release:

   <ul class="nav nav-tabs" id="tabs-download-binary-macos" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-download-binary-macos-0" role="tab" aria-controls="tabs-download-binary-macos-0" aria-selected="true">Intel</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-download-binary-macos-1" role="tab" aria-controls="tabs-download-binary-macos-1">Apple Silicon</a></li></ul>

<div class="tab-content" id="tabs-download-binary-macos-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-download-binary-macos-0" role="tabpanel" aria-labelledby="tabs-download-binary-macos-0-tab" tabindex="download-binary-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/amd64/kubectl&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div><div class="tab-body tab-pane fade"
        id="tabs-download-binary-macos-1" role="tabpanel" aria-labelledby="tabs-download-binary-macos-1-tab" tabindex="download-binary-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/arm64/kubectl&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div></div>


   
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4><p>To download a specific version, replace the <code>$(curl -L -s https://dl.k8s.io/release/stable.txt)</code>
portion of the command with the specific version.</p>
<p>For example, to download version 1.36.0 on Intel macOS, type:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -LO <span class="s2">&#34;https://dl.k8s.io/release/v1.36.0/bin/darwin/amd64/kubectl&#34;</span>
</span></span></code></pre></div><p>And for macOS on Apple Silicon, type:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -LO <span class="s2">&#34;https://dl.k8s.io/release/v1.36.0/bin/darwin/arm64/kubectl&#34;</span>
</span></span></code></pre></div></div>


1. Validate the binary (optional)

   Download the kubectl checksum file:

   <ul class="nav nav-tabs" id="tabs-download-checksum-macos" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-download-checksum-macos-0" role="tab" aria-controls="tabs-download-checksum-macos-0" aria-selected="true">Intel</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-download-checksum-macos-1" role="tab" aria-controls="tabs-download-checksum-macos-1">Apple Silicon</a></li></ul>

<div class="tab-content" id="tabs-download-checksum-macos-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-download-checksum-macos-0" role="tabpanel" aria-labelledby="tabs-download-checksum-macos-0-tab" tabindex="download-checksum-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/amd64/kubectl.sha256&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div><div class="tab-body tab-pane fade"
        id="tabs-download-checksum-macos-1" role="tabpanel" aria-labelledby="tabs-download-checksum-macos-1-tab" tabindex="download-checksum-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/arm64/kubectl.sha256&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div></div>

  
   Validate the kubectl binary against the checksum file:

   ```bash
   echo "$(cat kubectl.sha256)  kubectl" | shasum -a 256 --check
   ```

   If valid, the output is:

   ```console
   kubectl: OK
   ```

   If the check fails, `shasum` exits with nonzero status and prints output similar to:

   ```console
   kubectl: FAILED
   shasum: WARNING: 1 computed checksum did NOT match
   ```

   
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Download the same version of the binary and checksum.</div>


1. Make the kubectl binary executable.

   ```bash
   chmod +x ./kubectl
   ```

1. Move the kubectl binary to a file location on your system `PATH`.

   ```bash
   sudo mv ./kubectl /usr/local/bin/kubectl
   sudo chown root: /usr/local/bin/kubectl
   ```

   
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Make sure <code>/usr/local/bin</code> is in your PATH environment variable.</div>


1. Test to ensure the version you installed is up-to-date:

   ```bash
   kubectl version --client
   ```
   
   Or use this for detailed view of version:

   ```cmd
   kubectl version --client --output=yaml
   ```

1. After installing and validating kubectl, delete the checksum file:

   ```bash
   rm kubectl.sha256
   ```

### Install with Homebrew on macOS

If you are on macOS and using [Homebrew](https://brew.sh/) package manager,
you can install kubectl with Homebrew.

1. Run the installation command:

   ```bash
   brew install kubectl
   ```

   or

   ```bash
   brew install kubernetes-cli
   ```

1. Test to ensure the version you installed is up-to-date:

   ```bash
   kubectl version --client
   ```

### Install with Macports on macOS

If you are on macOS and using [Macports](https://macports.org/) package manager,
you can install kubectl with Macports.

1. Run the installation command:

   ```bash
   sudo port selfupdate
   sudo port install kubectl
   ```

1. Test to ensure the version you installed is up-to-date:

   ```bash
   kubectl version --client
   ```

## Verify kubectl configuration


	<p>In order for kubectl to find and access a Kubernetes cluster, it needs a
<a href="/docs/concepts/configuration/organize-cluster-access-kubeconfig/">kubeconfig file</a>,
which is created automatically when you create a cluster using
<a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/kube-up.sh">kube-up.sh</a>
or successfully deploy a Minikube cluster.
By default, kubectl configuration is located at <code>~/.kube/config</code>.</p>
<p>Check that kubectl is properly configured by getting the cluster state:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubectl cluster-info
</span></span></code></pre></div><p>If you see a URL response, kubectl is correctly configured to access your cluster.</p>
<p>If you see a message similar to the following, kubectl is not configured correctly
or is not able to connect to a Kubernetes cluster.</p>
<pre tabindex="0"><code>The connection to the server &lt;server-name:port&gt; was refused - did you specify the right host or port?
</code></pre><p>For example, if you are intending to run a Kubernetes cluster on your laptop (locally),
you will need a tool like <a href="https://minikube.sigs.k8s.io/docs/start/">Minikube</a> to be
installed first and then re-run the commands stated above.</p>
<p>If <code>kubectl cluster-info</code> returns the url response, but you can't access your cluster,
check whether it is configured properly using the following command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubectl cluster-info dump
</span></span></code></pre></div><h3 id="no-auth-provider-found">Troubleshooting the 'No Auth Provider Found' error message<a class="td-heading-self-link" href="#no-auth-provider-found" aria-label="Heading self-link"></a></h3>
<p>In Kubernetes 1.26, kubectl removed the built-in authentication for the following cloud
providers' managed Kubernetes offerings. These providers have released kubectl plugins
to provide the cloud-specific authentication. For instructions, refer to the following provider documentation:</p>
<ul>
<li>Azure AKS: <a href="https://azure.github.io/kubelogin/">kubelogin plugin</a></li>
<li>Google Kubernetes Engine: <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin">gke-gcloud-auth-plugin</a></li>
</ul>
<p>There could also be other causes for the same error message that are unrelated
to that change.</p>


## Optional kubectl configurations and plugins

### Enable shell autocompletion

kubectl provides autocompletion support for Bash, Zsh, Fish, and PowerShell
which can save you a lot of typing.

Below are the procedures to set up autocompletion for Bash, Fish, and Zsh.

<ul class="nav nav-tabs" id="tabs-kubectl-autocompletion" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-kubectl-autocompletion-0" role="tab" aria-controls="tabs-kubectl-autocompletion-0" aria-selected="true">Bash</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-kubectl-autocompletion-1" role="tab" aria-controls="tabs-kubectl-autocompletion-1">Fish</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-kubectl-autocompletion-2" role="tab" aria-controls="tabs-kubectl-autocompletion-2">Zsh</a></li></ul>

<div class="tab-content" id="tabs-kubectl-autocompletion-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-kubectl-autocompletion-0" role="tabpanel" aria-labelledby="tabs-kubectl-autocompletion-0-tab" tabindex="kubectl-autocompletion"><h3 id="introduction">Introduction<a class="td-heading-self-link" href="#introduction" aria-label="Heading self-link"></a></h3>
<p>The kubectl completion script for Bash can be generated with <code>kubectl completion bash</code>.
Sourcing this script in your shell enables kubectl completion.</p>
<p>However, the kubectl completion script depends on
<a href="https://github.com/scop/bash-completion"><strong>bash-completion</strong></a> which you thus have to previously install.</p>
<div class="alert alert-danger" role="note"><h4 class="alert-heading">Warning:</h4>There are two versions of bash-completion, v1 and v2. V1 is for Bash 3.2
(which is the default on macOS), and v2 is for Bash 4.1+. The kubectl completion
script <strong>doesn't work</strong> correctly with bash-completion v1 and Bash 3.2.
It requires <strong>bash-completion v2</strong> and <strong>Bash 4.1+</strong>. Thus, to be able to
correctly use kubectl completion on macOS, you have to install and use
Bash 4.1+ (<a href="https://apple.stackexchange.com/a/292760"><em>instructions</em></a>).
The following instructions assume that you use Bash 4.1+
(that is, any Bash version of 4.1 or newer).</div>

<h3 id="upgrade-bash">Upgrade Bash<a class="td-heading-self-link" href="#upgrade-bash" aria-label="Heading self-link"></a></h3>
<p>The instructions here assume you use Bash 4.1+. You can check your Bash's version by running:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="nv">$BASH_VERSION</span>
</span></span></code></pre></div><p>If it is too old, you can install/upgrade it using Homebrew:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">brew install bash
</span></span></code></pre></div><p>Reload your shell and verify that the desired version is being used:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="nv">$BASH_VERSION</span> <span class="nv">$SHELL</span>
</span></span></code></pre></div><p>Homebrew usually installs it at <code>/usr/local/bin/bash</code>.</p>
<h3 id="install-bash-completion">Install bash-completion<a class="td-heading-self-link" href="#install-bash-completion" aria-label="Heading self-link"></a></h3>

<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>As mentioned, these instructions assume you use Bash 4.1+, which means you will
install bash-completion v2 (in contrast to Bash 3.2 and bash-completion v1,
in which case kubectl completion won't work).</div>

<p>You can test if you have bash-completion v2 already installed with <code>type _init_completion</code>.
If not, you can install it with Homebrew:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">brew install bash-completion@2
</span></span></code></pre></div><p>As stated in the output of this command, add the following to your <code>~/.bash_profile</code> file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">brew_etc</span><span class="o">=</span><span class="s2">&#34;</span><span class="k">$(</span>brew --prefix<span class="k">)</span><span class="s2">/etc&#34;</span> <span class="o">&amp;&amp;</span> <span class="o">[[</span> -r <span class="s2">&#34;</span><span class="si">${</span><span class="nv">brew_etc</span><span class="si">}</span><span class="s2">/profile.d/bash_completion.sh&#34;</span> <span class="o">]]</span> <span class="o">&amp;&amp;</span> . <span class="s2">&#34;</span><span class="si">${</span><span class="nv">brew_etc</span><span class="si">}</span><span class="s2">/profile.d/bash_completion.sh&#34;</span>
</span></span></code></pre></div><p>Reload your shell and verify that bash-completion v2 is correctly installed with <code>type _init_completion</code>.</p>
<h3 id="enable-kubectl-autocompletion">Enable kubectl autocompletion<a class="td-heading-self-link" href="#enable-kubectl-autocompletion" aria-label="Heading self-link"></a></h3>
<p>You now have to ensure that the kubectl completion script gets sourced in all
your shell sessions. There are multiple ways to achieve this:</p>
<ul>
<li>
<p>Source the completion script in your <code>~/.bash_profile</code> file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s1">&#39;source &lt;(kubectl completion bash)&#39;</span> &gt;&gt;~/.bash_profile
</span></span></code></pre></div></li>
<li>
<p>Add the completion script to the <code>/usr/local/etc/bash_completion.d</code> directory:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">kubectl completion bash &gt;/usr/local/etc/bash_completion.d/kubectl
</span></span></code></pre></div></li>
<li>
<p>If you have an alias for kubectl, you can extend shell completion to work with that alias:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s1">&#39;alias k=kubectl&#39;</span> &gt;&gt;~/.bash_profile
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s1">&#39;complete -o default -F __start_kubectl k&#39;</span> &gt;&gt;~/.bash_profile
</span></span></code></pre></div></li>
<li>
<p>If you installed kubectl with Homebrew (as explained
<a href="/docs/tasks/tools/install-kubectl-macos/#install-with-homebrew-on-macos">here</a>),
then the kubectl completion script should already be in <code>/usr/local/etc/bash_completion.d/kubectl</code>.
In that case, you don't need to do anything.</p>

<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>The Homebrew installation of bash-completion v2 sources all the files in the
<code>BASH_COMPLETION_COMPAT_DIR</code> directory, that's why the latter two methods work.</div>

</li>
</ul>
<p>In any case, after reloading your shell, kubectl completion should be working.</p>
</div><div class="tab-body tab-pane fade"
        id="tabs-kubectl-autocompletion-1" role="tabpanel" aria-labelledby="tabs-kubectl-autocompletion-1-tab" tabindex="kubectl-autocompletion">
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Autocomplete for Fish requires kubectl 1.23 or later.</div>

<p>The kubectl completion script for Fish can be generated with the command <code>kubectl completion fish</code>. Sourcing the completion script in your shell enables kubectl autocompletion.</p>
<p>To do so in all your shell sessions, add the following line to your <code>~/.config/fish/config.fish</code> file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubectl completion fish <span class="p">|</span> <span class="nb">source</span>
</span></span></code></pre></div><p>After reloading your shell, kubectl autocompletion should be working.</p>
</div><div class="tab-body tab-pane fade"
        id="tabs-kubectl-autocompletion-2" role="tabpanel" aria-labelledby="tabs-kubectl-autocompletion-2-tab" tabindex="kubectl-autocompletion"><p>The kubectl completion script for Zsh can be generated with the command <code>kubectl completion zsh</code>. Sourcing the completion script in your shell enables kubectl autocompletion.</p>
<p>To do so in all your shell sessions, add the following to your <code>~/.zshrc</code> file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-zsh" data-lang="zsh"><span class="line"><span class="cl"><span class="nb">source</span> &lt;<span class="o">(</span>kubectl completion zsh<span class="o">)</span>
</span></span></code></pre></div><p>If you have an alias for kubectl, kubectl autocompletion will automatically work with it.</p>
<p>After reloading your shell, kubectl autocompletion should be working.</p>
<p>If you get an error like <code>2: command not found: compdef</code>, then add the following to the beginning of your <code>~/.zshrc</code> file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-zsh" data-lang="zsh"><span class="line"><span class="cl">autoload -Uz compinit
</span></span><span class="line"><span class="cl">compinit
</span></span></code></pre></div></div></div>


### Configure kuberc

See [kuberc](/docs/reference/kubectl/kuberc) for more information.

### Install `kubectl convert` plugin


	<p>A plugin for Kubernetes command-line tool <code>kubectl</code>, which allows you to convert manifests between different API
versions. This can be particularly helpful to migrate manifests to a non-deprecated api version with newer Kubernetes release.
For more info, visit <a href="/docs/reference/using-api/deprecation-guide/#migrate-to-non-deprecated-apis">migrate to non deprecated apis</a></p>


1. Download the latest release with the command:

   <ul class="nav nav-tabs" id="tabs-download-convert-binary-macos" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-download-convert-binary-macos-0" role="tab" aria-controls="tabs-download-convert-binary-macos-0" aria-selected="true">Intel</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-download-convert-binary-macos-1" role="tab" aria-controls="tabs-download-convert-binary-macos-1">Apple Silicon</a></li></ul>

<div class="tab-content" id="tabs-download-convert-binary-macos-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-download-convert-binary-macos-0" role="tabpanel" aria-labelledby="tabs-download-convert-binary-macos-0-tab" tabindex="download-convert-binary-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/amd64/kubectl-convert&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div><div class="tab-body tab-pane fade"
        id="tabs-download-convert-binary-macos-1" role="tabpanel" aria-labelledby="tabs-download-convert-binary-macos-1-tab" tabindex="download-convert-binary-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/arm64/kubectl-convert&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div></div>


1. Validate the binary (optional)

   Download the kubectl-convert checksum file:

   <ul class="nav nav-tabs" id="tabs-download-convert-checksum-macos" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-download-convert-checksum-macos-0" role="tab" aria-controls="tabs-download-convert-checksum-macos-0" aria-selected="true">Intel</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-download-convert-checksum-macos-1" role="tab" aria-controls="tabs-download-convert-checksum-macos-1">Apple Silicon</a></li></ul>

<div class="tab-content" id="tabs-download-convert-checksum-macos-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-download-convert-checksum-macos-0" role="tabpanel" aria-labelledby="tabs-download-convert-checksum-macos-0-tab" tabindex="download-convert-checksum-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/amd64/kubectl-convert.sha256&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div><div class="tab-body tab-pane fade"
        id="tabs-download-convert-checksum-macos-1" role="tabpanel" aria-labelledby="tabs-download-convert-checksum-macos-1-tab" tabindex="download-convert-checksum-macos"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">   curl -LO <span class="s2">&#34;https://dl.k8s.io/release/</span><span class="k">$(</span>curl -L -s https://dl.k8s.io/release/stable.txt<span class="k">)</span><span class="s2">/bin/darwin/arm64/kubectl-convert.sha256&#34;</span>
</span></span><span class="line"><span class="cl">   </span></span></code></pre></div></div></div>


   Validate the kubectl-convert binary against the checksum file:

   ```bash
   echo "$(cat kubectl-convert.sha256)  kubectl-convert" | shasum -a 256 --check
   ```

   If valid, the output is:

   ```console
   kubectl-convert: OK
   ```

   If the check fails, `shasum` exits with nonzero status and prints output similar to:

   ```console
   kubectl-convert: FAILED
   shasum: WARNING: 1 computed checksum did NOT match
   ```

   
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Download the same version of the binary and checksum.</div>


1. Make kubectl-convert binary executable

   ```bash
   chmod +x ./kubectl-convert
   ```

1. Move the kubectl-convert binary to a file location on your system `PATH`.

   ```bash
   sudo mv ./kubectl-convert /usr/local/bin/kubectl-convert
   sudo chown root: /usr/local/bin/kubectl-convert
   ```

   
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Make sure <code>/usr/local/bin</code> is in your PATH environment variable.</div>


1. Verify plugin is successfully installed

   ```shell
   kubectl convert --help
   ```

   If you do not see an error, it means the plugin is successfully installed.

1. After installing the plugin, clean up the installation files:

   ```bash
   rm kubectl-convert kubectl-convert.sha256
   ```

### Uninstall kubectl on macOS

Depending on how you installed `kubectl`, use one of the following methods.

### Uninstall kubectl using the command-line

1.  Locate the `kubectl` binary on your system:

    ```bash
    which kubectl
    ```

1.  Remove the `kubectl` binary:

    ```bash
    sudo rm <path>
    ```
    Replace `<path>` with the path to the `kubectl` binary from the previous step. For example, `sudo rm /usr/local/bin/kubectl`.

### Uninstall kubectl using homebrew

If you installed `kubectl` using Homebrew, run the following command:

```bash
brew remove kubectl
```
  
## What's next


	<ul>
<li>Learn about <a href="/docs/concepts/overview/kubectl/">kubectl</a> and its role in the Kubernetes ecosystem.</li>
<li><a href="https://minikube.sigs.k8s.io/docs/start/">Install Minikube</a></li>
<li>See the <a href="/docs/setup/">getting started guides</a> for more about creating clusters.</li>
<li><a href="/docs/tasks/access-application-cluster/service-access-application-cluster/">Learn how to launch and expose your application.</a></li>
<li>If you need access to a cluster you didn't create, see the
<a href="/docs/tasks/access-application-cluster/configure-access-multiple-clusters/">Sharing Cluster Access document</a>.</li>
<li>Read the <a href="/docs/reference/kubectl/kubectl/">kubectl reference docs</a></li>
</ul>
