1 Commits

Author SHA1 Message Date
85e2f9607c fix(ci): replace volker.raschek/helm with docker.io/alpine/helm
All checks were successful
Helm / Execute helm lint (push) Successful in 6s
Helm / Execute helm unittest (push) Successful in 11s
Helm / Execute helm template (push) Successful in 27s
2025-10-16 21:11:52 +02:00
9 changed files with 95 additions and 132 deletions

View File

@@ -12,31 +12,56 @@ on:
jobs: jobs:
helm-lint: helm-lint:
container: container: docker.io/alpine/helm:3.19.0
image: docker.io/volkerraschek/helm:3.19.0 name: Execute helm lint
runs-on: runs-on: ubuntu-latest
- ubuntu-latest
steps: steps:
- name: Install tooling - name: Install additional tools
run: | run: |
apk update apk update
apk add git npm apk add --update bash make nodejs
- uses: actions/checkout@v5.0.0 - uses: actions/checkout@v5.0.0
- name: Lint helm files - name: Install helm chart dependencies
run: | run: helm dependency build
helm lint --values values.yaml . - name: Execute helm lint
run: helm lint
helm-template:
container: docker.io/alpine/helm:3.19.0
name: Execute helm template
runs-on: ubuntu-latest
steps:
- name: Install additional tools
run: |
apk update
apk add --update bash make nodejs
- uses: actions/checkout@v5.0.0
- name: Extract repository owner and name
run: |
echo "REPOSITORY_NAME=$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 2 | sed --regexp-extended 's/-charts?//g')" >> $GITHUB_ENV
echo "REPOSITORY_OWNER=$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 1)" >> $GITHUB_ENV
- name: Install helm chart dependencies
run: helm dependency build
- name: Execute helm template
run: helm template --debug "${REPOSITORY_NAME}" .
helm-unittest: helm-unittest:
container: container: docker.io/alpine/helm:3.19.0
image: docker.io/volkerraschek/helm:3.19.0 env:
runs-on: HELM_UNITTEST_VERSION: v1.0.1 # renovate: datasource=github-releases depName=helm-unittest/helm-unittest
- ubuntu-latest name: Execute helm unittest
runs-on: ubuntu-latest
steps: steps:
- name: Install tooling - name: Install additional tools
run: | run: |
apk update apk update
apk add git npm apk add --update bash make nodejs npm yamllint ncurses
- uses: actions/checkout@v5.0.0 - uses: actions/checkout@v5.0.0
- name: Unittest - name: Install helm chart dependencies
run: | run: helm dependency build
helm unittest --strict --file 'unittests/**/*.yaml' ./ - name: Install helm plugin 'unittest'
run: helm plugin install --version "${HELM_UNITTEST_VERSION}" https://github.com/helm-unittest/helm-unittest
- name: Execute helm unittest
env:
TERM: xterm
run: helm unittest --strict --file 'unittests/**/*.yaml' ./

View File

