azure/setup-kubectl@v5

Install a specific version of kubectl binary. Acceptable values are latest or any semantic version string like "v1.15.0"

At a glance

Latest major
v5
Repository
azure/setup-kubectl
Inputs
4 (1 required)
Outputs
1
Runs using
node24
License
MIT
Last checked

Inputs and outputs come straight from the action's official action.yml. See our editorial standards.

Usage

- uses: azure/setup-kubectl@v5

Inputs

NameRequiredDefaultDescription
versionYeslatestVersion of kubectl
downloadBaseURLNohttps://dl.k8s.ioBase URL to download kubectl from (https only). Use for private mirrors.
checksumNononeExpected SHA256 of the kubectl binary (lowercase 64-char hex). Required when overriding downloadBaseURL; the action fails closed without it to prevent unverified binaries from poisoning the tool cache.
downloadAuthTokenNononeOptional bearer token sent as the Authorization header when fetching from downloadBaseURL. Stripped on cross-origin redirects.

Outputs

NameDescription
kubectl-pathPath to the cached kubectl binary

Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.

Examples

Install a pinned kubectl

Pin the client version to match your cluster instead of whatever the runner ships.

name: Example
on:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - name: Kubectl tool installer
        uses: azure/setup-kubectl@v5
        with:
          version: v1.31.0
      - run: kubectl version --client

Each example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.

Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.