Giter VIP home page Giter VIP logo

dokube's Introduction

DigitalOcean Kubernetes GitHub Action

Fetches the config for your DigitalOcean Kubernetes Cluster, then installs and configures kubectl, exposing it to path for future use!

GitHub Release

For help updating, view the change logs.

Runs on

Type Systems Note
GitHub Runners ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 All available GitHub hosted runners.
Self-Hosted Runners linux-amd64, linux-arm64, linux-s390x, macOS-x64, windows-x64 Not tested, but in theory should work as long as kubectl is available for your system.

Inputs

Name Requirement Description
personalAccessToken Required A DigitalOcean Personal Access Token to use for authentication, when fetching cluster credentials from DigitalOcean. Must be tied to the same account as the Kubernetes Cluster you are trying to operate on. For instructions, see here.
clusterName Required The name of the cluster you are trying to operate on. This was chosen during the "Choose a name" step when originally creating the cluster.
version Optional The kubectl version to use. Remember to omit "v" prefix, for example: 1.16.0. Defaults to 1.16.0. See example below.
expirationTime Optional Amount of time, in seconds, that the generated DigitalOcean Token has to live. Typically should be slightly longer than the amount of time your job will run. Defaults to 600. See example below.

Example usage

Simple, minimal usage...

- name: Set up kubectl
  uses: matootie/[email protected]
  with:
    personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
    clusterName: my-fabulous-cluster

- name: Get nodes
  run: kubectl get nodes

This will setup kubectl configured with your DigitalOcean Kubernetes cluster. After that you're free to use kubectl as you wish!

Specifying a specific kubectl version...

- name: Set up kubectl
  uses: matootie/[email protected]
  with:
    personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
    clusterName: my-fabulous-cluster
    version: "1.17.4"

- name: Get nodes
  run: kubectl get nodes

If you would like to install a specific version of kubectl, you can specify it with the version input.

Specifying a custom expiration time...

- name: Set up kubectl
  uses: matootie/[email protected]
  with:
    personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
    clusterName: my-fabulous-cluster
    expirationTime: "1200"

- name: Get nodes
  run: kubectl get nodes

The generated Kubernetes config is set to only last a short amount of time, as it is only expected to be used for the duration of the job. If you would like to specify a shorter or larger time, better tailored to the average length of your job, you can do so with the expirationTime input.

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.