@@ -16,7 +16,10 @@ Chapter [configuration and installation](#helm-configuration-and-installation) d
and use it to deploy the exporter. It also contains further configuration examples. and use it to deploy the exporter. It also contains further configuration examples.
Furthermore, this helm chart contains unit tests to detect regressions and stabilize the deployment. Additionally, this Furthermore, this helm chart contains unit tests to detect regressions and stabilize the deployment. Additionally, this
helm chart is tested for deployment scenarios with **ArgoCD**. helm chart is tested for deployment scenarios with **ArgoCD**, but please keep in mind, that this chart supports the
*[Automatically Roll Deployment](https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments)*
concept of Helm, which can trigger unexpected rolling releases. Further configuration instructions are described in a
separate [chapter](#argocd).
## Helm: configuration and installation ## Helm: configuration and installation
@@ -122,20 +125,6 @@ deployment:
secret.reloader.stakater.com/reload: "reposilite-tls" secret.reloader.stakater.com/reload: "reposilite-tls"
``` ```
If the application is rolled out using ArgoCD, a rolling update from stakater's
[reloader](https://github.com/stakater/Reloader) can lead to a drift. ArgoCD will attempt to restore the original state
with a rolling update. To avoid this, instead of a rolling update triggered by the reloader, a restart of the pod can be
initiated. Further information are available in the official
[README](https://github.com/stakater/Reloader?tab=readme-ov-file#4-%EF%B8%8F-workload-specific-rollout-strategy) of
stakater's reloader.
```diff
deployment:
annotations:
reloader.stakater.com/auto: "true"
+ reloader.stakater.com/rollout-strategy: "restart"
```
#### Network policies #### Network policies
Network policies can only take effect, when the used CNI plugin support network policies. The chart supports no custom Network policies can only take effect, when the used CNI plugin support network policies. The chart supports no custom
@@ -210,51 +199,31 @@ helm install --version "${CHART_VERSION}" reposilite volker.raschek/reposilite \
## ArgoCD ## ArgoCD
### Example Application ### Daily execution of rolling updates
An application resource for the Helm chart is defined below. It serves as an example for your own deployment. The behavior whereby ArgoCD triggers a rolling update even though nothing appears to have changed often occurs in
connection with the helm concept `checksum/secret`, `checksum/configmap` or more generally, [Automatically Roll
Deployments](https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments).
```yaml The problem with combining this concept with ArgoCD is that ArgoCD re-renders the Helm chart every time. Even if the
apiVersion: argoproj.io/v1alpha1 content of the config map or secret has not changed, there may be minimal differences (e.g., whitespace, chart version,
kind: Application Helm render order, different timestamps).
spec:
destination: This changes the SHA256 hash, Argo sees a drift and trigger a rolling update of the deployment. Among other things, this
server: https://kubernetes.default.svc can lead to unnecessary notifications from ArgoCD.
namespace: reposilite
ignoreDifferences: To avoid this, the annotation with the shasum must be ignored. Below is a diff that adds the `Application` to ignore all
- group: apps annotations with the prefix `checksum`.
kind: Deployment
jqPathExpressions: ```diff
# When HPA is enabled, ensure that a modification of the replicas does not lead to a apiVersion: argoproj.io/v1alpha1
# drift. kind: Application
- '.spec.replicas' spec:
# Ensure that changes of the annotations or environment variables added or modified by + ignoreDifferences:
# stakater's reloader does not lead to a drift. + - group: apps/v1
- '.spec.template.metadata.annotations | with_entries(select(.key | startswith("reloader")))' + kind: Deployment
- '.spec.template.spec.containers[].env[] | select(.name | startswith("STAKATER_"))' + jqPathExpressions:
sources: + - '.spec.template.metadata.annotations | with_entries(select(.key | startswith("checksum")))'
- repoURL: https://charts.cryptic.systems/volker.raschek
chart: reposilite
targetRevision: '0.*'
helm:
valueFiles:
- $values/values.yaml
releaseName: reposilite
syncPolicy:
automated:
prune: true
selfHeal: true
managedNamespaceMetadata:
annotations: {}
labels: {}
syncOptions:
- ApplyOutOfSyncOnly=true
- CreateNamespace=true
- FailOnSharedResource=false
- Replace=false
- RespectIgnoreDifferences=false
- ServerSideApply=true
- Validate=true
``` ```
## Parameters ## Parameters

View File

@@ -23,9 +23,7 @@
}, },
{ {
"customType": "regex", "customType": "regex",
"fileMatch": [ "fileMatch": ["^README\\.md$"],
"^README\\.md$"
],
"matchStrings": [ "matchStrings": [
"CHART_VERSION=(?<currentValue>.*)" "CHART_VERSION=(?<currentValue>.*)"
], ],
@@ -37,8 +35,8 @@
{ {
"customType": "regex", "customType": "regex",
"datasourceTemplate": "github-releases", "datasourceTemplate": "github-releases",
"fileMatch": [ "managerFilePatterns": [
".vscode/settings\\.json$" "/.vscode/settings\\.json$/"
], ],
"matchStrings": [ "matchStrings": [
"https:\\/\\/raw\\.githubusercontent\\.com\\/(?<depName>[^\\s]+?)\\/(?<currentValue>v[0-9.]+?)\\/schema\\/helm-testsuite\\.json" "https:\\/\\/raw\\.githubusercontent\\.com\\/(?<depName>[^\\s]+?)\\/(?<currentValue>v[0-9.]+?)\\/schema\\/helm-testsuite\\.json"
@@ -54,17 +52,12 @@
] ]
}, },
{ {
"automerge": true,
"groupName": "Update helm plugin 'unittest'", "groupName": "Update helm plugin 'unittest'",
"matchDepNames": [ "matchDepNames": [
"helm-unittest/helm-unittest" "helm-unittest/helm-unittest"
], ],
"matchDatasources": [ "matchDatasources": [
"github-releases" "github-releases"
],
"matchUpdateTypes": [
"minor",
"patch"
] ]
}, },
{ {

View File

@@ -14,6 +14,6 @@ metadata:
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }} name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
stringData: stringData:
password: {{ required "Password for basic auth is required!" .Values.prometheus.metrics.secret.new.basicAuthPassword }} password: {{ default (randAlphaNum 16) .Values.prometheus.metrics.secret.new.basicAuthPassword }}
username: {{ required "Username for basic auth is required!" .Values.prometheus.metrics.secret.new.basicAuthUsername }} username: {{ default (randAlphaNum 16) .Values.prometheus.metrics.secret.new.basicAuthUsername }}
{{- end }} {{- end }}

View File

@@ -13,8 +13,6 @@ tests:
set: set:
prometheus.metrics.enabled: true prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true prometheus.metrics.podMonitor.enabled: true
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
asserts: asserts:
- exists: - exists:
path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials

View File

@@ -13,8 +13,6 @@ tests:
set: set:
prometheus.metrics.enabled: true prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: true prometheus.metrics.serviceMonitor.enabled: true
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
asserts: asserts:
- exists: - exists:
path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials

View File

@@ -13,29 +13,9 @@ tests:
- hasDocuments: - hasDocuments:
count: 0 count: 0
- it: Throw error for missing basic auth password
set:
prometheus.metrics.enabled: true
# prometheus.metrics.secret.new.basicAuthPassword: "my-password"
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
asserts:
- failedTemplate:
errorMessage: "Password for basic auth is required!"
- it: Throw error for missing basic auth username
set:
prometheus.metrics.enabled: true
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
# prometheus.metrics.secret.new.basicAuthUsername: "my-username"
asserts:
- failedTemplate:
errorMessage: "Username for basic auth is required!"
- it: Rendering secret with default values. - it: Rendering secret with default values.
set: set:
prometheus.metrics.enabled: true prometheus.metrics.enabled: true
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
@@ -71,13 +51,13 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
- isSubset: - exists:
path: metadata.annotations path: metadata.annotations
content: value:
foo: bar foo: bar
- isSubset: - exists:
path: metadata.labels path: metadata.labels
content: value:
bar: foo bar: foo
- equal: - equal:
path: metadata.name path: metadata.name

View File

@@ -53,13 +53,13 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
- isSubset: - exists:
path: metadata.annotations path: metadata.annotations
content: value:
foo: bar foo: bar
- isSubset: - exists:
path: metadata.labels path: metadata.labels
content: value:
bar: foo bar: foo
- equal: - equal:
path: metadata.name path: metadata.name

View File

@@ -78,35 +78,35 @@ tests:
service.internalTrafficPolicy: "" service.internalTrafficPolicy: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: No internal traffic policy defined! errorMessage: No internal traffic policy defined!
- it: Require port. - it: Require port.
set: set:
service.port: "" service.port: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: No service port defined! errorMessage: No service port defined!
- it: Require scheme. - it: Require scheme.
set: set:
service.scheme: "" service.scheme: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: The scheme of the serviceMonitor is not defined! errorMessage: No service scheme defined!
- it: Require sessionAffinity. - it: Require sessionAffinity.
set: set:
service.sessionAffinity: "" service.sessionAffinity: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: No session affinity defined! errorMessage: No session affinity defined!
- it: Require service type. - it: Require service type.
set: set:
service.type: "" service.type: ""
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: No service type defined! errorMessage: No service type defined!
- it: Render service with custom annotations and labels. - it: Render service with custom annotations and labels.
set: set: