GithubHelp home page GithubHelp logo

isabella232 / renovate-helm-releases Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angelnu/renovate-helm-releases

0.0 0.0 0.0 145 KB

Creates Renovate annotations in Flux2 Helm Releases

License: Apache License 2.0

Shell 5.34% Python 88.24% Dockerfile 6.41%

renovate-helm-releases's Introduction

Renovate Helm Releases


IMPORTANT NOTE: As of Renovate 31.35.0, this script and regexManager should not be needed in order for Renovate to update Flux HelmReleases. As such this repo will be going into maintainence mode and eventually archived.


All Contributors

A script / action that configures Flux2 HelmRelease's for automated updates using Renovate.

A common way to get started on a GitHub repository is:

Example HelmRelease with annotation

This is an example of the annotation this script adds to the helm chart spec of a HelmRelease.

---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: ingress-nginx-1
  namespace: default
spec:
  interval: 5m
  chart:
    spec:
      # renovate: registryUrl=https://kubernetes.github.io/ingress-nginx
      chart: ingress-nginx
      version: 3.23.0
      sourceRef:
        kind: HelmRepository
        name: ingress-nginx-charts
        namespace: flux-system
      interval: 5m

Workflow example usage

A common approach is to schedule a cron job workflow to invoke this script an update any annotations and send a pull request. See example clusters in https://github.com/k8s-at-home/awesome-home-kubernetes in particular .github/workflows for an end to end example.

uses: k8s-at-home/renovate-helm-releases@v1
with:
  # Path to the folder containing your Flux2 Helm Repositories and Helm Releases
  cluster-path: './cluster'
  # Folders to exclude such as those use includes (Example: Ansible Vault)
  exclude-folders: './cluster/ansible','./cluster/docs'
  # Turn on debug logging
  debug: 'no'
  # Do not alter Helm Release files
  dry-run: 'no'
  # Tolerate yaml files with errors instead of aborting on errors
  tolerate-yaml-errors: 'no'

Script usage example

This script will only work with Python 3

# install python dependencies
pip install -U -r requirements.txt
# run the script
./renovate.py --cluster-path="./cluster"

pre-commit usage example

You can use pre-commit for updating the files before checkin.

- repo: https://github.com/k8s-at-home/renovate-helm-releases
  rev: RELEASE_TAG
  hooks:
  - id: renovate-helm-releases
    args: ['./cluster', '--excluded-folders', './cluster/charts']

Renovate configuration example

Something like the following is needed in order for Renovate to pick up HelmReposistory's and HelmRelease's

  "regexManagers": [
    // regexManager to read and process helm repositories
    {
      // tell renovatebot to parse only helm releases
      "fileMatch": ["cluster/.+helm-release\\.yaml$"],
      // tell renovatebot to match the following pattern in helm release files
      "matchStrings": [
        "registryUrl=(?<registryUrl>.*?)\n *chart: (?<depName>.*?)\n *version: (?<currentValue>.*)\n"
      ],
      // tell renovatebot to search helm repositories
      "datasourceTemplate": "helm"
    },

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs

💻

Allen Porter

💻

Alex Tennant

💻

Angel Nunez Mencias

💻

Jack Maloney

💻

Patrick Ruckstuhl

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

renovate-helm-releases's People

Contributors

onedr0p avatar bjw-s avatar allenporter avatar allcontributors[bot] avatar renovate[bot] avatar jmmaloney4 avatar renovate-bot avatar adtennant avatar tarioch avatar samip5 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.