I’ve published a new GitHub Action called action-setup-kube-tools (View on Marketplace). The action installs Kubernetes tools (kubectl, kustomize, helm, kubeval, conftest, and yq) and cache them on the runner. This is a typescript version of stefanprodan/kube-tools with no command input param.

Usage

Inputs

ParameterRequiredDefault ValueDescription
kubectlfalse1.18.2kubectl version. kubectl vesion can be found here
kustomizefalse3.5.5kustomize version. kustomize vesion can be found here
helmfalse2.16.7helm version. helm vesion can be found here
helmv3false3.2.1helm v3 version. helm v3 vesion can be found here
kubevalfalse0.15.0kubeval version. kubeval vesion can be found here
conftestfalse0.19.0conftest version. conftest vesion can be found here
rancherfalse2.4.10Rancher CLI version. Rancher CLI vesion can be found here

Supported Environments: Linux

Outputs

ParameterDescription
kubectl_pathkubectl command path
kustomize_pathkustomize command path
helm_pathhelm command path
helmv3_pathhelm v3 command path
kubeval_pathkubeval command path
conftest_pathconftest command path
yq_pathyq command path
rancher_pathrancher command path

Sample Workflow

Specific versions for the commands can be setup by adding inputs parameters like this:

{% raw %}

  test: 
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: yokawasa/action-setup-kube-tools@v0.1.0
      with:
        kubectl: '1.17.1'
        kustomize: '3.7.0'
        helm: '2.16.7'
        helmv3: '3.2.4'
        kubeval: '0.14.0'
        conftest: '0.18.2'
        rancher: '2.4.10'
      id: setup
    - run: |
        kubectl version --client
        kustomize version
        helm version --client
        helmv3 version
        kubeval --version
        conftest --version
        yq --version
        rancher --version        

{% endraw %}

Default versions for the commands will be setup if you don’t give any inputs like this:

{% raw %}

  test: 
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: yokawasa/action-setup-kube-tools@v0.1.0
      id: setup
    - run: |
        kubectl version --client
        kustomize version
        helm version --client
        helmv3 version
        kubeval --version
        conftest --version
        yq --version
        rancher --version        

{% endraw %}

Developing the action

Install the dependencies

npm install

Build the typescript and package it for distribution by running ncc

npm run build && npm run pack

Finally push the resutls

git add dist
git commit -a -m "prod dependencies"
git push origin releases/v0.1.0

Enjoy the action!