Skip to content

Commit 5858345

Browse files
authored
enable kiwigrid/k8s-sidecar in tests and configure health port (#597)
* ci: enable kiwigrid/k8s-sidecar in tests Signed-off-by: Tom Hayward <thayward@infoblox.com> * override kiwigrid/k8s-sidecar health port to avoid conflict and enable probes Signed-off-by: Tom Hayward <thayward@infoblox.com> --------- Signed-off-by: Tom Hayward <thayward@infoblox.com>
1 parent b52648b commit 5858345

9 files changed

Lines changed: 100 additions & 0 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
## master / unreleased
44

5+
* [ENHANCEMENT] enable readiness probe on kiwigrid/k8s-sidecar #597
56
* [DEPENDENCY] update kiwigrid/k8s-sidecar docker tag to v2.5.0 #568
67
* [DEPENDENCY] update memcached docker tag to v1.6.40 #580
78
* [DEPENDENCY] update prom/memcached-exporter docker tag to v0.15.5 #581
9+
* [BUGFIX] override kiwigrid/k8s-sidecar health port to avoid conflict #597
810

911
## 3.1.0 / 2026-02-24
1012

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,23 @@ Kubernetes: `^1.19.0-0`
141141
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;enabled | bool | `false` | Enable sidecar that collect the configmaps with specified label and stores the included files them into the respective folders |
142142
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folder | string | `"/data"` | Folder where the files should be placed. |
143143
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folderAnnotation | string | `"k8s-sidecar-target-directory"` | The annotation the sidecar will look for in ConfigMaps and/or Secrets to override the destination folder for files. If the value is a relative path, it will be relative to FOLDER |
144+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;healthPort | int | `8081` | The port the kiwigrid/k8s-sidecar listens on for health checks. The image default matches the cortex default listen port (8080), so it must be overridden here. |
144145
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"kiwigrid/k8s-sidecar"` | |
145146
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;sha | string | `""` | |
146147
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"2.5.0"` | |
147148
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;imagePullPolicy | string | `"IfNotPresent"` | |
148149
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;label | string | `"cortex_alertmanager"` | Label that should be used for filtering |
149150
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;labelValue | string | `""` | The value for the label you want to filter your resources on. Don't set a value to filter by any value |
151+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;readinessProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/healthz"` | |
152+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;readinessProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;port | string | `"sidecar-health"` | |
153+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;readinessProbe.&ZeroWidthSpace;periodSeconds | int | `5` | |
150154
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resource | string | `"both"` | The resource type that the operator will filter for. Can be configmap, secret or both |
151155
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resources | object | `{}` | |
152156
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;searchNamespace | string | `""` | The Namespace(s) from which resources will be watched. For multiple namespaces, use a comma-separated string like "default,test". If not set or set to ALL, it will watch all Namespaces. |
153157
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;skipTlsVerify | bool | `false` | Set to true to skip tls verification for kube api calls |
158+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/healthz"` | |
159+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;port | string | `"sidecar-health"` | |
160+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;periodSeconds | int | `5` | |
154161
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;watchMethod | string | `""` | Determines how kopf-k8s-sidecar will run. If WATCH it will run like a normal operator forever. If LIST it will gather the matching configmaps and secrets currently present, write those files to the destination directory and die |
155162
| alertmanager.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;failureThreshold | int | `10` | |
156163
| alertmanager.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/ready"` | |
@@ -827,16 +834,23 @@ Kubernetes: `^1.19.0-0`
827834
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;enabled | bool | `false` | Enable sidecar that collect the configmaps with specified label and stores the included files them into the respective folders |
828835
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folder | string | `"/data/rules"` | Folder where the files should be placed. |
829836
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folderAnnotation | string | `"k8s-sidecar-target-directory"` | The annotation the sidecar will look for in ConfigMaps and/or Secrets to override the destination folder for files. If the value is a relative path, it will be relative to FOLDER |
837+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;healthPort | int | `8081` | The port the kiwigrid/k8s-sidecar listens on for health checks. The image default matches the cortex default listen port (8080), so it must be overridden here. |
830838
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"kiwigrid/k8s-sidecar"` | |
831839
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;sha | string | `""` | |
832840
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"2.5.0"` | |
833841
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;imagePullPolicy | string | `"IfNotPresent"` | |
834842
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;label | string | `"cortex_rules"` | label that the configmaps with rules are marked with |
835843
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;labelValue | string | `""` | The value for the label you want to filter your resources on. Don't set a value to filter by any value |
844+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;readinessProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/healthz"` | |
845+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;readinessProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;port | string | `"sidecar-health"` | |
846+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;readinessProbe.&ZeroWidthSpace;periodSeconds | int | `5` | |
836847
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resource | string | `"both"` | The resource type that the operator will filter for. Can be configmap, secret or both |
837848
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resources | object | `{}` | |
838849
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;searchNamespace | string | `""` | The Namespace(s) from which resources will be watched. For multiple namespaces, use a comma-separated string like "default,test". If not set or set to ALL, it will watch all Namespaces. |
839850
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;skipTlsVerify | bool | `false` | Set to true to skip tls verification for kube api calls |
851+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/healthz"` | |
852+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;port | string | `"sidecar-health"` | |
853+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;periodSeconds | int | `5` | |
840854
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;watchMethod | string | `""` | Determines how kopf-k8s-sidecar will run. If WATCH it will run like a normal operator forever. If LIST it will gather the matching configmaps and secrets currently present, write those files to the destination directory and die |
841855
| ruler.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;failureThreshold | int | `10` | |
842856
| ruler.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/ready"` | |

ci/test-configmap-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ alertmanager:
127127
extraVolumeMounts:
128128
- name: tmp-test
129129
mountPath: /tmp-test
130+
sidecar:
131+
enabled: true
130132
ruler:
131133
replicas: 1
132134
enabled: true
@@ -136,6 +138,8 @@ ruler:
136138
extraVolumeMounts:
137139
- name: tmp-test
138140
mountPath: /tmp-test
141+
sidecar:
142+
enabled: true
139143
store_gateway:
140144
startupProbe: null
141145
replicas: 1

ci/test-deployment-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ alertmanager:
134134
extraVolumeMounts:
135135
- name: tmp-test
136136
mountPath: /tmp-test
137+
sidecar:
138+
enabled: true
137139
ruler:
138140
replicas: 1
139141
enabled: true
@@ -143,6 +145,8 @@ ruler:
143145
extraVolumeMounts:
144146
- name: tmp-test
145147
mountPath: /tmp-test
148+
sidecar:
149+
enabled: true
146150
store_gateway:
147151
startupProbe: null
148152
replicas: 1

ci/test-sts-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ alertmanager:
125125
extraVolumeMounts:
126126
- name: tmp-test
127127
mountPath: /tmp-test
128+
sidecar:
129+
enabled: true
128130
ruler:
129131
replicas: 1
130132
enabled: true
@@ -134,6 +136,8 @@ ruler:
134136
extraVolumeMounts:
135137
- name: tmp-test
136138
mountPath: /tmp-test
139+
sidecar:
140+
enabled: true
137141
store_gateway:
138142
startupProbe: null
139143
replicas: 1

templates/alertmanager/alertmanager-dep.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ spec:
8888
- name: FOLDER_ANNOTATION
8989
value: "{{ .Values.alertmanager.sidecar.folderAnnotation }}"
9090
{{- end }}
91+
{{- with .Values.alertmanager.sidecar.healthPort }}
92+
- name: HEALTH_PORT
93+
value: "{{ . }}"
94+
ports:
95+
- name: sidecar-health
96+
containerPort: {{ . }}
97+
protocol: TCP
98+
{{- end }}
99+
{{- with .Values.alertmanager.sidecar.startupProbe }}
100+
startupProbe:
101+
{{- toYaml . | nindent 12 }}
102+
{{- end }}
103+
{{- with .Values.alertmanager.sidecar.readinessProbe }}
104+
readinessProbe:
105+
{{- toYaml . | nindent 12 }}
106+
{{- end }}
91107
resources:
92108
{{- toYaml .Values.alertmanager.sidecar.resources | nindent 12 }}
93109
{{- if .Values.alertmanager.sidecar.containerSecurityContext.enabled }}

templates/alertmanager/alertmanager-statefulset.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,22 @@ spec:
145145
- name: FOLDER_ANNOTATION
146146
value: "{{ .Values.alertmanager.sidecar.folderAnnotation }}"
147147
{{- end }}
148+
{{- with .Values.alertmanager.sidecar.healthPort }}
149+
- name: HEALTH_PORT
150+
value: "{{ . }}"
151+
ports:
152+
- name: sidecar-health
153+
containerPort: {{ . }}
154+
protocol: TCP
155+
{{- end }}
156+
{{- with .Values.alertmanager.sidecar.startupProbe }}
157+
startupProbe:
158+
{{- toYaml . | nindent 12 }}
159+
{{- end }}
160+
{{- with .Values.alertmanager.sidecar.readinessProbe }}
161+
readinessProbe:
162+
{{- toYaml . | nindent 12 }}
163+
{{- end }}
148164
resources:
149165
{{- toYaml .Values.alertmanager.sidecar.resources | nindent 12 }}
150166
{{- if .Values.alertmanager.sidecar.containerSecurityContext.enabled }}

templates/ruler/ruler-dep.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@ spec:
9090
- name: FOLDER_ANNOTATION
9191
value: "{{ .Values.ruler.sidecar.folderAnnotation }}"
9292
{{- end }}
93+
{{- with .Values.ruler.sidecar.healthPort }}
94+
- name: HEALTH_PORT
95+
value: "{{ . }}"
96+
ports:
97+
- name: sidecar-health
98+
containerPort: {{ . }}
99+
protocol: TCP
100+
{{- end }}
101+
{{- with .Values.ruler.sidecar.startupProbe }}
102+
startupProbe:
103+
{{- toYaml . | nindent 12 }}
104+
{{- end }}
105+
{{- with .Values.ruler.sidecar.readinessProbe }}
106+
readinessProbe:
107+
{{- toYaml . | nindent 12 }}
108+
{{- end }}
93109
resources:
94110
{{- toYaml .Values.ruler.sidecar.resources | nindent 12 }}
95111
{{- if .Values.ruler.containerSecurityContext.enabled }}

values.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,18 @@ alertmanager:
317317
containerSecurityContext:
318318
enabled: true
319319
readOnlyRootFilesystem: true
320+
# -- The port the kiwigrid/k8s-sidecar listens on for health checks. The image default matches the cortex default listen port (8080), so it must be overridden here.
321+
healthPort: 8081
322+
startupProbe:
323+
httpGet:
324+
path: /healthz
325+
port: sidecar-health
326+
periodSeconds: 5
327+
readinessProbe:
328+
httpGet:
329+
path: /healthz
330+
port: sidecar-health
331+
periodSeconds: 5
320332

321333
distributor:
322334
enabled: true
@@ -734,6 +746,18 @@ ruler:
734746
containerSecurityContext:
735747
enabled: true
736748
readOnlyRootFilesystem: true
749+
# -- The port the kiwigrid/k8s-sidecar listens on for health checks. The image default matches the cortex default listen port (8080), so it must be overridden here.
750+
healthPort: 8081
751+
startupProbe:
752+
httpGet:
753+
path: /healthz
754+
port: sidecar-health
755+
periodSeconds: 5
756+
readinessProbe:
757+
httpGet:
758+
path: /healthz
759+
port: sidecar-health
760+
periodSeconds: 5
737761

738762
querier:
739763
enabled: true

0 commit comments

Comments
 (0)