You've already forked reposilite-charts
Compare commits
9 Commits
85e2f9607c
...
1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
0dd267a0df
|
|||
|
d790cd3ec4
|
|||
|
d2c329e1be
|
|||
|
db5e38cef1
|
|||
|
1fe7bc604e
|
|||
|
fa43188e03
|
|||
|
99ed88068a
|
|||
|
95fd713da6
|
|||
|
671a635627
|
85
README.md
85
README.md
@@ -16,10 +16,7 @@ Chapter [configuration and installation](#helm-configuration-and-installation) d
|
||||
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
|
||||
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 chart is tested for deployment scenarios with **ArgoCD**.
|
||||
|
||||
## Helm: configuration and installation
|
||||
|
||||
@@ -125,6 +122,20 @@ deployment:
|
||||
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 can only take effect, when the used CNI plugin support network policies. The chart supports no custom
|
||||
@@ -199,31 +210,51 @@ helm install --version "${CHART_VERSION}" reposilite volker.raschek/reposilite \
|
||||
|
||||
## ArgoCD
|
||||
|
||||
### Daily execution of rolling updates
|
||||
### Example Application
|
||||
|
||||
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).
|
||||
An application resource for the Helm chart is defined below. It serves as an example for your own deployment.
|
||||
|
||||
The problem with combining this concept with ArgoCD is that ArgoCD re-renders the Helm chart every time. Even if the
|
||||
content of the config map or secret has not changed, there may be minimal differences (e.g., whitespace, chart version,
|
||||
Helm render order, different timestamps).
|
||||
|
||||
This changes the SHA256 hash, Argo sees a drift and trigger a rolling update of the deployment. Among other things, this
|
||||
can lead to unnecessary notifications from ArgoCD.
|
||||
|
||||
To avoid this, the annotation with the shasum must be ignored. Below is a diff that adds the `Application` to ignore all
|
||||
annotations with the prefix `checksum`.
|
||||
|
||||
```diff
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
spec:
|
||||
+ ignoreDifferences:
|
||||
+ - group: apps/v1
|
||||
+ kind: Deployment
|
||||
+ jqPathExpressions:
|
||||
+ - '.spec.template.metadata.annotations | with_entries(select(.key | startswith("checksum")))'
|
||||
```yaml
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
spec:
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: reposilite
|
||||
ignoreDifferences:
|
||||
- group: apps
|
||||
kind: Deployment
|
||||
jqPathExpressions:
|
||||
# When HPA is enabled, ensure that a modification of the replicas does not lead to a
|
||||
# drift.
|
||||
- '.spec.replicas'
|
||||
# Ensure that changes of the annotations or environment variables added or modified by
|
||||
# stakater's reloader does not lead to a drift.
|
||||
- '.spec.template.metadata.annotations | with_entries(select(.key | startswith("reloader")))'
|
||||
- '.spec.template.spec.containers[].env[] | select(.name | startswith("STAKATER_"))'
|
||||
sources:
|
||||
- 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
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
},
|
||||
{
|
||||
"customType": "regex",
|
||||
"fileMatch": ["^README\\.md$"],
|
||||
"fileMatch": [
|
||||
"^README\\.md$"
|
||||
],
|
||||
"matchStrings": [
|
||||
"CHART_VERSION=(?<currentValue>.*)"
|
||||
],
|
||||
@@ -31,6 +33,16 @@
|
||||
"packageNameTemplate": "https://git.cryptic.systems/volker.raschek/reposilite-charts",
|
||||
"datasourceTemplate": "git-tags",
|
||||
"versioningTemplate": "semver"
|
||||
},
|
||||
{
|
||||
"customType": "regex",
|
||||
"datasourceTemplate": "github-releases",
|
||||
"fileMatch": [
|
||||
".vscode/settings\\.json$"
|
||||
],
|
||||
"matchStrings": [
|
||||
"https:\\/\\/raw\\.githubusercontent\\.com\\/(?<depName>[^\\s]+?)\\/(?<currentValue>v[0-9.]+?)\\/schema\\/helm-testsuite\\.json"
|
||||
]
|
||||
}
|
||||
],
|
||||
"packageRules": [
|
||||
@@ -41,6 +53,20 @@
|
||||
"volkerraschek/helm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"automerge": true,
|
||||
"groupName": "Update helm plugin 'unittest'",
|
||||
"matchDepNames": [
|
||||
"helm-unittest/helm-unittest"
|
||||
],
|
||||
"matchDatasources": [
|
||||
"github-releases"
|
||||
],
|
||||
"matchUpdateTypes": [
|
||||
"minor",
|
||||
"patch"
|
||||
]
|
||||
},
|
||||
{
|
||||
"groupName": "Update docker.io/library/node",
|
||||
"matchDepNames": [
|
||||
@@ -92,4 +118,4 @@
|
||||
],
|
||||
"executionMode": "update"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,6 @@ metadata:
|
||||
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
stringData:
|
||||
password: {{ default (randAlphaNum 16) .Values.prometheus.metrics.secret.new.basicAuthPassword }}
|
||||
username: {{ default (randAlphaNum 16) .Values.prometheus.metrics.secret.new.basicAuthUsername }}
|
||||
password: {{ required "Password for basic auth is required!" .Values.prometheus.metrics.secret.new.basicAuthPassword }}
|
||||
username: {{ required "Username for basic auth is required!" .Values.prometheus.metrics.secret.new.basicAuthUsername }}
|
||||
{{- end }}
|
||||
|
||||
@@ -13,6 +13,8 @@ tests:
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.podMonitor.enabled: true
|
||||
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
|
||||
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
|
||||
asserts:
|
||||
- exists:
|
||||
path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials
|
||||
|
||||
@@ -13,6 +13,8 @@ tests:
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.serviceMonitor.enabled: true
|
||||
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
|
||||
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
|
||||
asserts:
|
||||
- exists:
|
||||
path: spec.template.metadata.annotations.checksum/secret-reposilite-unittest-basic-auth-credentials
|
||||
|
||||
@@ -13,9 +13,29 @@ tests:
|
||||
- hasDocuments:
|
||||
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.
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.secret.new.basicAuthPassword: "my-password"
|
||||
prometheus.metrics.secret.new.basicAuthUsername: "my-username"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
@@ -51,13 +71,13 @@ tests:
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
- isSubset:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
content:
|
||||
foo: bar
|
||||
- exists:
|
||||
- isSubset:
|
||||
path: metadata.labels
|
||||
value:
|
||||
content:
|
||||
bar: foo
|
||||
- equal:
|
||||
path: metadata.name
|
||||
|
||||
@@ -53,13 +53,13 @@ tests:
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
- isSubset:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
content:
|
||||
foo: bar
|
||||
- exists:
|
||||
- isSubset:
|
||||
path: metadata.labels
|
||||
value:
|
||||
content:
|
||||
bar: foo
|
||||
- equal:
|
||||
path: metadata.name
|
||||
|
||||
@@ -78,35 +78,35 @@ tests:
|
||||
service.internalTrafficPolicy: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: No internal traffic policy defined!
|
||||
errorMessage: No internal traffic policy defined!
|
||||
|
||||
- it: Require port.
|
||||
set:
|
||||
service.port: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: No service port defined!
|
||||
errorMessage: No service port defined!
|
||||
|
||||
- it: Require scheme.
|
||||
set:
|
||||
service.scheme: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: No service scheme defined!
|
||||
errorMessage: The scheme of the serviceMonitor is not defined!
|
||||
|
||||
- it: Require sessionAffinity.
|
||||
set:
|
||||
service.sessionAffinity: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: No session affinity defined!
|
||||
errorMessage: No session affinity defined!
|
||||
|
||||
- it: Require service type.
|
||||
set:
|
||||
service.type: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: No service type defined!
|
||||
errorMessage: No service type defined!
|
||||
|
||||
- it: Render service with custom annotations and labels.
|
||||
set:
|
||||
|
||||
Reference in New Issue
Block a user