You can define it more easily in the new article.
Automatically Updating Helm Chart Referenced in Argo CD Using Renovate - Part 2
K@zuki. ・ May 5 '23
Introduction
The manifests repo for my home k8s cluster, home-apps, is managed by Argo CD, and each application creates resources using Helm Charts.
However, it is a hassle to manually update them during updates.
Therefore, I will use Renovate to automate the updates.
Setting up Renovate
You can automatically update applications using Renovate.
Refer to the official documentation to set up Renovate.
You will need to:
- Install and configure Renovate's GitHub App
- Merge the PR for the added Renovate configuration file
Once installed, you can check it on Renovate's dashboard.
Manifest Configuration
Before moving on to automatic upgrades, let me briefly introduce the configuration of the manifests repo.
Each manifest in the repo is configured as follows.
argocd-config
└── base
├── argocd.yaml
├── ingress-nginx.yaml
├── kustomization.yaml
├── metallb.yaml
└── sealed-secrets.yaml
Each file defines resources using Helm Charts.
The following is an excerpt from argocd.yaml
.
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd
spec:
...
source:
chart: argo-cd
repoURL: https://argoproj.github.io/argo-helm
targetRevision: 5.31.0
helm:
...
Automatic Upgrade
You can use Renovate's regexManagers to upgrade.
I don't like to write regexManagers for each application, so I specify the target repository and the release tag format as follows.
targetRevision: 5.31.0 # renovate: depName=argoproj/argo-helm extractVersion=^argo-cd-(?<version>.+)$
- Target repository
- Release tag format
Specify them as Renovate's update targets.
Release Tag Format
Since many Helm Charts managed by each repository have a prefix, the release tag of each repository contains not only the version string specified in targetRevision, but also a prefix.
The format of the release tags for each repository is as follows.
-
Argo CD …
argo-cd-{VERSION}
-
Ingress NGINX Controller …
helm-chart-{VERSION}
-
Sealed Secrets …
helm-v{VERSION}
-
MetalLB …
metallb-chart-{VERSION}
Define regexManagers
Based on this information, define regexManagers.
"regexManagers": [
{
"datasourceTemplate": "github-releases",
"fileMatch": [
"argocd-config/base/.*\\.yaml"
],
"matchStrings": [
" +targetRevision: +(?<currentValue>[^'\" ]+) +# renovate: depName=(?<depName>[^ \\n]+) +(extractVersion=(?<extractVersion>[^\\n]+))?",
],
},
]
Simply adding this definition will make the version of the Helm Charts in the manifest automatically updated.
Created PRs
The following PRs were created by the regexManagers defined this time and became as expected.
chore(deps): update dependency kubernetes/ingress-nginx to v4.6.0 #24
This PR contains the following updates:
Package | Update | Change |
---|---|---|
kubernetes/ingress-nginx | minor |
4.3.0 -> 4.6.0
|
Release Notes
kubernetes/ingress-nginx
v4.6.0
Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
v4.5.2
Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
v4.5.0
Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
v4.4.2
Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
v4.4.0
Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
Configuration
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
chore(deps): update dependency bitnami-labs/sealed-secrets to v2.8.2 #23
This PR contains the following updates:
Package | Update | Change |
---|---|---|
bitnami-labs/sealed-secrets | minor |
2.7.0 -> 2.8.2
|
Release Notes
bitnami-labs/sealed-secrets
v2.8.2
Helm chart for the sealed-secrets controller.
v2.8.1
Helm chart for the sealed-secrets controller.
v2.8.0
Helm chart for the sealed-secrets controller.
v2.7.6
Helm chart for the sealed-secrets controller.
v2.7.5
Helm chart for the sealed-secrets controller.
v2.7.4
Helm chart for the sealed-secrets controller.
v2.7.3
Helm chart for the sealed-secrets controller.
v2.7.2
Helm chart for the sealed-secrets controller.
v2.7.1
Helm chart for the sealed-secrets controller.
Configuration
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
chore(deps): update dependency metallb/metallb to v0.13.9 #22
This PR contains the following updates:
Package | Update | Change |
---|---|---|
metallb/metallb | patch |
0.13.7 -> 0.13.9
|
Release Notes
Configuration
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
chore(deps): update dependency argoproj/argo-helm to v5.31.1 #21
This PR contains the following updates:
Package | Update | Change |
---|---|---|
argoproj/argo-helm | patch |
5.31.0 -> 5.31.1
|
Release Notes
argoproj/argo-helm
v5.31.1
A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
Configuration
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
Conclusion
Those were the steps to automatically update the Argo CD application with Renovate.
You can use this for other things, so please try it out.
Reference
I referred to aqua-renovate-config for the definition of regexManagers.
aquaproj / aqua-renovate-config
Renovate Configuration to update packages and registries of aqua
aqua-renovate-config
Renovate Config Preset to update aqua, aqua-installer, packages, and registries.
Document
Please see document.
Contributing
Please see CONTRIBUTING.md.
Top comments (0)