-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[loki-distributed] Add overrides-exporter
Signed-off-by: Romain BELORGEY <[email protected]>
- Loading branch information
1 parent
7b85764
commit 2af23e4
Showing
6 changed files
with
257 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
charts/loki-distributed/templates/overrides-exporter/_helpers-overrides-exporter.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{/* | ||
overrides-exporter fullname | ||
*/}} | ||
{{- define "loki.overridesExporterFullname" -}} | ||
{{ include "loki.fullname" . }}-overrides-exporter | ||
{{- end }} | ||
|
||
{{/* | ||
overrides-exporter common labels | ||
*/}} | ||
{{- define "loki.overridesExporterLabels" -}} | ||
{{ include "loki.labels" . }} | ||
app.kubernetes.io/component: overrides-exporter | ||
{{- end }} | ||
|
||
{{/* | ||
overrides-exporter selector labels | ||
*/}} | ||
{{- define "loki.overridesExporterSelectorLabels" -}} | ||
{{ include "loki.selectorLabels" . }} | ||
app.kubernetes.io/component: overrides-exporter | ||
{{- end }} | ||
|
||
{{/* | ||
overrides-exporter image | ||
*/}} | ||
{{- define "loki.overridesExporterImage" -}} | ||
{{- $dict := dict "loki" .Values.loki.image "service" .Values.overridesExporter.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion -}} | ||
{{- include "loki.lokiImage" $dict -}} | ||
{{- end }} | ||
|
||
{{/* | ||
overrides-exporter priority class name | ||
*/}} | ||
{{- define "loki.overridesExporterPriorityClassName" -}} | ||
{{- $pcn := coalesce .Values.global.priorityClassName .Values.overridesExporter.priorityClassName -}} | ||
{{- if $pcn }} | ||
priorityClassName: {{ $pcn }} | ||
{{- end }} | ||
{{- end }} |
135 changes: 135 additions & 0 deletions
135
charts/loki-distributed/templates/overrides-exporter/deployment-overrides-exporter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{{- if .Values.overridesExporter.enabled -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "loki.overridesExporterFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.overridesExporterLabels" . | nindent 4 }} | ||
{{- with .Values.loki.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: 1 | ||
strategy: | ||
{{- toYaml .Values.overridesExporter.strategy | nindent 4 }} | ||
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} | ||
selector: | ||
matchLabels: | ||
{{- include "loki.overridesExporterSelectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- include "loki.config.checksum" . | nindent 8 }} | ||
{{- with .Values.loki.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "loki.overridesExporterSelectorLabels" . | nindent 8 }} | ||
{{- with .Values.loki.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "loki.serviceAccountName" . }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- include "loki.overridesExporterPriorityClassName" . | nindent 6 }} | ||
securityContext: | ||
{{- toYaml .Values.loki.podSecurityContext | nindent 8 }} | ||
{{- with .Values.overridesExporter.initContainers }} | ||
initContainers: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: overrides-exporter | ||
image: {{ include "loki.overridesExporterImage" . }} | ||
imagePullPolicy: {{ .Values.loki.image.pullPolicy }} | ||
{{- if or .Values.loki.command .Values.overridesExporter.command }} | ||
command: | ||
- {{ coalesce .Values.overridesExporter.command .Values.loki.command | quote }} | ||
{{- end }} | ||
args: | ||
- -config.file=/etc/loki/config/config.yaml | ||
- -target=overrides-exporter | ||
{{- with .Values.overridesExporter.extraArgs }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: 3100 | ||
protocol: TCP | ||
{{- with .Values.overridesExporter.extraEnv }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.extraEnvFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} | ||
{{- toYaml .Values.loki.readinessProbe | nindent 12 }} | ||
{{- toYaml .Values.loki.livenessProbe | nindent 12 }} | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/loki/config | ||
- name: runtime-config | ||
mountPath: /var/{{ include "loki.name" . }}-runtime | ||
- name: data | ||
mountPath: /var/loki | ||
{{- with .Values.overridesExporter.extraVolumeMounts }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.lifecycle }} | ||
lifecycle: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- if .Values.overridesExporter.extraContainers }} | ||
{{- toYaml .Values.overridesExporter.extraContainers | nindent 8}} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.affinity }} | ||
affinity: | ||
{{- tpl . $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.overridesExporter.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
{{- if .Values.loki.existingSecretForConfig }} | ||
secret: | ||
secretName: {{ .Values.loki.existingSecretForConfig }} | ||
{{- else if .Values.loki.configAsSecret }} | ||
secret: | ||
secretName: {{ include "loki.fullname" . }}-config | ||
{{- else }} | ||
configMap: | ||
name: {{ include "loki.fullname" . }} | ||
{{- end }} | ||
- name: runtime-config | ||
configMap: | ||
name: {{ template "loki.fullname" . }}-runtime | ||
{{- with .Values.overridesExporter.extraVolumes }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
- name: data | ||
emptyDir: {} | ||
{{- end -}} |
25 changes: 25 additions & 0 deletions
25
charts/loki-distributed/templates/overrides-exporter/service-overrides-exporter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if .Values.overridesExporter.enabled -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "loki.overridesExporterFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.overridesExporterLabels" . | nindent 4 }} | ||
{{- with .Values.overridesExporter.serviceLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.loki.serviceAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 3100 | ||
targetPort: http | ||
protocol: TCP | ||
selector: | ||
{{- include "loki.overridesExporterSelectorLabels" . | nindent 4 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters