Compare commits

...

7 Commits

Author SHA1 Message Date
b73455b657 doc(values): add affinity example
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-01-04 21:54:50 +01:00
79062bc1c3 chore(deps): update docker.io/library/node docker tag to v23.5.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-20 17:23:19 +00:00
3b0a815203 chore(deps): update git.cryptic.systems/volker.raschek/helm docker tag to v3.16.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-17 11:27:45 +00:00
ffa8271684 chore(deps): update docker.io/library/node docker tag to v23.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-10 20:23:17 +00:00
f59f6aa94d doc(README): update parameters
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-12-06 23:58:57 +01:00
ce4065bda8 fix(deployment): template affinity
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-12-06 23:57:09 +01:00
1581617daf fix(deployment): number of replicas 2024-12-06 23:45:36 +01:00
6 changed files with 69 additions and 9 deletions

View File

@ -17,7 +17,7 @@ steps:
- name: helm lint - name: helm lint
commands: commands:
- helm lint - helm lint
image: git.cryptic.systems/volker.raschek/helm:3.16.3 image: git.cryptic.systems/volker.raschek/helm:3.16.4
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@ -69,7 +69,7 @@ steps:
- name: helm unittest - name: helm unittest
commands: commands:
- helm unittest --strict --file 'unittests/**/*.yaml' ./ - helm unittest --strict --file 'unittests/**/*.yaml' ./
image: git.cryptic.systems/volker.raschek/helm:3.16.3 image: git.cryptic.systems/volker.raschek/helm:3.16.4
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@ -124,7 +124,7 @@ steps:
- npm run readme:link - npm run readme:link
- npm run readme:lint - npm run readme:lint
- npm run readme:parameters - npm run readme:parameters
image: docker.io/library/node:23.3.0-alpine image: docker.io/library/node:23.5.0-alpine
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@ -187,7 +187,7 @@ steps:
from_secret: helm_repo_password from_secret: helm_repo_password
HELM_REPO_USERNAME: HELM_REPO_USERNAME:
from_secret: helm_repo_username from_secret: helm_repo_username
image: git.cryptic.systems/volker.raschek/helm:3.16.3 image: git.cryptic.systems/volker.raschek/helm:3.16.4
resources: resources:
limits: limits:
cpu: 150 cpu: 150

View File

@ -216,7 +216,7 @@ deployment:
| `deployment.postgresExporter.volumeMounts` | Additional volume mounts. | `[]` | | `deployment.postgresExporter.volumeMounts` | Additional volume mounts. | `[]` |
| `deployment.nodeSelector` | NodeSelector of the postgres-exporter deployment. | `{}` | | `deployment.nodeSelector` | NodeSelector of the postgres-exporter deployment. | `{}` |
| `deployment.priorityClassName` | PriorityClassName of the postgres-exporter deployment. | `""` | | `deployment.priorityClassName` | PriorityClassName of the postgres-exporter deployment. | `""` |
| `deployment.replicaCount` | Number of replicas for the postgres-exporter deployment. | `1` | | `deployment.replicas` | Number of replicas for the postgres-exporter deployment. | `1` |
| `deployment.restartPolicy` | Restart policy of the postgres-exporter deployment. | `""` | | `deployment.restartPolicy` | Restart policy of the postgres-exporter deployment. | `""` |
| `deployment.securityContext` | Security context of the postgres-exporter deployment. | `{}` | | `deployment.securityContext` | Security context of the postgres-exporter deployment. | `{}` |
| `deployment.strategy.type` | Strategy type - `Recreate` or `Rollingupdate`. | `Recreate` | | `deployment.strategy.type` | Strategy type - `Recreate` or `Rollingupdate`. | `Recreate` |

View File

@ -12,6 +12,7 @@ metadata:
name: {{ include "prometheus-postgres-exporter.fullname" . }} name: {{ include "prometheus-postgres-exporter.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
spec: spec:
replicas: {{ .Values.deployment.replicas }}
selector: selector:
matchLabels: matchLabels:
{{- include "prometheus-postgres-exporter.pod.selectorLabels" . | nindent 6 }} {{- include "prometheus-postgres-exporter.pod.selectorLabels" . | nindent 6 }}
@ -20,6 +21,10 @@ spec:
labels: labels:
{{- include "prometheus-postgres-exporter.pod.labels" . | nindent 8 }} {{- include "prometheus-postgres-exporter.pod.labels" . | nindent 8 }}
spec: spec:
{{- with .Values.deployment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
containers: containers:
- name: postgres-exporter - name: postgres-exporter
args: args:

View File

@ -27,6 +27,11 @@ tests:
app.kubernetes.io/name: prometheus-postgres-exporter app.kubernetes.io/name: prometheus-postgres-exporter
app.kubernetes.io/version: 0.1.0 app.kubernetes.io/version: 0.1.0
helm.sh/chart: prometheus-postgres-exporter-0.1.0 helm.sh/chart: prometheus-postgres-exporter-0.1.0
- equal:
path: spec.replicas
value: 1
- notExists:
path: spec.template.spec.affinity
- contains: - contains:
path: spec.template.spec.containers[0].envFrom path: spec.template.spec.containers[0].envFrom
content: content:
@ -91,6 +96,40 @@ tests:
- notExists: - notExists:
path: spec.template.spec.topologySpreadConstraints path: spec.template.spec.topologySpreadConstraints
- it: Test custom replicas
set:
deployment.replicas: 3
asserts:
- equal:
path: spec.replicas
value: 3
- it: Test custom affinity
set:
deployment.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
- it: Test additional arguments - it: Test additional arguments
set: set:
deployment.postgresExporter.args: deployment.postgresExporter.args:

View File

@ -259,7 +259,7 @@
"priorityClassName": { "priorityClassName": {
"type": "string" "type": "string"
}, },
"replicaCount": { "replicas": {
"type": "integer" "type": "integer"
}, },
"restartPolicy": { "restartPolicy": {
@ -326,7 +326,7 @@
"postgresExporter", "postgresExporter",
"nodeSelector", "nodeSelector",
"priorityClassName", "priorityClassName",
"replicaCount", "replicas",
"restartPolicy", "restartPolicy",
"securityContext", "securityContext",
"strategy", "strategy",

View File

@ -93,6 +93,22 @@ deployment:
## @param deployment.affinity Affinity for the postgres-exporter deployment. ## @param deployment.affinity Affinity for the postgres-exporter deployment.
affinity: {} affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
# preferredDuringSchedulingIgnoredDuringExecution:
# - weight: 20
# preference:
# matchExpressions:
# - key: kubernetes.io/arch
# operator: In
# values:
# - amd64
## @param deployment.initContainers List of additional init containers. ## @param deployment.initContainers List of additional init containers.
initContainers: [] initContainers: []
@ -198,8 +214,8 @@ deployment:
## @param deployment.priorityClassName PriorityClassName of the postgres-exporter deployment. ## @param deployment.priorityClassName PriorityClassName of the postgres-exporter deployment.
priorityClassName: "" priorityClassName: ""
## @param deployment.replicaCount Number of replicas for the postgres-exporter deployment. ## @param deployment.replicas Number of replicas for the postgres-exporter deployment.
replicaCount: 1 replicas: 1
## @param deployment.restartPolicy Restart policy of the postgres-exporter deployment. ## @param deployment.restartPolicy Restart policy of the postgres-exporter deployment.
restartPolicy: "" restartPolicy: ""