Skip to content

kubectl CLI Action

Actions
Action to run kubectl command by passing kub config file (base64 encoded)
v1.0.0
Latest
Star (2)

Tags

 (1)

kubectl-cli action

Usage

TO make use of this action add the following steps to your GitHub Action workflow:

     - uses: teknatha136/actions-kubectl@main
       with:
         kubectl-version: v1.24.3
         kube-config: ${{ secrets.BASE64_ENCODED_KUBECONFIG_SECRET }}

This actions expects an optional kubectl-version input. This is the actual kubectl version that you want to use. You can find more about kubectl versions at https://v1-22.docs.kubernetes.io/docs/tasks/tools/install-kubectl-linux/. By default the actions takes latest stable (https://dl.k8s.io/release/stable.txt) available version.

Action also expects required kube-config input. This is the base64 encoded kubeconfig file. This is usually available at ~/.kube/config.

Once above step is included in you GitHub Action workflow, kubectl will be downloaded and stored ./kubebin directory and kubeconfig file will be decoded and stored at ./.kube/config directory

To execute the kubectl command refer below example

      - uses: teknatha136/actions-kubectl@main
        with:
          kubectl-version: v1.24.3
          kube-config: ${{ secrets.BASE64_ENCODED_KUBECONFIG_SECRET }}

      - run: ./kubebin/kubectl --kubeconfig=.kube/config get nodes

kubectl CLI Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Action to run kubectl command by passing kub config file (base64 encoded)
v1.0.0
Latest

Tags

 (1)

kubectl CLI Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.