venkata
08/07/2024, 3:51 AMakhan4u
08/07/2024, 9:04 AMmanagedkaos
08/07/2024, 5:15 PMVishal
08/07/2024, 10:44 PMakhan4u
08/08/2024, 9:33 AMghcr as OCI registry for hosting your helm charts.
1. You need to generate a PAT token with following scopes (read:org, repo, write:packages)
2. Login to ghcr via helm CR_PAT=YOUR_TOKEN ; echo $CR_PAT | helm registry login ghcr.io/GITHUB_USERNAME -u GITHUB_USERNAME --password-stdin
3. I've used a tool helmper to download helm charts/images to the ghcr repo. It is compatible with other OCI registries too.
4. Generate helmper config and run helmper --f config.yaml
k8s_version: 1.27.9
import:
enabled: true
charts:
- name: prometheus
version: 25.8.0
valuesFilePath: /workspace/in/values/prometheus/values.yaml # (Optional)
repo:
name: prometheus-community
url: https://prometheus-community.github.io/helm-charts/
registries:
- name: ghcr
url: ghcr.io/GITHUB_USERNAME
Helmper output:
❯ helmper --f config.yml
_ _
| |_ ___ | | _____ ___ ___ ___
| || -_|| || || . || -_|| _|
|_|_||___||_||_|_|_|| _||___||_|
|_|
version 0.1.13 (commit fb537925fa03ff2bdbef970e94ccd48eba91c86a, built at 2024-07-26T13:20:18Z)
{"time":"2024-08-08T14:16:02.546160477+05:30","level":"INFO","msg":"Updated all Helm repositories ✅"}
+---+----------+------------+---------+----------------+--------+---------+--------------------------+---------+----------------------------------+---------+
| # | TYPE | CHART | VERSION | LATEST VERSION | LATEST | VALUES | SUBCHART | VERSION | CONDITION | ENABLED |
+---+----------+------------+---------+----------------+--------+---------+--------------------------+---------+----------------------------------+---------+
| 0 | Chart | prometheus | 25.8.0 | 25.25.0 | ❌ | default | | | | |
| 1 | Subchart | | | | | parent | alertmanager | 1.7.* | alertmanager.enabled | ✅ |
| 2 | Subchart | | | | | parent | kube-state-metrics | 5.15.* | kube-state-metrics.enabled | ✅ |
| 3 | Subchart | | | | | parent | prometheus-node-exporter | 4.24.* | prometheus-node-exporter.enabled | ✅ |
| 4 | Subchart | | | | | parent | prometheus-pushgateway | 2.4.* | prometheus-pushgateway.enabled | ✅ |
+---+----------+------------+---------+----------------+--------+---------+--------------------------+---------+----------------------------------+---------+
100% [===============] (5/5) Parsing charts...
+---+--------------------------+---------------+---------------------------------------------+----------------------------------------------------------------+
| # | HELM CHART | CHART VERSION | HELM VALUE PATH | IMAGE |
+---+--------------------------+---------------+---------------------------------------------+----------------------------------------------------------------+
| 0 | prometheus | 25.8.0 | server.image.repository | quay.io/prometheus/prometheus:v2.48.0 |
| | | | server.image.tag | |
| | | | server.image.digest | |
| 1 | prometheus | 25.8.0 | configmapReload.prometheus.image.digest | quay.io/prometheus-operator/prometheus-config-reloader:v0.67.0 |
| | | | configmapReload.prometheus.image.repository | |
| | | | configmapReload.prometheus.image.tag | |
| 2 | alertmanager | 1.7.* | image.repository | quay.io/prometheus/alertmanager:v0.26.0 |
| | | | image.tag | |
| 3 | kube-state-metrics | 5.15.* | image.registry | registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.1 |
| | | | image.repository | |
| | | | image.sha | |
| | | | image.tag | |
| 4 | prometheus-node-exporter | 4.24.* | image.repository | quay.io/prometheus/node-exporter:v1.7.0 |
| | | | image.tag | |
| | | | image.digest | |
| | | | image.registry | |
| 5 | prometheus-pushgateway | 2.4.* | image.repository | quay.io/prometheus/pushgateway:v1.6.2 |
| | | | image.tag | |
+---+--------------------------+---------------+---------------------------------------------+----------------------------------------------------------------+
+---+--------------------------+---------------+----------------------------------------------------------------+------+--------+
| # | HELM CHART | CHART VERSION | IMAGE | GHCR | IMPORT |
+---+--------------------------+---------------+----------------------------------------------------------------+------+--------+
| 0 | prometheus | 25.8.0 | quay.io/prometheus/prometheus:v2.48.0 | ❌ | ✅ |
| 1 | prometheus | 25.8.0 | quay.io/prometheus-operator/prometheus-config-reloader:v0.67.0 | ❌ | ✅ |
| 2 | alertmanager | 1.7.* | quay.io/prometheus/alertmanager:v0.26.0 | ❌ | ✅ |
| 3 | kube-state-metrics | 5.15.* | registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.1 | ❌ | ✅ |
| 4 | prometheus-node-exporter | 4.24.* | quay.io/prometheus/node-exporter:v1.7.0 | ❌ | ✅ |
| 5 | prometheus-pushgateway | 2.4.* | quay.io/prometheus/pushgateway:v1.6.2 | ❌ | ✅ |
+---+--------------------------+---------------+----------------------------------------------------------------+------+--------+
| | | | | | 6 |
+---+--------------------------+---------------+----------------------------------------------------------------+------+--------+
100% [===============] (5/5) Pushing charts...
100% [===============] (6/6) Pushing images...akhan4u
08/08/2024, 9:35 AMhelm pull oci://ghcr.io/GITHUB_USERNAME/charts/prometheus --version 25.8.0
docker pull ghcr.io/akhan4u/prometheus/prometheus:v2.48.0akhan4u
08/08/2024, 9:37 AMakhan4u
08/08/2024, 9:38 AMhelm upgrade --install ghcr-prom oci://ghcr.io/GITHUB_USERNAME/charts/prometheus --version 25.8.0managedkaos
08/08/2024, 3:22 PMvenkata
08/08/2024, 6:55 PMvenkata
08/11/2024, 3:47 AM