Skip to content

mogenius/renovate-operator

Repository files navigation

Renovate Operator Logo

Artifact Hub GitHub Release Build, Package, Release (Production)


Renovate is one of, if not the leading tool for automated dependency updates.

With tools like Mend Renovate you can easily use renovate for free.

But what if you want to run renovate on your own hardware? What if you are running a private GitLab instance? Or just want better control over the scheduling of your renovate executions?

If you are already running Kubernetes, this project might be for you.

How it works

  1. At the defined time of your schedule, a renovate discovery job is started
  2. After the discovery finished, you will be able to see all your discovered projects in the UI
  3. All projects are now being set to be scheduled
  4. Every 10 seconds the operator checks for schedules projects and starts a new renovate job
  5. Only as many jobs as defined in spec.parallelism are getting executed at the same time

Example Screenshot of the renovate-operator UI.

Installation

Helm

helm repo add mogenius https://helm.mogenius.com/public --force-update
helm -n renovate-operator upgrade --install renovate-operator mogenius/renovate-operator --create-namespace --wait

Documentation

Examples

GitHub

RenovateJob Configuration for GitHub

apiVersion: renovate-operator.mogenius.com/v1alpha1
kind: RenovateJob
metadata:
  annotations:
  name: renovate-github
  namespace: renovate-operator
spec:
  discoveryFilter: ###GITHUB_USERNAME###/*
  extraEnv:
    - name: RENOVATE_PLATFORM
      value: github
    - name: RENOVATE_ENDPOINT
      value: https://api.github.com/
    - name: RENOVATE_ALLOW_PLUGINS
      value: "true"
  image: renovate/renovate:41.43.3
  parallelism: 5
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
  schedule: 0 * * * *
  secretRef: renovate-secret

Secret Configuration for GitHub

kind: Secret
apiVersion: v1
type: Opaque
metadata:
  name: renovate-secret
  namespace: renovate-operator
data:
  GITHUB_COM_USER: USERNAME_BASE64_ENCODED
  GITHUB_COM_TOKEN: GITHUB_TOKEN_VALUE_BASE64_ENCODED
  RENOVATE_TOKEN: RENOVATE_TOKEN_VALUE_BASE64_ENCODED

Go to GitHub Fine-grained PAT and add a PAT with the following minimum permissions:

Example Screenshot of the renovate-operator UI.

Gitlab

apiVersion: renovate-operator.mogenius.com/v1alpha1
kind: RenovateJob
metadata:
  name: renovate-group1
  namespace: renovate-operator
spec:
  schedule: "0 * * * *"
  discoveryFilter: "Group1/*"
  image: renovate/renovate:41.43.3 # renovate
  secretRef: "renovate-secret"
  extraEnv:
    - name: RENOVATE_ENDPOINT
      value: "https://gitlab.company.com"
    - name: RENOVATE_PLATFORM
      value: "gitlab"
    - name: RENOVATE_ALLOW_PLUGINS
      value: "true"
  parallelism: 1
  resources:
    requests:
      cpu: "100m"
      memory: "128Mi"
    limits:
      cpu: "500m"
      memory: "1Gi"
  nodeSelector:
    kubernetes.io/hostname: server-1

Contributing

Made with contrib.rocks.

Development

Running Tests

Run the test suite:

go test -v ./...

Code Quality

Run golangci-lint locally:

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run

Generate CRDs

controller-gen crd paths=./src/... output:crd:dir=charts/renovate-operator/crds

About

Operator to streamline renovate executions in Kubernetes

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 8