Skip to content

Provide the kubectl for eks to use into a github action.

License

Notifications You must be signed in to change notification settings

jonathan-sh/kubectl

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl for AWS eks 🚀

Provide the kubectl command to make actions on your eks cluster.

Env check list

AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEYrequired: aws credentials with eks access.

KUBE_CONFIG_DATArequired: A base64-encoded kubeconfig file with configs for kubernetes to access the cluster.

You can get it by running the following command:

cat $HOME/.kube/config | base64

AWS_DEFAULT_REGIONoptional: If we do not define, the region from the KUBE_CONFIG_DATA will be used.

KUBE_NAMESPACE and KUBE_APP_NAMEoptional: To exemplify a rollout restart flow.

Usage

.github/workflows/eks.yml

on: push
name: deploy
jobs:
  deploy:
    name: Kubectl eks deploy to cluster
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@main
    - name: Rollout restart
      uses: jonathan-sh/kubectl@1
      env:
        kube_confg_data: ${{ secrets.KUBE_CONFIG_DATA }}
        kube_namespace: ${{ secrets.KUBE_NAMESPACE }}
        kube_app_name: ${{ secrets.KUBE_APP_NAME}}
        aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws_region: ${{ secrets.AWS_DEFAULT_REGION }}
      with:
        args: '"kubectl -n $kube_namespace rollout restart $kube_app_name"'

About

Provide the kubectl for eks to use into a github action.

Resources

License

Stars

Watchers

Forks

Packages

No packages published