Skip to content
/ kubectl Public archive
forked from steebchen/kubectl

A Github action for kubectl, the Kubernetes CLI

License

Notifications You must be signed in to change notification settings

napopravku/kubectl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for Kubernetes CLI

This action provides kubectl for GitHub Actions.

Upgrading from v1 to v2

If you upgrade from v1 to v2, note that you need to specify new variables via with, namely version, config, and command. See below for an example.

Usage

.github/workflows/push.yml

on: push
name: deploy
jobs:
  deploy:
    name: deploy to cluster
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: deploy to cluster
      uses: steebchen/kubectl@v2.0.0
      with: # defaults to latest kubectl binary version
        config: ${{ secrets.KUBE_CONFIG_DATA }}
        command: set image --record deployment/my-app container=${{ github.repository }}:${{ github.sha }}
    - name: verify deployment
      uses: steebchen/kubectl@v2.0.0
      with:
        config: ${{ secrets.KUBE_CONFIG_DATA }}
        version: v1.21.0 # specify kubectl binary version explicitly
        command: rollout status deployment/my-app

Arguments

commandrequired: The command you want to run, without kubectl, e.g. get pods

configrequired: A base64-encoded kubeconfig file with credentials for Kubernetes to access the cluster. You can get it by running the following command:

cat $HOME/.kube/config | base64

version: The kubectl version with a 'v' prefix, e.g. v1.21.0. It defaults to the latest kubectl binary version available.

Note: Do not use kubectl config view as this will hide the certificate-authority-data.

About

A Github action for kubectl, the Kubernetes CLI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 56.1%
  • Shell 43.9%