diff --git a/CHANGELOG.md b/CHANGELOG.md index 66ba48b6..3b47f0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master / unreleased +* [ENHANCEMENT] Make `extraPorts` work for all components: the ports are added to the cortex container and exposed on the component services #409 + ## 3.7.0 / 2026-11-20 * [ENHANCEMENT] Render `podAnnotations` with `tpl`, so the default `prometheus.io/port` annotations follow `config.server.http_listen_port` #410 diff --git a/README.md b/README.md index d685180f..4277e3e1 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Kubernetes: `^1.19.0-0` | alertmanager.​env | list | `[]` | Extra env variables to pass to the cortex container | | alertmanager.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log level (debug, info, warn, error) | | alertmanager.​extraContainers | list | `[]` | Additional containers to be added to the cortex pod. | -| alertmanager.​extraPorts | list | `[]` | Additional ports to the cortex services. Useful to expose extra container ports. | +| alertmanager.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | alertmanager.​extraVolumeMounts | list | `[]` | Extra volume mounts that will be added to the cortex container | | alertmanager.​extraVolumes | list | `[]` | Additional volumes to the cortex pod. | | alertmanager.​initContainers | list | `[]` | Init containers to be added to the cortex pod. | @@ -187,7 +187,7 @@ Kubernetes: `^1.19.0-0` | compactor.​env | list | `[]` | | | compactor.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | compactor.​extraContainers | list | `[]` | | -| compactor.​extraPorts | list | `[]` | | +| compactor.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | compactor.​extraVolumeMounts | list | `[]` | | | compactor.​extraVolumes | list | `[]` | | | compactor.​initContainers | list | `[]` | | @@ -282,7 +282,7 @@ Kubernetes: `^1.19.0-0` | distributor.​env | list | `[]` | | | distributor.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | distributor.​extraContainers | list | `[]` | | -| distributor.​extraPorts | list | `[]` | | +| distributor.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | distributor.​extraVolumeMounts | list | `[]` | | | distributor.​extraVolumes | list | `[]` | | | distributor.​initContainers | list | `[]` | | @@ -352,7 +352,7 @@ Kubernetes: `^1.19.0-0` | ingester.​env | list | `[]` | | | ingester.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | ingester.​extraContainers | list | `[]` | | -| ingester.​extraPorts | list | `[]` | | +| ingester.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | ingester.​extraVolumeMounts | list | `[]` | | | ingester.​extraVolumes | list | `[]` | | | ingester.​initContainers | list | `[]` | | @@ -505,7 +505,7 @@ Kubernetes: `^1.19.0-0` | nginx.​env | list | `[]` | | | nginx.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | nginx.​extraContainers | list | `[]` | | -| nginx.​extraPorts | list | `[]` | | +| nginx.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | nginx.​extraVolumeMounts | list | `[]` | | | nginx.​extraVolumes | list | `[]` | | | nginx.​http_listen_port | int | `80` | | @@ -551,7 +551,7 @@ Kubernetes: `^1.19.0-0` | overrides_exporter.​env | list | `[]` | | | overrides_exporter.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | overrides_exporter.​extraContainers | list | `[]` | | -| overrides_exporter.​extraPorts | list | `[]` | | +| overrides_exporter.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | overrides_exporter.​extraVolumeMounts | list | `[]` | | | overrides_exporter.​extraVolumes | list | `[]` | | | overrides_exporter.​initContainers | list | `[]` | | @@ -596,7 +596,7 @@ Kubernetes: `^1.19.0-0` | parquet_converter.​env | list | `[]` | | | parquet_converter.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | parquet_converter.​extraContainers | list | `[]` | | -| parquet_converter.​extraPorts | list | `[]` | | +| parquet_converter.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | parquet_converter.​extraVolumeMounts | list | `[]` | | | parquet_converter.​extraVolumes | list | `[]` | | | parquet_converter.​initContainers | list | `[]` | | @@ -646,7 +646,7 @@ Kubernetes: `^1.19.0-0` | purger.​env | list | `[]` | Extra env variables to pass to the cortex container | | purger.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | purger.​extraContainers | list | `[]` | Additional containers to be added to the cortex pod. | -| purger.​extraPorts | list | `[]` | Additional ports to the cortex services. Useful to expose extra container ports. | +| purger.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | purger.​extraVolumeMounts | list | `[]` | Extra volume mounts that will be added to the cortex container | | purger.​extraVolumes | list | `[]` | Additional volumes to the cortex pod. | | purger.​initContainers | list | `[]` | Init containers to be added to the cortex pod. | @@ -701,7 +701,7 @@ Kubernetes: `^1.19.0-0` | querier.​env | list | `[]` | | | querier.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | querier.​extraContainers | list | `[]` | | -| querier.​extraPorts | list | `[]` | | +| querier.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | querier.​extraVolumeMounts | list | `[]` | | | querier.​extraVolumes | list | `[]` | | | querier.​initContainers | list | `[]` | | @@ -748,7 +748,7 @@ Kubernetes: `^1.19.0-0` | query_frontend.​env | list | `[]` | | | query_frontend.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | query_frontend.​extraContainers | list | `[]` | | -| query_frontend.​extraPorts | list | `[]` | | +| query_frontend.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | query_frontend.​extraVolumeMounts | list | `[]` | | | query_frontend.​extraVolumes | list | `[]` | | | query_frontend.​initContainers | list | `[]` | | @@ -796,7 +796,7 @@ Kubernetes: `^1.19.0-0` | query_scheduler.​env | list | `[]` | | | query_scheduler.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | query_scheduler.​extraContainers | list | `[]` | | -| query_scheduler.​extraPorts | list | `[]` | | +| query_scheduler.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | query_scheduler.​extraVolumeMounts | list | `[]` | | | query_scheduler.​extraVolumes | list | `[]` | | | query_scheduler.​initContainers | list | `[]` | | @@ -858,7 +858,7 @@ Kubernetes: `^1.19.0-0` | ruler.​env | list | `[]` | | | ruler.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | ruler.​extraContainers | list | `[]` | | -| ruler.​extraPorts | list | `[]` | | +| ruler.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | ruler.​extraVolumeMounts | list | `[]` | | | ruler.​extraVolumes | list | `[]` | | | ruler.​initContainers | list | `[]` | | @@ -944,7 +944,7 @@ Kubernetes: `^1.19.0-0` | store_gateway.​env | list | `[]` | | | store_gateway.​extraArgs | object | `{}` | Additional Cortex container arguments, e.g. log.level (debug, info, warn, error) | | store_gateway.​extraContainers | list | `[]` | | -| store_gateway.​extraPorts | list | `[]` | | +| store_gateway.​extraPorts | list | `[]` | Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. | | store_gateway.​extraVolumeMounts | list | `[]` | | | store_gateway.​extraVolumes | list | `[]` | | | store_gateway.​initContainers | list | `[]` | | diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index b32c0d9a..9799f521 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -179,3 +179,16 @@ This helper validates that if memcached image is set to official image, args are {{- end -}} {{- end -}} {{- end -}} + +{{/* +Service ports for the extraPorts of a component. Each extra container port is +exposed on the service under its own name and port. +*/}} +{{- define "cortex.extraServicePorts" -}} +{{- range . }} +- port: {{ .containerPort }} + protocol: {{ .protocol | default "TCP" }} + name: {{ required "extraPorts entries need a name so they can be exposed on the service" .name }} + targetPort: {{ .name }} +{{- end }} +{{- end }} diff --git a/templates/alertmanager/alertmanager-dep.yaml b/templates/alertmanager/alertmanager-dep.yaml index 16b9ce66..b28dc16c 100644 --- a/templates/alertmanager/alertmanager-dep.yaml +++ b/templates/alertmanager/alertmanager-dep.yaml @@ -146,6 +146,9 @@ spec: - name: gossip containerPort: {{ .Values.config.memberlist.bind_port }} protocol: TCP + {{- with .Values.alertmanager.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.alertmanager.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/alertmanager/alertmanager-statefulset.yaml b/templates/alertmanager/alertmanager-statefulset.yaml index 433569e7..dfafdcea 100644 --- a/templates/alertmanager/alertmanager-statefulset.yaml +++ b/templates/alertmanager/alertmanager-statefulset.yaml @@ -221,6 +221,9 @@ spec: - containerPort: {{ $svcClusterPort }} name: alert-clu-udp protocol: UDP + {{- with .Values.alertmanager.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.alertmanager.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/alertmanager/alertmanager-svc-headless.yaml b/templates/alertmanager/alertmanager-svc-headless.yaml index 53db5857..efa0eeff 100644 --- a/templates/alertmanager/alertmanager-svc-headless.yaml +++ b/templates/alertmanager/alertmanager-svc-headless.yaml @@ -32,6 +32,9 @@ spec: protocol: TCP name: alert-clu-tcp targetPort: alert-clu-tcp + {{- with .Values.alertmanager.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.alertmanagerSelectorLabels" . | nindent 4 }} {{- end -}} diff --git a/templates/alertmanager/alertmanager-svc.yaml b/templates/alertmanager/alertmanager-svc.yaml index 5ba60356..5afde61d 100644 --- a/templates/alertmanager/alertmanager-svc.yaml +++ b/templates/alertmanager/alertmanager-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.alertmanager.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.alertmanagerSelectorLabels" . | nindent 4 }} {{- with .Values.alertmanager.service.trafficDistribution }} diff --git a/templates/compactor/compactor-statefulset.yaml b/templates/compactor/compactor-statefulset.yaml index 1aab8e1f..1471472c 100644 --- a/templates/compactor/compactor-statefulset.yaml +++ b/templates/compactor/compactor-statefulset.yaml @@ -131,6 +131,9 @@ spec: - name: gossip containerPort: {{ .Values.config.memberlist.bind_port }} protocol: TCP + {{- with .Values.compactor.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- if .Values.compactor.startupProbe }} startupProbe: {{- toYaml .Values.compactor.startupProbe | nindent 12 }} diff --git a/templates/compactor/compactor-svc.yaml b/templates/compactor/compactor-svc.yaml index 41b02f91..fc224308 100644 --- a/templates/compactor/compactor-svc.yaml +++ b/templates/compactor/compactor-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.compactor.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.compactorSelectorLabels" . | nindent 4 }} {{- end -}} diff --git a/templates/distributor/distributor-dep.yaml b/templates/distributor/distributor-dep.yaml index 0f3d1b54..233d9c04 100644 --- a/templates/distributor/distributor-dep.yaml +++ b/templates/distributor/distributor-dep.yaml @@ -87,6 +87,9 @@ spec: - name: grpc containerPort: {{ .Values.config.server.grpc_listen_port }} protocol: TCP + {{- with .Values.distributor.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.distributor.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/distributor/distributor-svc-headless.yaml b/templates/distributor/distributor-svc-headless.yaml index 999f34fe..d08f57ba 100755 --- a/templates/distributor/distributor-svc-headless.yaml +++ b/templates/distributor/distributor-svc-headless.yaml @@ -20,6 +20,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.distributor.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.distributorSelectorLabels" . | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/templates/distributor/distributor-svc.yaml b/templates/distributor/distributor-svc.yaml index b0a36eb0..0178150d 100644 --- a/templates/distributor/distributor-svc.yaml +++ b/templates/distributor/distributor-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.distributor.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.distributorSelectorLabels" . | nindent 4 }} {{- with .Values.distributor.service.trafficDistribution }} diff --git a/templates/ingester/ingester-dep.yaml b/templates/ingester/ingester-dep.yaml index 336779bf..494f94df 100644 --- a/templates/ingester/ingester-dep.yaml +++ b/templates/ingester/ingester-dep.yaml @@ -84,6 +84,9 @@ spec: - name: gossip containerPort: {{ .Values.config.memberlist.bind_port }} protocol: TCP + {{- with .Values.ingester.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- if .Values.ingester.startupProbe }} startupProbe: {{- toYaml .Values.ingester.startupProbe | nindent 12 }} diff --git a/templates/ingester/ingester-statefulset.yaml b/templates/ingester/ingester-statefulset.yaml index e2e7b147..1c949c33 100644 --- a/templates/ingester/ingester-statefulset.yaml +++ b/templates/ingester/ingester-statefulset.yaml @@ -169,6 +169,9 @@ spec: - name: gossip containerPort: {{ .Values.config.memberlist.bind_port }} protocol: TCP + {{- with .Values.ingester.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- if .Values.ingester.startupProbe }} startupProbe: {{- toYaml .Values.ingester.startupProbe | nindent 12 }} diff --git a/templates/ingester/ingester-svc-headless.yaml b/templates/ingester/ingester-svc-headless.yaml index 0f698179..8e3acc27 100644 --- a/templates/ingester/ingester-svc-headless.yaml +++ b/templates/ingester/ingester-svc-headless.yaml @@ -19,6 +19,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.ingester.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.ingesterSelectorLabels" . | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/templates/ingester/ingester-svc.yaml b/templates/ingester/ingester-svc.yaml index 16b2083e..3724175d 100644 --- a/templates/ingester/ingester-svc.yaml +++ b/templates/ingester/ingester-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.ingester.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.ingesterSelectorLabels" . | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/templates/nginx/nginx-dep.yaml b/templates/nginx/nginx-dep.yaml index 303d8de4..effa9464 100644 --- a/templates/nginx/nginx-dep.yaml +++ b/templates/nginx/nginx-dep.yaml @@ -70,6 +70,9 @@ spec: - name: http-metrics containerPort: {{ .Values.nginx.http_listen_port }} protocol: TCP + {{- with .Values.nginx.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.nginx.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/nginx/nginx-svc.yaml b/templates/nginx/nginx-svc.yaml index 801faf91..73780cd1 100644 --- a/templates/nginx/nginx-svc.yaml +++ b/templates/nginx/nginx-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.nginx.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.nginxSelectorLabels" . | nindent 4 }} {{- with .Values.nginx.service.trafficDistribution }} diff --git a/templates/overrides-exporter/overrides-exporter-dep.yaml b/templates/overrides-exporter/overrides-exporter-dep.yaml index 0a1dd40f..eb7260ff 100644 --- a/templates/overrides-exporter/overrides-exporter-dep.yaml +++ b/templates/overrides-exporter/overrides-exporter-dep.yaml @@ -69,6 +69,9 @@ spec: - name: http-metrics containerPort: {{ .Values.config.server.http_listen_port }} protocol: TCP + {{- with .Values.overrides_exporter.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.overrides_exporter.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/overrides-exporter/overrides-exporter-svc.yaml b/templates/overrides-exporter/overrides-exporter-svc.yaml index 3919948f..318d9f0d 100644 --- a/templates/overrides-exporter/overrides-exporter-svc.yaml +++ b/templates/overrides-exporter/overrides-exporter-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.overrides_exporter.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.overridesExporterSelectorLabels" . | nindent 4 }} {{- end }} diff --git a/templates/parquet-converter/parquet-converter-dep.yaml b/templates/parquet-converter/parquet-converter-dep.yaml index de7c56fc..b022d794 100644 --- a/templates/parquet-converter/parquet-converter-dep.yaml +++ b/templates/parquet-converter/parquet-converter-dep.yaml @@ -69,6 +69,9 @@ spec: - name: http-metrics containerPort: {{ .Values.config.server.http_listen_port }} protocol: TCP + {{- with .Values.parquet_converter.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.parquet_converter.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/parquet-converter/parquet-converter-statefulset.yaml b/templates/parquet-converter/parquet-converter-statefulset.yaml index 5034a169..98311802 100644 --- a/templates/parquet-converter/parquet-converter-statefulset.yaml +++ b/templates/parquet-converter/parquet-converter-statefulset.yaml @@ -104,6 +104,9 @@ spec: - name: http-metrics containerPort: {{ .Values.config.server.http_listen_port }} protocol: TCP + {{- with .Values.parquet_converter.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.parquet_converter.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/parquet-converter/parquet-converter-svc.yaml b/templates/parquet-converter/parquet-converter-svc.yaml index b70ae472..e9c23265 100644 --- a/templates/parquet-converter/parquet-converter-svc.yaml +++ b/templates/parquet-converter/parquet-converter-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.parquet_converter.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.parquetConverterSelectorLabels" . | nindent 4 }} {{- end }} diff --git a/templates/purger/purger-dep.yaml b/templates/purger/purger-dep.yaml index c64fdf84..d7ecb7cb 100644 --- a/templates/purger/purger-dep.yaml +++ b/templates/purger/purger-dep.yaml @@ -65,6 +65,9 @@ spec: - name: grpc containerPort: {{ .Values.config.server.grpc_listen_port }} protocol: TCP + {{- with .Values.purger.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.purger.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/purger/purger-svc-headless.yaml b/templates/purger/purger-svc-headless.yaml index ff0bf893..42258bc5 100644 --- a/templates/purger/purger-svc-headless.yaml +++ b/templates/purger/purger-svc-headless.yaml @@ -20,6 +20,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.purger.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.purgerSelectorLabels" . | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/templates/purger/purger-svc.yaml b/templates/purger/purger-svc.yaml index 9b70dcd2..148484fd 100644 --- a/templates/purger/purger-svc.yaml +++ b/templates/purger/purger-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.purger.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.purgerSelectorLabels" . | nindent 4 }} {{- end -}} diff --git a/templates/querier/querier-dep.yaml b/templates/querier/querier-dep.yaml index db8b09a4..ff55ae5e 100644 --- a/templates/querier/querier-dep.yaml +++ b/templates/querier/querier-dep.yaml @@ -86,6 +86,9 @@ spec: - name: http-metrics containerPort: {{ .Values.config.server.http_listen_port }} protocol: TCP + {{- with .Values.querier.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.querier.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/querier/querier-svc.yaml b/templates/querier/querier-svc.yaml index a7ef8317..c2477155 100644 --- a/templates/querier/querier-svc.yaml +++ b/templates/querier/querier-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.querier.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.querierSelectorLabels" . | nindent 4 }} {{- end -}} \ No newline at end of file diff --git a/templates/query-frontend/query-frontend-dep.yaml b/templates/query-frontend/query-frontend-dep.yaml index 20a8adcc..87521d8c 100644 --- a/templates/query-frontend/query-frontend-dep.yaml +++ b/templates/query-frontend/query-frontend-dep.yaml @@ -72,6 +72,9 @@ spec: - name: grpc containerPort: {{ .Values.config.server.grpc_listen_port }} protocol: TCP + {{- with .Values.query_frontend.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.query_frontend.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/query-frontend/query-frontend-svc-headless.yaml b/templates/query-frontend/query-frontend-svc-headless.yaml index 89225a85..6f28def2 100644 --- a/templates/query-frontend/query-frontend-svc-headless.yaml +++ b/templates/query-frontend/query-frontend-svc-headless.yaml @@ -20,6 +20,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.query_frontend.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.queryFrontendSelectorLabels" . | nindent 4 }} {{- end -}} \ No newline at end of file diff --git a/templates/query-frontend/query-frontend-svc.yaml b/templates/query-frontend/query-frontend-svc.yaml index 5c138ed2..27ff3553 100644 --- a/templates/query-frontend/query-frontend-svc.yaml +++ b/templates/query-frontend/query-frontend-svc.yaml @@ -22,6 +22,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.query_frontend.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.queryFrontendSelectorLabels" . | nindent 4 }} {{- with .Values.query_frontend.service.trafficDistribution }} diff --git a/templates/query-scheduler/query-scheduler-dep.yaml b/templates/query-scheduler/query-scheduler-dep.yaml index 7eebea4e..c030c800 100644 --- a/templates/query-scheduler/query-scheduler-dep.yaml +++ b/templates/query-scheduler/query-scheduler-dep.yaml @@ -68,6 +68,9 @@ spec: - name: grpc containerPort: {{ .Values.config.server.grpc_listen_port }} protocol: TCP + {{- with .Values.query_scheduler.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.query_scheduler.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/query-scheduler/query-scheduler-svc-headless.yaml b/templates/query-scheduler/query-scheduler-svc-headless.yaml index 63cef4c6..5e6ce81f 100644 --- a/templates/query-scheduler/query-scheduler-svc-headless.yaml +++ b/templates/query-scheduler/query-scheduler-svc-headless.yaml @@ -20,6 +20,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.query_scheduler.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.querySchedulerSelectorLabels" . | nindent 4 }} {{- end }} diff --git a/templates/query-scheduler/query-scheduler-svc.yaml b/templates/query-scheduler/query-scheduler-svc.yaml index 66c482b9..22496167 100644 --- a/templates/query-scheduler/query-scheduler-svc.yaml +++ b/templates/query-scheduler/query-scheduler-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.query_scheduler.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.querySchedulerSelectorLabels" . | nindent 4 }} {{- end }} diff --git a/templates/ruler/ruler-dep.yaml b/templates/ruler/ruler-dep.yaml index ab29f689..2ac88397 100644 --- a/templates/ruler/ruler-dep.yaml +++ b/templates/ruler/ruler-dep.yaml @@ -172,6 +172,9 @@ spec: - name: gossip containerPort: {{ .Values.config.memberlist.bind_port }} protocol: TCP + {{- with .Values.ruler.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.ruler.startupProbe | nindent 12 }} livenessProbe: diff --git a/templates/ruler/ruler-svc.yaml b/templates/ruler/ruler-svc.yaml index 79df3ff9..30f2038c 100644 --- a/templates/ruler/ruler-svc.yaml +++ b/templates/ruler/ruler-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.ruler.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.rulerSelectorLabels" . | nindent 4 }} {{- with .Values.ruler.service.trafficDistribution }} diff --git a/templates/store-gateway/store-gateway-statefulset.yaml b/templates/store-gateway/store-gateway-statefulset.yaml index 711360ad..f666bbba 100644 --- a/templates/store-gateway/store-gateway-statefulset.yaml +++ b/templates/store-gateway/store-gateway-statefulset.yaml @@ -137,6 +137,9 @@ spec: - name: gossip containerPort: {{ .Values.config.memberlist.bind_port }} protocol: TCP + {{- with .Values.store_gateway.extraPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} startupProbe: {{- toYaml .Values.store_gateway.startupProbe | nindent 12 }} {{- if .Values.store_gateway.livenessProbe }} diff --git a/templates/store-gateway/store-gateway-svc-headless.yaml b/templates/store-gateway/store-gateway-svc-headless.yaml index 47e5ea67..4242e348 100644 --- a/templates/store-gateway/store-gateway-svc-headless.yaml +++ b/templates/store-gateway/store-gateway-svc-headless.yaml @@ -19,6 +19,9 @@ spec: protocol: TCP name: grpc targetPort: grpc + {{- with .Values.store_gateway.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.storeGatewaySelectorLabels" . | nindent 4 }} {{- end -}} diff --git a/templates/store-gateway/store-gateway-svc.yaml b/templates/store-gateway/store-gateway-svc.yaml index 8e67027e..d4d3e5db 100644 --- a/templates/store-gateway/store-gateway-svc.yaml +++ b/templates/store-gateway/store-gateway-svc.yaml @@ -18,6 +18,9 @@ spec: protocol: TCP name: http-metrics targetPort: http-metrics + {{- with .Values.store_gateway.extraPorts }} + {{- include "cortex.extraServicePorts" . | trim | nindent 4 }} + {{- end }} selector: {{- include "cortex.storeGatewaySelectorLabels" . | nindent 4 }} {{- end -}} diff --git a/values.yaml b/values.yaml index f6c4bec5..d4199d1c 100644 --- a/values.yaml +++ b/values.yaml @@ -297,7 +297,7 @@ alertmanager: # -- Extra volume mounts that will be added to the cortex container extraVolumeMounts: [] - # -- Additional ports to the cortex services. Useful to expose extra container ports. + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] # -- Extra env variables to pass to the cortex container @@ -462,6 +462,7 @@ distributor: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] lifecycle: {} @@ -654,6 +655,7 @@ ingester: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] @@ -753,6 +755,7 @@ ruler: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] # -- allow configuring rules via configmap. ref: https://cortexproject.github.io/cortex-helm-chart/guides/configure_rules_via_configmap.html @@ -917,6 +920,7 @@ querier: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] lifecycle: {} @@ -1011,6 +1015,7 @@ query_frontend: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] lifecycle: {} @@ -1102,6 +1107,7 @@ query_scheduler: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] lifecycle: {} @@ -1190,6 +1196,7 @@ overrides_exporter: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] lifecycle: {} @@ -1326,6 +1333,7 @@ parquet_converter: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] lifecycle: {} @@ -1389,7 +1397,7 @@ purger: # -- Extra volume mounts that will be added to the cortex container extraVolumeMounts: [] - # -- Additional ports to the cortex services. Useful to expose extra container ports. + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] # -- Extra env variables to pass to the cortex container @@ -1536,6 +1544,7 @@ nginx: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] @@ -1684,6 +1693,7 @@ store_gateway: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: [] @@ -1798,6 +1808,7 @@ compactor: extraContainers: [] extraVolumes: [] extraVolumeMounts: [] + # -- Additional container ports, as in the Kubernetes ContainerPort spec. Each one is also exposed on the services under its name. extraPorts: [] env: []