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

feat: support ruler sidecar in singleBinary mode #13572

Merged
Merged
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
3 changes: 1 addition & 2 deletions production/helm/loki/templates/backend/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- if and $isSimpleScalable (not .Values.rbac.namespaced) (not .Values.rbac.useExistingRole) }}
{{- if and (not .Values.rbac.namespaced) (not .Values.rbac.useExistingRole) }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- if and $isSimpleScalable (not .Values.rbac.namespaced) }}
{{- if (not .Values.rbac.namespaced) }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down
82 changes: 82 additions & 0 deletions production/helm/loki/templates/single-binary/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,75 @@ spec:
{{- end }}
{{- end }}
containers:
{{- if .Values.sidecar.rules.enabled }}
- name: loki-sc-rules
{{- if .Values.sidecar.image.sha }}
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}@sha256:{{ .Values.sidecar.image.sha }}"
{{- else }}
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
env:
- name: METHOD
value: {{ .Values.sidecar.rules.watchMethod }}
- name: LABEL
value: "{{ .Values.sidecar.rules.label }}"
{{- if .Values.sidecar.rules.labelValue }}
- name: LABEL_VALUE
value: {{ quote .Values.sidecar.rules.labelValue }}
{{- end }}
- name: FOLDER
value: "{{ .Values.sidecar.rules.folder }}"
- name: RESOURCE
value: {{ quote .Values.sidecar.rules.resource }}
{{- if .Values.sidecar.enableUniqueFilenames }}
- name: UNIQUE_FILENAMES
value: "{{ .Values.sidecar.enableUniqueFilenames }}"
{{- end }}
{{- if .Values.sidecar.rules.searchNamespace }}
- name: NAMESPACE
value: "{{ .Values.sidecar.rules.searchNamespace | join "," }}"
{{- end }}
{{- if .Values.sidecar.skipTlsVerify }}
- name: SKIP_TLS_VERIFY
value: "{{ .Values.sidecar.skipTlsVerify }}"
{{- end }}
{{- if .Values.sidecar.rules.script }}
- name: SCRIPT
value: "{{ .Values.sidecar.rules.script }}"
{{- end }}
{{- if .Values.sidecar.rules.watchServerTimeout }}
- name: WATCH_SERVER_TIMEOUT
value: "{{ .Values.sidecar.rules.watchServerTimeout }}"
{{- end }}
{{- if .Values.sidecar.rules.watchClientTimeout }}
- name: WATCH_CLIENT_TIMEOUT
value: "{{ .Values.sidecar.rules.watchClientTimeout }}"
{{- end }}
{{- if .Values.sidecar.rules.logLevel }}
- name: LOG_LEVEL
value: "{{ .Values.sidecar.rules.logLevel }}"
{{- end }}
{{- if .Values.sidecar.livenessProbe }}
livenessProbe:
{{- toYaml .Values.sidecar.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.sidecar.readinessProbe }}
readinessProbe:
{{- toYaml .Values.sidecar.readinessProbe | nindent 12 }}
{{- end }}
{{- if .Values.sidecar.resources }}
resources:
{{- toYaml .Values.sidecar.resources | nindent 12 }}
{{- end }}
{{- if .Values.sidecar.securityContext }}
securityContext:
{{- toYaml .Values.sidecar.securityContext | nindent 12 }}
{{- end }}
volumeMounts:
- name: sc-rules-volume
mountPath: {{ .Values.sidecar.rules.folder | quote }}
{{- end}}
- name: loki
image: {{ include "loki.image" . }}
imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
Expand Down Expand Up @@ -125,6 +194,10 @@ spec:
- name: license
mountPath: /etc/loki/license
{{- end }}
{{- if .Values.sidecar.rules.enabled }}
- name: sc-rules-volume
mountPath: {{ .Values.sidecar.rules.folder | quote }}
{{- end}}
{{- with .Values.singleBinary.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -166,6 +239,15 @@ spec:
secretName: enterprise-logs-license
{{- end }}
{{- end }}
{{- if .Values.sidecar.rules.enabled }}
- name: sc-rules-volume
{{- if .Values.sidecar.rules.sizeLimit }}
emptyDir:
sizeLimit: {{ .Values.sidecar.rules.sizeLimit }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- end -}}
{{- with .Values.singleBinary.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Loading