Coder Social home page Coder Social logo

mercedes-benz / garm-provider-k8s Goto Github PK

View Code? Open in Web Editor NEW
5.0 8.0 4.0 234 KB

a kubernetes provider for garm

License: MIT License

Makefile 7.06% Starlark 1.50% Go 66.42% JavaScript 4.58% Dockerfile 1.42% Shell 19.03%
garm github-actions kubernetes

garm-provider-k8s's Introduction

Go Report Card GitHub release (latest SemVer) build

garm-provider-k8s

✨ What is the garm-provider-k8s?

garm-provider-k8s is a Kubernetes® a plugin for garm which enables garm to spin up Pod based GitHub® Action runners on a Kubernetes cluster.

🔀 Versioning

Kubernetes Version

garm-provider-k8s uses client-go to talk with Kubernetes clusters. The supported Kubernetes cluster version is determined by client-go. The compatibility matrix for client-go and Kubernetes cluster can be found here.

🚀 Installation

Prerequisites

  1. A Kubernetes cluster to spin up runners with the garm-provider-k8s plugin.
  2. A working garm installation.

Installation

garm-provider-k8s

We are releasing the garm-provider-k8s as a simple go binary. You can find the latest release here. Adjust your existing garm config, so garm can register to provider plugin at runtime. Make sure garm has access to the binary and provider specific config path like so:

[[provider]]
name = "kubernetes_external"
description = "kubernetes provider"
provider_type = "external"
[provider.external]
config_file = "/path/to/garm-provider-k8s-config.yaml"
provider_executable = "/path/to/provider/binary/garm-provider-k8s"
environment_variables = ["KUBERNETES_"] # this must be set if the runner-pods should run in the same cluster as garm itself is running and the attached serviceaccount should be used to create pods and the runner namespace

The provider specific config file should look like this:

kubeConfigPath: "" # path to a kubernetes config file - if empty the in cluster config will be used
runnerNamespace: "runner" # namespace to create the runner pods in
podTemplate: # pod template to use for the runner pods / helpful to add sidecar containers
  spec:
    volumes:
      - name: my-additional-volume
        emptyDir: {}
flavors: # configure different flavors which will be set as `ResourceRequirements` at runner container and can be targeted from a pool via its `flavor` property
  micro:
    requests:
      cpu: 50m
      memory: 50Mi
    limits:
      memory: 200Mi
  ultra:
    requests:
      cpu: 500m
      memory: 500Mi
    limits:
      memory: 1Gi

💻 Development

For local development, please read the development guide.

Contributing

We welcome any contributions. If you want to contribute to this project, please read the contributing guide.

Code of Conduct

Please read our Code of Conduct as it is our base for interaction.

License

This project is licensed under the MIT LICENSE.

Provider Information

Please visit https://www.mercedes-benz-techinnovation.com/en/imprint/ for information on the provider.

Notice: Before you use the program in productive use, please take all necessary precautions, e.g. testing and verifying the program with regard to your specific use. The program was

garm-provider-k8s's People

Contributors

dependabot[bot] avatar bavarianbidi avatar rafalgalaw avatar gabriel-samfira avatar

Stargazers

Heiko Kast avatar Jared Thivener avatar  avatar  avatar  avatar

Watchers

 avatar  avatar Michael Kuhnt avatar  avatar  avatar  avatar Fabian F avatar  avatar

garm-provider-k8s's Issues

Make Runner Flavour (Pod Resources) configurable

What is the feature you would like to have?

Right now the runner flavour is a hard coded mapping to container requests and limits. It would be nice from a user perspective to provide a custom mapping of "runner flavours" to resource requests and limits in the runner container either in the provider config or pools extraSpec field like:

flavour:
  micro:
    requests:
      cpu: 100m
      memory: 100Mi
    limits:
      memory: 200Mi
  medium:
    requests:
      cpu: 200m
      memory: 200Mi
    limits:
      memory: 300Mi

So one can reference micro or medium in a pool and the provider will spin pods with their respective resources

Anything else you would like to add?

No response

Resolve License Scan Issues Hashicorp Dependencies

What steps did you take and what happened?

Right now transitive hashicorp dependencies are getting fetched, which causes the blackduck scan to fail

What did you expect to happen?

No response

garm version

No response

garm-provider-k8s version

No response

Kubernetes version

No response

Anything else you would like to add?

No response

pulling images via registry credentials should be possible

What is the feature you would like to have?

It's already possible to define a custom runner image. But this configuration assume, that the image can be pulled from a registry without authentication.

It would be nice to define a pull-secret to make the pull work.

Anything else you would like to add?

No response

Custom labels through extra specs or podTemplate

What is the feature you would like to have?

I would like to be able to add custom labels through the extra specs or podTemplate.

I was hoping this was already possible and I tried enhancing the podTemplate in the provider config as follows:

podTemplate:
  metadata:
    labels:
      custom-label: custom-value

and it did not reflect successfully on the instance spec once deployed.

This seems to be because the merge functionality specifically merged the Spec object inside of podTemplate.

Anything else you would like to add?

We use labels for network filtering and this would be useful to be configurable.

Make pod spec of runner configurable

What steps did you take and what happened?

Right now the pod is generated within the go code. This is fine for now, however one can not customize the pod with additional env, init or sidecar containers.

What did you expect to happen?

I want to be able to configure a PodTemplate in the providers config, which gets merged/overwrites the default pod generated in the go code.
Things to consider:

  • not all envs should be overwriteable by custom PodTemplate
  • Some PodTemplate fields need to be set by the provider and can not be overwritten.

garm version

No response

garm-provider-k8s version

No response

Kubernetes version

No response

Anything else you would like to add?

No response

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.