Skip to content

Commit

Permalink
feat: renovate grafana dashboard revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Oct 17, 2023
1 parent 4b0649b commit 55293b3
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 77 deletions.
2 changes: 2 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
color: "ffc300"
- name: renovate/terraform
color: "ffc300"
- name: renovate/grafana-dashboard
color: "ffc300"
# Semantic Type
- name: type/digest
color: "FFEC19"
Expand Down
65 changes: 4 additions & 61 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
"github>buroa/k8s-gitops//.github/renovate/allowedVersions.json5",
"github>buroa/k8s-gitops//.github/renovate/autoMerge.json5",
"github>buroa/k8s-gitops//.github/renovate/commitMessage.json5",
"github>buroa/k8s-gitops//.github/renovate/customDatasources.json5",
"github>buroa/k8s-gitops//.github/renovate/customManagers.json5",
"github>buroa/k8s-gitops//.github/renovate/groups.json5",
"github>buroa/k8s-gitops//.github/renovate/labels.json5",
"github>buroa/k8s-gitops//.github/renovate/packageRules.json5",
"github>buroa/k8s-gitops//.github/renovate/semanticCommits.json5",
"helpers:pinGitHubActionDigests"
],
Expand All @@ -33,65 +36,5 @@
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
]
},
"customManagers": [
{
"description": "Process Tekton dependencies",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"depName=(?<depName>\\S+)?\n.*?(?<currentValue>v\\d+\\.\\d+\\.\\d+)"
],
"datasourceTemplate": "github-releases"
},
{
"description": "Process custom dependencies",
"fileMatch": [
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
// Example: `version: "v1.27.3+k3s1"`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?\"(?<currentValue>.*)\"\n",
// Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/install.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/ha/install.yaml`
// `- https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/21.1.1/kubernetes/kubernetes.yml`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?-\\s(.*?)\/(?<currentValue>(v|\\d)[^/]+)\/\\S+\n",
// Example: apiVersion=helm.cattle.io/v1 kind=HelmChart
"datasource=(?<datasource>\\S+)\n.*?repo: (?<registryUrl>\\S+)\n.*?chart: (?<depName>\\S+)\n.*?version: (?<currentValue>\\S+)\n"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"description": "Process CloudnativePG Postgresql version",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)"
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
}
],
"packageRules": [
{
"description": "Loose versioning for non-semver packages",
"matchDatasources": ["docker"],
"versioning": "loose",
"matchPackagePatterns": ["plex", "qbittorrent"]
},
{
"description": "Custom versioning for i915-ucode and intel-ucode",
"matchDatasources": ["docker"],
"versioning": "regex:^(?<major>\\d{4})(?<minor>\\d{2})(?<patch>\\d{2})\\.?(?<build>\\d+)?$",
"matchPackageNames": [
"ghcr.io/siderolabs/i915-ucode",
"ghcr.io/siderolabs/intel-ucode"
]
}
]
}
}
5 changes: 5 additions & 0 deletions .github/renovate/commitMessage.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
{
"matchDatasources": ["docker"],
"commitMessageTopic": "image {{depName}}"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"commitMessageTopic": "dashboard {{depName}}",
"commitMessageExtra": "to v{{newVersion}}"
}
]
}
12 changes: 12 additions & 0 deletions .github/renovate/customDatasources.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customDatasources": {
"grafana-dashboards": {
"defaultRegistryUrlTemplate": "https://grafana.com/api/dashboards/{{packageName}}",
"format": "json",
"transformTemplates": [
"{\"releases\":[{\"version\": $string(revision)}]}"
]
}
}
}
58 changes: 58 additions & 0 deletions .github/renovate/customManagers.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"description": "Process generic dependencies in YAML files",
"fileMatch": [
"(^|/)\\.taskfiles/.+\\.ya?ml(\\.j2)?$",
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?:\\s+extractVersion=(?<extractVersion>.+?))?(?:\\s+versioning=(?<versioning>.+?))?\\s+depName=(?<depName>.+?)?\\s(?:\\s+.*(?:[v|V]ersion):\\s+(?<currentValue>.*))?(?:\\s.*(?:[r|R]ef):\\s+(?<currentDigest>.*))?"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
},
{
"description": "Process custom dependencies",
"fileMatch": [
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
// Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/install.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/ha/install.yaml`
// `- https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/21.1.1/kubernetes/kubernetes.yml`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?-\\s(.*?)\/(?<currentValue>(v|\\d)[^/]+)\/\\S+\n",
// Example: apiVersion=helm.cattle.io/v1 kind=HelmChart
"datasource=(?<datasource>\\S+)\n.*?repo: (?<registryUrl>\\S+)\n.*?chart: (?<depName>\\S+)\n.*?version: (?<currentValue>\\S+)\n"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"description": "Process Grafana dashboards",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"#\\s+renovate:\\s+depName=\"(?<depName>.*)\"\\n\\s+gnetId:\\s+(?<packageName>.*?)\\n\\s+revision:\\s+(?<currentValue>.*)"
],
"customType": "regex",
"versioningTemplate": "regex:^(?<major>\\d+)$",
"datasourceTemplate": "custom.grafana-dashboards"
},
{
"description": "Process CloudnativePG Postgresql version",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)"
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
}
]
}
10 changes: 10 additions & 0 deletions .github/renovate/groups.json5
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
"commitMessageTopic": "{{{groupName}}} group"
},
"separateMinorPatch": true
},
{
"description": "Talos Group",
"groupName": "Talos",
"matchPackagePatterns": ["siderolabs/talos", "siderolabs/talosctl", "buroa/installer"],
"matchDatasources": ["docker", "github-releases"],
"group": {
"commitMessageTopic": "{{{groupName}}} group"
},
"separateMinorPatch": true
}
]
}
4 changes: 4 additions & 0 deletions .github/renovate/labels.json5
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
{
"matchDatasources": ["pypi"],
"addLabels": ["renovate/pip"]
},
{
"matchDatasources": ["grafana-dashboards", "custom.grafana-dashboards"],
"addLabels": ["renovate/grafana-dashboard"]
}
]
}
20 changes: 20 additions & 0 deletions .github/renovate/packageRules.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"description": "Loose versioning for non-semver packages",
"matchDatasources": ["docker"],
"versioning": "loose",
"matchPackagePatterns": ["plex", "qbittorrent"]
},
{
"description": "Custom versioning for i915-ucode and intel-ucode",
"matchDatasources": ["docker"],
"versioning": "regex:^(?<major>\\d{4})(?<minor>\\d{2})(?<patch>\\d{2})\\.?(?<build>\\d+)?$",
"matchPackageNames": [
"ghcr.io/siderolabs/i915-ucode",
"ghcr.io/siderolabs/intel-ucode"
]
}
]
}
5 changes: 5 additions & 0 deletions .github/renovate/semanticCommits.json5
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
"matchUpdateTypes": ["patch"],
"semanticCommitType": "fix",
"semanticCommitScope": "github-action"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"matchUpdateTypes": ["major"],
"commitMessagePrefix": "feat(grafana-dashboard)!: "
}
]
}
48 changes: 32 additions & 16 deletions kubernetes/apps/monitoring/grafana/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,29 +186,35 @@ spec:
dashboards:
default:
node-exporter-full:
gnetId: 1860 # https://grafana.com/grafana/dashboards/1860?tab=revisions
# renovate: depName="Node Exporter Full"
gnetId: 1860
revision: 31
datasource: Prometheus
redis:
gnetId: 763 # https://grafana.com/grafana/dashboards/763?tab=revisions
# renovate: depName="Redis Dashboard for Prometheus Redis Exporter 1.x"
gnetId: 763
revision: 5
datasource: Prometheus
external-dns:
gnetId: 15038 # https://grafana.com/grafana/dashboards/15038?tab=revisions
# renovate: depName="External-dns"
gnetId: 15038
revision: 1
datasource: Prometheus
blackbox-exporter:
gnetId: 7587 # https://grafana.com/grafana/dashboards/7587?tab=revisions
# renovate: depName="Prometheus Blackbox Exporter"
gnetId: 7587
revision: 3
datasource: Prometheus
cloudflared:
gnetId: 17457 # https://grafana.com/grafana/dashboards/17457?tab=revisions
# renovate: depName="Cloudflare Tunnels (cloudflared)"
gnetId: 17457
revision: 6
datasource:
- name: DS_PROMETHEUS
value: Prometheus
speedtest-exporter:
gnetId: 13665 # https://grafana.com/grafana/dashboards/13665?tab=revisions
# renovate: depName="Speedtest-Exporter Dashboard"
gnetId: 13665
revision: 4
datasource:
- name: DS_PROMETHEUS
Expand All @@ -224,15 +230,18 @@ spec:
datasource: Prometheus
ceph:
ceph-cluster:
gnetId: 2842 # https://grafana.com/grafana/dashboards/2842?tab=revisions
# renovate: depName="Ceph Cluster"
gnetId: 2842
revision: 17
datasource: Prometheus
ceph-osd:
gnetId: 5336 # https://grafana.com/grafana/dashboards/5336?tab=revisions
# renovate: depName="Ceph - OSD (Single)"
gnetId: 5336
revision: 9
datasource: Prometheus
ceph-pools:
gnetId: 5342 # https://grafana.com/grafana/dashboards/5342?tab=revisions
# renovate: depName="Ceph - Pools"
gnetId: 5342
revision: 9
datasource: Prometheus
flux:
Expand Down Expand Up @@ -265,7 +274,8 @@ spec:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
datasource: Prometheus
kubernetes-volumes:
gnetId: 11454 # https://grafana.com/grafana/dashboards/11454?tab=revisions
# renovate: depName="K8s / Storage / Volumes / Cluster"
gnetId: 11454
revision: 14
datasource: Prometheus
nginx:
Expand All @@ -277,7 +287,8 @@ spec:
datasource: Prometheus
blocky:
blocky:
gnetId: 13768 # https://grafana.com/grafana/dashboards/13768?tab=revisions
# renovate: depName="blocky"
gnetId: 13768
revision: 3
datasource:
- name: DS_PROMETHEUS
Expand Down Expand Up @@ -317,19 +328,23 @@ spec:
datasource: Prometheus
unifi:
unifi-insights:
gnetId: 11315 # https://grafana.com/grafana/dashboards/11315?tab=revisions
# renovate: depName="UniFi-Poller: Client Insights - Prometheus"
gnetId: 11315
revision: 9
datasource: Prometheus
unifi-network-sites:
gnetId: 11311 # https://grafana.com/grafana/dashboards/11311?tab=revisions
# renovate: depName="UniFi-Poller: Network Sites - Prometheus"
gnetId: 11311
revision: 5
datasource: Prometheus
unifi-uap:
gnetId: 11314 # https://grafana.com/grafana/dashboards/11314?tab=revisions
# renovate: depName="UniFi-Poller: UAP Insights - Prometheus"
gnetId: 11314
revision: 10
datasource: Prometheus
unifi-usw:
gnetId: 11312 # https://grafana.com/grafana/dashboards/11312?tab=revisions
# renovate: depName="UniFi-Poller: USW Insights - Prometheus"
gnetId: 11312
revision: 9
datasource: Prometheus
media:
Expand All @@ -345,7 +360,8 @@ spec:
- name: DS_PROMETHEUS
value: Prometheus
unpackerr:
gnetId: 18817 # https://grafana.com/grafana/dashboards/18817?tab=revisions
# renovate: depName="Unpackerr"
gnetId: 18817
revision: 1
datasource:
- name: DS_PROMETHEUS
Expand Down
3 changes: 3 additions & 0 deletions talos/talconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ clusterPodNets:
clusterSvcNets:
- 10.245.0.0/16

# renovate: datasource=github-releases depName=siderolabs/talos
talosVersion: v1.5.3
# renovate: datasource=github-releases depName=kubernetes/kubernetes
kubernetesVersion: 1.28.2

endpoint: https://k8s.${domainName}:6443

additionalApiServerCertSans:
Expand Down

0 comments on commit 55293b3

Please sign in to comment.