Code Monkey home page Code Monkey logo

kube's Introduction

Github Action for Kubernetes CLI

  • Image based on debian11
  • Fork from patoxs
  • docker push redalvagui/kube:latest

Usage

.github/workflows/eks.yml

The yaml file should look like

on: push
name: deploy
env:
  IMAGE: 'bash:5.2'
  NAMESPACE: 'test'
jobs:
  deploy:
    name: Deploy to cluster
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master

    - name: deploy to cluster
      uses: RAcl/kube@main
      env:
        KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DATA }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
      with:
        args: set image --record deployment.apps/my-app my-app=${{ env.IMAGE }} -n ${{ env.NAMESPACE }}

    - name: verify deployment
      uses: RAcl/kube@main
      env:
        KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DATA }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
      with:
        args: rollout status deployment.apps/my-app -n ${{ env.NAMESPACE }}

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
  • AWS_ACCESS_KEY_IDrequired: AWS account access key ID, located in the credentials file. You can get it by running the following command:

    cat ~/.aws/credentials
  • AWS_SECRET_ACCESS_KEYrequired: AWS account secret access key, located in the credentials file. You can get it by running the following command:

    cat ~/.aws/credentials
  • AWS_DEFAULT_REGIONno-required: AWS region where the deployment will be made. Default region is us-east-1

kube's People

Contributors

patoxs avatar racl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.