Code Monkey home page Code Monkey logo

deploy-to-kubernetes's Introduction

deploy-to-kubernetes

Action for deploying a ghcr image to a kuberenetes cluster

Uses kubectl set image command.

Example

To use this action to deploy a deployment image to the web deployment and web container:

   - name: Deploy to NAMESPACE
      uses: mlibrary/deploy-to-kubernetes@v3
      with:
        registry_token: ${{ secrets.GITHUB_TOKEN }}
        image: ghcr.io/myorganization/my_app:latest
        cluster_ca: ${{ secrets.KUBERNETES_CA }}
        cluster_server: my-kubernetes-server
        namespace_token: ${{ secrets.NAMESPACE_CA }}
        namespace: my-app-namespace
       

To use this action to deploy a cronjob image

   - name: Deploy to NAMESPACE
      uses: mlibrary/deploy-to-kubernetes@v3
      with:
        registry_token: ${{ secrets.GITHUB_TOKEN }}
        image: ghcr.io/myorganization/my_app:latest
        cluster_ca: ${{ secrets.KUBERNETES_CA }}
        cluster_server: my-kubernetes-server
        namespace_token: ${{ secrets.NAMESPACE_CA }}
        namespace: my-app-namespace
        resource_type: cronjob
        resource_name: my-cronjob-name
        container: my-cronjob-name
       

Inputs

Required

Name Description
registry_token The token to use to log in to the registry. For GHCR this shold be ${{ secrets.GITHUB_TOKEN }}.
image Image to deploy, e.g. registry/organization/image_name:tag
cluster_server The Kubernetes server
cluster_ca The Kubernetes cluster CA certificate, base64-encoded, e.g. from:
cat ~/.kube/certs/my-cluster/k8s-ca.crt | base64
namespace_token A base64-encoded Kubernetes service account token that can be used to set the image for the given deployment in the given namespace, e.g. from:
kubectl -n my-namespace get -o json secret my-service-token | jq -r .data.token
namespace The Kubernetes namespace to deploy to.

Optional

Name Description Value
registry Registry to log in to ghcr.io
registry_username Username to log into the registry with ${{ github.actor }}
resource_type Any resource type, comma-separated set of resource types, or 'all' deployment
resource_name Name of the resource whose image to set, a label selector like --selector='app=someapp', or --all web
container The container in the resource whose image to set, or "*" for all containers web

deploy-to-kubernetes's People

Contributors

niquerio avatar aelkiss avatar

Stargazers

Greg Kostin avatar

Watchers

James Cloos avatar Suleman Diwan avatar  avatar Matt LaChance avatar Greg Kostin avatar  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.