Skip to content

private-circle/actions-setup-k8s-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Actions Setup K8s CLI

This github action sets up an opinionated kubernetes cli environment. As part of this, it installs

Usage

.github/workflows/ci.yml

name: CI
on: push
  branches: [ main ]
jobs:
  test:
    name: Tests during
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    
    - name: Setup K8s CLI
      uses: private-circle/actions-setup-k8s-cli
      env:
        KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
     
     - name: Get Pods
        run: |
          kubectl get pods -A
            
     - name: Helmfile Diff
        id: helmfile-diff
        run: | 
          helmfile diff

Secrets

KUBE_CONFIG_DATArequired: 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