Skip to content

Commit 54ee3d9

Browse files
authored
move from quay.io/kiwigrid/k8s-sidecar to omegavvweapon/kopf-k8s-side… (#302)
* move from quay.io/kiwigrid/k8s-sidecar to omegavvweapon/kopf-k8s-sidecar and update documentation Signed-off-by: ShuzZzle <[email protected]> * add changelog Signed-off-by: ShuzZzle <[email protected]> * use empty quotes instead of null add resource var to values.yaml Signed-off-by: ShuzZzle <[email protected]>
1 parent dc0a068 commit 54ee3d9

File tree

7 files changed

+110
-48
lines changed

7 files changed

+110
-48
lines changed

CHANGELOG.md

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

33
## master / unreleased
44

5+
* [CHANGE] move from quay.io/kiwigrid/k8s-sidecar to omegavvweapon/kopf-k8s-sidecar image #302
6+
57
## 1.2.0 / 2021-12-29
68

79
* [CHANGE] Use port number for prometheus port annotations. #288

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,24 @@ Kubernetes: `^1.19.0-0`
135135
| alertmanager.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;extraEndpointSpec | object | `{}` | Additional endpoint configuration https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#endpoint |
136136
| alertmanager.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;metricRelabelings | list | `[]` | |
137137
| alertmanager.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;relabelings | list | `[]` | |
138-
| alertmanager.&ZeroWidthSpace;sidecar | object | `{"containerSecurityContext":{"enabled":true,"readOnlyRootFilesystem":true},"defaultFolderName":null,"enableUniqueFilenames":false,"enabled":false,"folder":"/data","folderAnnotation":null,"image":{"repository":"quay.io/kiwigrid/k8s-sidecar","sha":"","tag":"1.10.7"},"imagePullPolicy":"IfNotPresent","label":"cortex_alertmanager","labelValue":null,"resources":{},"searchNamespace":null,"skipTlsVerify":false,"watchMethod":null}` | Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders |
139-
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;skipTlsVerify | bool | `false` | skipTlsVerify Set to true to skip tls verification for kube api calls |
138+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;containerSecurityContext.&ZeroWidthSpace;enabled | bool | `true` | |
139+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;containerSecurityContext.&ZeroWidthSpace;readOnlyRootFilesystem | bool | `true` | |
140+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;defaultFolderName | string | `""` | The default folder name, it will create a subfolder under the `folder` and put rules in there instead |
141+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;enableUniqueFilenames | bool | `false` | A value of true will produce unique filenames to avoid issues when duplicate data keys exist between ConfigMaps and/or Secrets within the same or multiple Namespaces. |
142+
| 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 |
143+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folder | string | `"/data"` | Folder where the files should be placed. |
144+
| 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 |
145+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"omegavveapon/kopf-k8s-sidecar"` | |
146+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;sha | string | `""` | |
147+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"1.4.0"` | |
148+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;imagePullPolicy | string | `"IfNotPresent"` | |
149+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;label | string | `"cortex_alertmanager"` | Label that should be used for filtering |
150+
| 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;resource | string | `"both"` | The resource type that the operator will filter for. Can be configmap, secret or both |
152+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resources | object | `{}` | |
153+
| 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. |
154+
| alertmanager.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;skipTlsVerify | bool | `false` | Set to true to skip tls verification for kube api calls |
155+
| 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 |
140156
| alertmanager.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;failureThreshold | int | `10` | |
141157
| alertmanager.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/ready"` | |
142158
| alertmanager.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;port | string | `"http-metrics"` | |
@@ -637,13 +653,24 @@ Kubernetes: `^1.19.0-0`
637653
| ruler.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;extraEndpointSpec | object | `{}` | Additional endpoint configuration https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#endpoint |
638654
| ruler.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;metricRelabelings | list | `[]` | |
639655
| ruler.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;relabelings | list | `[]` | |
640-
| ruler.&ZeroWidthSpace;sidecar | object | `{"containerSecurityContext":{"enabled":true,"readOnlyRootFilesystem":true},"defaultFolderName":null,"enableUniqueFilenames":false,"enabled":false,"folder":"/tmp/rules","folderAnnotation":null,"image":{"repository":"quay.io/kiwigrid/k8s-sidecar","sha":"","tag":"1.10.7"},"imagePullPolicy":"IfNotPresent","label":"cortex_rules","labelValue":null,"resources":{},"searchNamespace":null,"watchMethod":null}` | Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders |
641-
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;defaultFolderName | string | `nil` | The default folder name, it will create a subfolder under the `folder` and put rules in there instead |
642-
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folder | string | `"/tmp/rules"` | folder in the pod that should hold the collected rules (unless `defaultFolderName` is set) |
643-
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folderAnnotation | string | `nil` | If specified, the sidecar will look for annotation with this name to create folder and put graph here. You can use this parameter together with `provider.foldersFromFilesStructure`to annotate configmaps and create folder structure. |
656+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;containerSecurityContext.&ZeroWidthSpace;enabled | bool | `true` | |
657+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;containerSecurityContext.&ZeroWidthSpace;readOnlyRootFilesystem | bool | `true` | |
658+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;defaultFolderName | string | `""` | The default folder name, it will create a subfolder under the `folder` and put rules in there instead |
659+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;enableUniqueFilenames | bool | `false` | A value of true will produce unique filenames to avoid issues when duplicate data keys exist between ConfigMaps and/or Secrets within the same or multiple Namespaces. |
660+
| 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 |
661+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;folder | string | `"/tmp/rules"` | Folder where the files should be placed. |
662+
| 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 |
663+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"omegavveapon/kopf-k8s-sidecar"` | |
664+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;sha | string | `""` | |
665+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"1.4.0"` | |
666+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;imagePullPolicy | string | `"IfNotPresent"` | |
644667
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;label | string | `"cortex_rules"` | label that the configmaps with rules are marked with |
645-
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;labelValue | string | `nil` | value of label that the configmaps with rules are set to |
646-
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;searchNamespace | string | `nil` | If specified, the sidecar will search for rules config-maps inside this namespace. Otherwise the namespace in which the sidecar is running will be used. It's also possible to specify ALL to search in all namespaces |
668+
| 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 |
669+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resource | string | `"both"` | The resource type that the operator will filter for. Can be configmap, secret or both |
670+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;resources | object | `{}` | |
671+
| 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. |
672+
| ruler.&ZeroWidthSpace;sidecar.&ZeroWidthSpace;skipTlsVerify | bool | `false` | Set to true to skip tls verification for kube api calls |
673+
| 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 |
647674
| ruler.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;failureThreshold | int | `10` | |
648675
| ruler.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;path | string | `"/ready"` | |
649676
| ruler.&ZeroWidthSpace;startupProbe.&ZeroWidthSpace;httpGet.&ZeroWidthSpace;port | string | `"http-metrics"` | |

docs/guides/configure_rules_via_sidecar.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Cortex can be configured to use a sidecar container in the Ruler and AlertManage
1010
Put ConfigMaps into the specified namespace, and they are automatically detected and added as files to the Ruler and/or AlertManager containers, both of which are polling for changes on the filesystem and will make the new configurations go live dynamically.
1111
This feature is disabled by default. Here is a simple example:
1212

13+
*Please not that this is only supported with the local or filesystem backend. Otherwise cortex will overwrite what the operator puts in the folder with what is in s3/gcs/azure/swift. Cortex does not 2-way sync the files*
14+
15+
```yaml
16+
backend: "filesystem"
17+
```
18+
19+
## Helm values config
20+
1321
```yaml
1422
ruler:
1523
sidecar:

templates/alertmanager/alertmanager-dep.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ spec:
6868
{{- end }}
6969
- name: FOLDER
7070
value: "{{ .Values.alertmanager.sidecar.folder }}{{- with .Values.alertmanager.sidecar.defaultFolderName }}/{{ . }}{{- end }}"
71+
{{- if .Values.alertmanager.sidecar.resource}}
7172
- name: RESOURCE
72-
value: "both"
73+
value: {{ quote .Values.alertmanager.sidecar.resource }}
74+
{{- end }}
7375
{{- if .Values.alertmanager.sidecar.enableUniqueFilenames }}
7476
- name: UNIQUE_FILENAMES
7577
value: "{{ .Values.alertmanager.sidecar.enableUniqueFilenames }}"
@@ -85,7 +87,7 @@ spec:
8587
{{- if .Values.alertmanager.sidecar.folderAnnotation }}
8688
- name: FOLDER_ANNOTATION
8789
value: "{{ .Values.alertmanager.sidecar.folderAnnotation }}"
88-
{{- end }}
90+
{{- end }}
8991
resources:
9092
{{- toYaml .Values.alertmanager.sidecar.resources | nindent 12 }}
9193
{{- if .Values.alertmanager.sidecar.containerSecurityContext.enabled }}

templates/alertmanager/alertmanager-statefulset.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ spec:
113113
{{- end }}
114114
- name: FOLDER
115115
value: "{{ .Values.alertmanager.sidecar.folder }}{{- with .Values.alertmanager.sidecar.defaultFolderName }}/{{ . }}{{- end }}"
116+
{{- if .Values.alertmanager.sidecar.resource}}
116117
- name: RESOURCE
117-
value: "both"
118+
value: {{ quote .Values.alertmanager.sidecar.resource }}
119+
{{- end }}
118120
{{- if .Values.alertmanager.sidecar.enableUniqueFilenames }}
119121
- name: UNIQUE_FILENAMES
120122
value: "{{ .Values.alertmanager.sidecar.enableUniqueFilenames }}"
@@ -130,7 +132,7 @@ spec:
130132
{{- if .Values.alertmanager.sidecar.folderAnnotation }}
131133
- name: FOLDER_ANNOTATION
132134
value: "{{ .Values.alertmanager.sidecar.folderAnnotation }}"
133-
{{- end }}
135+
{{- end }}
134136
resources:
135137
{{- toYaml .Values.alertmanager.sidecar.resources | nindent 12 }}
136138
{{- if .Values.alertmanager.sidecar.containerSecurityContext.enabled }}

templates/ruler/ruler-dep.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ spec:
6767
{{- end }}
6868
- name: FOLDER
6969
value: "{{ .Values.ruler.sidecar.folder }}{{- with .Values.ruler.sidecar.defaultFolderName }}/{{ . }}{{- end }}"
70+
{{- if .Values.ruler.sidecar.resource}}
7071
- name: RESOURCE
71-
value: "both"
72+
value: {{ quote .Values.ruler.sidecar.resource }}
73+
{{- end }}
7274
{{- if .Values.ruler.sidecar.enableUniqueFilenames }}
7375
- name: UNIQUE_FILENAMES
7476
value: "{{ .Values.ruler.sidecar.enableUniqueFilenames }}"
@@ -84,7 +86,7 @@ spec:
8486
{{- if .Values.ruler.sidecar.folderAnnotation }}
8587
- name: FOLDER_ANNOTATION
8688
value: "{{ .Values.ruler.sidecar.folderAnnotation }}"
87-
{{- end }}
89+
{{- end }}
8890
resources:
8991
{{- toYaml .Values.ruler.sidecar.resources | nindent 12 }}
9092
{{- if .Values.ruler.containerSecurityContext.enabled }}

values.yaml

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -292,25 +292,42 @@ alertmanager:
292292
# -- Extra env variables to pass to the cortex container
293293
env: []
294294

295-
# -- Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders
296295
sidecar:
296+
# -- Enable sidecar that collect the configmaps with specified label and stores the included files them into the respective folders
297+
enabled: false
297298
image:
298-
repository: quay.io/kiwigrid/k8s-sidecar
299-
tag: 1.10.7
299+
repository: omegavveapon/kopf-k8s-sidecar
300+
tag: 1.4.0
300301
sha: ""
301302
imagePullPolicy: IfNotPresent
302303
resources: {}
303-
# -- skipTlsVerify Set to true to skip tls verification for kube api calls
304+
# -- Set to true to skip tls verification for kube api calls
304305
skipTlsVerify: false
306+
# -- A value of true will produce unique filenames to avoid issues when duplicate data keys exist between ConfigMaps
307+
# and/or Secrets within the same or multiple Namespaces.
305308
enableUniqueFilenames: false
306-
enabled: false
309+
# -- Label that should be used for filtering
307310
label: cortex_alertmanager
308-
watchMethod: null
309-
labelValue: null
311+
# -- Determines how kopf-k8s-sidecar will run. If WATCH it will run like a normal operator forever.
312+
# If LIST it will gather the matching configmaps and secrets currently present,
313+
# write those files to the destination directory and die
314+
watchMethod: ""
315+
# -- The value for the label you want to filter your resources on.
316+
# Don't set a value to filter by any value
317+
labelValue: ""
318+
# -- Folder where the files should be placed.
310319
folder: /data
311-
defaultFolderName: null
312-
searchNamespace: null
313-
folderAnnotation: null
320+
# -- The default folder name, it will create a subfolder under the `folder` and put rules in there instead
321+
defaultFolderName: ""
322+
# -- The Namespace(s) from which resources will be watched.
323+
# For multiple namespaces, use a comma-separated string like "default,test".
324+
# If not set or set to ALL, it will watch all Namespaces.
325+
searchNamespace: ""
326+
# -- The annotation the sidecar will look for in ConfigMaps and/or Secrets to override the destination folder for files.
327+
# If the value is a relative path, it will be relative to FOLDER
328+
folderAnnotation: "k8s-sidecar-target-directory"
329+
# -- The resource type that the operator will filter for. Can be configmap, secret or both
330+
resource: "both"
314331
containerSecurityContext:
315332
enabled: true
316333
readOnlyRootFilesystem: true
@@ -655,40 +672,42 @@ ruler:
655672
# -- allow configuring rules via configmap. ref: https://cortexproject.github.io/cortex-helm-chart/guides/configure_rules_via_configmap.html
656673
directories: {}
657674

658-
# -- Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders
659675
sidecar:
676+
# -- Enable sidecar that collect the configmaps with specified label and stores the included files them into the respective folders
677+
enabled: false
660678
image:
661-
repository: quay.io/kiwigrid/k8s-sidecar
662-
tag: 1.10.7
679+
repository: omegavveapon/kopf-k8s-sidecar
680+
tag: 1.4.0
663681
sha: ""
664682
imagePullPolicy: IfNotPresent
665683
resources: {}
666-
# limits:
667-
# cpu: 100m
668-
# memory: 100Mi
669-
# requests:
670-
# cpu: 50m
671-
# memory: 50Mi
672-
# skipTlsVerify Set to true to skip tls verification for kube api calls
673-
# skipTlsVerify: true
684+
# -- Set to true to skip tls verification for kube api calls
685+
skipTlsVerify: false
686+
# -- A value of true will produce unique filenames to avoid issues when duplicate data keys exist between ConfigMaps
687+
# and/or Secrets within the same or multiple Namespaces.
674688
enableUniqueFilenames: false
675-
enabled: false
676689
# -- label that the configmaps with rules are marked with
677690
label: cortex_rules
678-
watchMethod: null
679-
# -- value of label that the configmaps with rules are set to
680-
labelValue: null
681-
# -- folder in the pod that should hold the collected rules (unless `defaultFolderName` is set)
691+
# -- Determines how kopf-k8s-sidecar will run. If WATCH it will run like a normal operator forever.
692+
# If LIST it will gather the matching configmaps and secrets currently present,
693+
# write those files to the destination directory and die
694+
watchMethod: ""
695+
# -- The value for the label you want to filter your resources on.
696+
# Don't set a value to filter by any value
697+
labelValue: ""
698+
# -- Folder where the files should be placed.
682699
folder: /tmp/rules
683700
# -- The default folder name, it will create a subfolder under the `folder` and put rules in there instead
684-
defaultFolderName: null
685-
# -- If specified, the sidecar will search for rules config-maps inside this namespace.
686-
# Otherwise the namespace in which the sidecar is running will be used.
687-
# It's also possible to specify ALL to search in all namespaces
688-
searchNamespace: null
689-
# -- If specified, the sidecar will look for annotation with this name to create folder and put graph here.
690-
# You can use this parameter together with `provider.foldersFromFilesStructure`to annotate configmaps and create folder structure.
691-
folderAnnotation: null
701+
defaultFolderName: ""
702+
# -- The Namespace(s) from which resources will be watched.
703+
# For multiple namespaces, use a comma-separated string like "default,test".
704+
# If not set or set to ALL, it will watch all Namespaces.
705+
searchNamespace: ""
706+
# -- The annotation the sidecar will look for in ConfigMaps and/or Secrets to override the destination folder for files.
707+
# If the value is a relative path, it will be relative to FOLDER
708+
folderAnnotation: "k8s-sidecar-target-directory"
709+
# -- The resource type that the operator will filter for. Can be configmap, secret or both
710+
resource: "both"
692711
containerSecurityContext:
693712
enabled: true
694713
readOnlyRootFilesystem: true

0 commit comments

Comments
 (0)