Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/k8s/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
description: A Helm Chart for cortex-tenant
name: cortex-tenant
version: 0.2.1 # This is the chart version
version: 0.3.0 # This is the chart version
appVersion: 1.11.0 # version number of the application being deployed.
type: application
15 changes: 14 additions & 1 deletion deploy/k8s/chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cortex-tenant

![Version: 0.2.1](https://img.shields.io/badge/Version-0.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.11.0](https://img.shields.io/badge/AppVersion-1.11.0-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.11.0](https://img.shields.io/badge/AppVersion-1.11.0-informational?style=flat-square)

A Helm Chart for cortex-tenant

Expand Down Expand Up @@ -56,4 +56,17 @@ A Helm Chart for cortex-tenant
| service.port | int | `8080` | |
| service.targetPort | int | `8080` | |
| service.type | string | `"ClusterIP"` | |
| serviceMonitor.annotations | object | `{}` | ServiceMonitor annotations |
| serviceMonitor.enabled | bool | `false` | If enabled, ServiceMonitor resources for Prometheus Operator are created |
| serviceMonitor.interval | string | `nil` | ServiceMonitor scrape interval |
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
| serviceMonitor.metricRelabelings | list | `[]` | ServiceMonitor relabel configs to apply to samples as the last step before ingestion https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig (defines `metric_relabel_configs`) |
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor resources |
| serviceMonitor.namespaceSelector | object | `{}` | Namespace selector for ServiceMonitor resources |
| serviceMonitor.prometheusRule | object | `{"additionalLabels":{},"enabled":false,"rules":[]}` | Prometheus rules will be deployed for alerting purposes |
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabel configs to apply to samples before scraping https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig (defines `relabel_configs`) |
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor will use http by default, but you can pick https as well |
| serviceMonitor.scrapeTimeout | string | `nil` | ServiceMonitor scrape timeout in Go duration format (e.g. 15s) |
| serviceMonitor.targetLabels | list | `[]` | ServiceMonitor will add labels from the service to the Prometheus metric https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec |
| serviceMonitor.tlsConfig | string | `nil` | ServiceMonitor will use these tlsConfig settings to make the health check requests |
| tolerations | list | `[]` | |
5 changes: 5 additions & 0 deletions deploy/k8s/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ spec:
- name: http
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
{{- if .Values.serviceMonitor.enabled }}
- name: http-metrics
containerPort: {{ .Values.serviceMonitor.targetPort }}
protocol: TCP
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down
21 changes: 21 additions & 0 deletions deploy/k8s/chart/templates/prometheus-rules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if and .Values.serviceMonitor.enabled .Values.serviceMonitor.prometheusRule.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "promtail.fullname" . }}
{{- with .Values.serviceMonitor.prometheusRule.namespace }}
namespace: {{ . | quote }}
{{- end }}
labels:
{{- include "cortex-tenant.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.prometheusRule.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.serviceMonitor.prometheusRule.rules }}
groups:
- name: {{ template "cortex-tenant.fullname" . }}
rules:
{{- toYaml .Values.serviceMonitor.prometheusRule.rules | nindent 4 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions deploy/k8s/chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ spec:
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
{{- if .Values.serviceMonitor.enabled }}
- name: http-metrics
port: {{ .Values.serviceMonitor.targetPort }}
targetPort: http-metrics
protocol: TCP
{{- end }}
selector:
{{- include "cortex-tenant.selectorLabels" . | nindent 4 }}
58 changes: 58 additions & 0 deletions deploy/k8s/chart/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- with .Values.serviceMonitor }}
{{- if .enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "cortex-tenant.fullname" $ }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "cortex-tenant.labels" $ | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .namespaceSelector }}
namespaceSelector:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "cortex-tenant.selectorLabels" $ | nindent 6 }}
endpoints:
- port: http-metrics
{{- with $.Values.httpPathPrefix }}
path: {{ printf "%s/metrics" . }}
{{- end }}
{{- with .interval }}
interval: {{ . }}
{{- end }}
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with .relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .scheme }}
scheme: {{ . }}
{{- end }}
{{- with .tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .targetLabels }}
targetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
41 changes: 41 additions & 0 deletions deploy/k8s/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,44 @@ nodeSelector: {} # [Node Selection](https://kubernetes.io/docs/concepts/scheduli
tolerations: [] # [Taints and Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/)

