Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm: add ruler specific service account #7132

Merged
merged 15 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Entries should include a reference to the Pull Request that introduced the chang
* [ENHANCEMENT] Add `jaegerReporterMaxQueueSize` Helm value for all components where configuring `JAEGER_REPORTER_MAX_QUEUE_SIZE` makes sense, and override the Jaeger client's default value of 100 for components expected to generate many trace spans. #7068 #7086
* [ENHANCEMENT] Rollout-operator: upgraded to v0.10.1. #7125
* [ENHANCEMENT] Query-frontend: configured `-shutdown-delay`, `-server.grpc.keepalive.max-connection-age` and termination grace period to reduce the likelihood of queries hitting terminated query-frontends. #7129
* [ENHANCEMENT] Add the possibility to create a dedicated serviceAccount for the `ruler` component by setting `ruler.serivceAcount.create` to true in the values. #7132
* [BUGFIX] Metamonitoring: update dashboards to drop unsupported `step` parameter in targets. #7157

## 5.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ For compatibility and to support upgrade from enterprise-metrics chart calculate
{{- end -}}

{{/*
Create the name of the service account
Create the name of the general service account
*/}}
{{- define "mimir.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
Expand All @@ -74,6 +74,18 @@ Create the name of the service account
{{- end -}}
{{- end -}}

{{/*
Create the name of the ruler service account
*/}}
{{- define "mimir.ruler.serviceAccountName" -}}
{{- if .Values.ruler.serviceAccount.create -}}
dimitarvdimitrov marked this conversation as resolved.
Show resolved Hide resolved
{{- $sa := default (include "mimir.fullname" .) .Values.serviceAccount.name }}
dimitarvdimitrov marked this conversation as resolved.
Show resolved Hide resolved
{{- printf "%s-%s" $sa "ruler" }}
dimitarvdimitrov marked this conversation as resolved.
Show resolved Hide resolved
{{- else -}}
{{ include "mimir.serviceAccountName" . }}
{{- end -}}
{{- end -}}

dimitarvdimitrov marked this conversation as resolved.
Show resolved Hide resolved
{{/*
Create the app name for clients. Defaults to the same logic as "mimir.fullname", and default client expects "prometheus".
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ subjects:
- kind: ServiceAccount
name: {{ include "rollout-operator.serviceAccountName" . }}
{{- end }}
{{- if .Values.ruler.serviceAccount.create }}
- kind: ServiceAccount
name: {{ template "mimir.ruler.serviceAccountName" . }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
{{- include "mimir.podAnnotations" (dict "ctx" . "component" "ruler") | nindent 8 }}
namespace: {{ .Release.Namespace | quote }}
spec:
serviceAccountName: {{ template "mimir.serviceAccountName" . }}
serviceAccountName: {{ template "mimir.ruler.serviceAccountName" . }}
{{- if .Values.ruler.priorityClassName }}
priorityClassName: {{ .Values.ruler.priorityClassName }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.ruler.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "mimir.ruler.serviceAccountName" . }}
labels:
{{- include "mimir.labels" (dict "ctx" .) | nindent 4 }}
{{- with .Values.ruler.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- toYaml .Values.ruler.serviceAccount.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
9 changes: 9 additions & 0 deletions operations/helm/charts/mimir-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,15 @@
service:
annotations: {}
labels: {}

Check failure on line 1121 in operations/helm/charts/mimir-distributed/values.yaml

View workflow job for this annotation

GitHub Actions / call-lint-test / lint-test

[trailing-spaces] trailing spaces
# -- Dedicated service account for ruler pods.
# If not set, the default service account defined at the begining of this file will be used.
# This service account can be used even if the default one is not set.
serviceAccount:
create: false
name:
annotations: {}
labels: {}

resources:
requests:
Expand Down
Loading