affinity: {} # [Node Selection](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node)

# ServiceMonitor configuration
serviceMonitor:
# -- If enabled, ServiceMonitor resources for Prometheus Operator are created
enabled: false
# -- Alternative namespace for ServiceMonitor resources
namespace: null
# Service targetPort
targetPort: 9090
# -- Namespace selector for ServiceMonitor resources
namespaceSelector: {}
# -- ServiceMonitor annotations
annotations: {}
# -- Additional ServiceMonitor labels
labels: {}
# -- ServiceMonitor scrape interval
interval: null
# -- ServiceMonitor scrape timeout in Go duration format (e.g. 15s)
scrapeTimeout: null
# -- ServiceMonitor relabel configs to apply to samples before scraping
# https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
# (defines `relabel_configs`)
relabelings: []
# -- ServiceMonitor relabel configs to apply to samples as the last
# step before ingestion
# https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
# (defines `metric_relabel_configs`)
metricRelabelings: []
# --ServiceMonitor will add labels from the service to the Prometheus metric
# https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec
targetLabels: []
# -- ServiceMonitor will use http by default, but you can pick https as well
scheme: http
# -- ServiceMonitor will use these tlsConfig settings to make the health check requests
tlsConfig: null
# -- Prometheus rules will be deployed for alerting purposes
prometheusRule:
enabled: false
additionalLabels: {}
# namespace:
rules: []
Binary file added docs/cortex-tenant-0.3.0.tgz
Binary file not shown.
18 changes: 14 additions & 4 deletions docs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ entries:
cortex-tenant:
- apiVersion: v2
appVersion: 1.11.0
created: "2023-07-21T13:23:40.3468175+02:00"
created: "2023-08-11T17:35:30.148984+02:00"
description: A Helm Chart for cortex-tenant
digest: cf12ab22dd0973e94e15d8246f66ae35738dadfc489952f919ed326a1f7eed5a
name: cortex-tenant
type: application
urls:
- cortex-tenant-0.3.0.tgz
version: 0.3.0
- apiVersion: v2
appVersion: 1.11.0
created: "2023-08-11T17:35:30.148575+02:00"
description: A Helm Chart for cortex-tenant
digest: c967d4dea6ff8ae827133876f588d22bfa51d10168e4bca57f161b7ab6097c7c
name: cortex-tenant
Expand All @@ -13,7 +23,7 @@ entries:
version: 0.2.1
- apiVersion: v2
appVersion: 1.11.0
created: "2023-07-21T13:23:40.3464084+02:00"
created: "2023-08-11T17:35:30.148215+02:00"
description: A Helm Chart for cortex-tenant
digest: 8b9caea0e1774a6c8f3e627a63386f532498ca5f410927c702380692e5d20b61
name: cortex-tenant
Expand All @@ -23,12 +33,12 @@ entries:
version: 0.2.0
- apiVersion: v2
appVersion: 1.10.1
created: "2023-07-21T13:23:40.3459992+02:00"
created: "2023-08-11T17:35:30.147801+02:00"
description: A Helm Chart for cortex-tenant
digest: eabef3ad16e555543e32d9308994f76679e5fa54371cccd3957112f33a28a59e
name: cortex-tenant
type: application
urls:
- cortex-tenant-0.1.0.tgz
version: 0.1.0
generated: "2023-07-21T13:23:40.3454267+02:00"
generated: "2023-08-11T17:35:30.147201+02:00"