forked from grafana/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Loki 2.0.0 and add compactor support (grafana#27)
Signed-off-by: Reinhard Nägele <[email protected]>
- Loading branch information
1 parent
f4ac5eb
commit d7ea57b
Showing
10 changed files
with
247 additions
and
8 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
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
22 changes: 22 additions & 0 deletions
22
charts/loki-distributed/templates/compactor/_helpers-compactor.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,22 @@ | ||
{{/* | ||
compactor fullname | ||
*/}} | ||
{{- define "loki.compactorFullname" -}} | ||
{{ include "loki.fullname" . }}-compactor | ||
{{- end }} | ||
|
||
{{/* | ||
compactor common labels | ||
*/}} | ||
{{- define "loki.compactorLabels" -}} | ||
{{ include "loki.labels" . }} | ||
app.kubernetes.io/component: compactor | ||
{{- end }} | ||
|
||
{{/* | ||
compactor selector labels | ||
*/}} | ||
{{- define "loki.compactorSelectorLabels" -}} | ||
{{ include "loki.selectorLabels" . }} | ||
app.kubernetes.io/component: compactor | ||
{{- end }} |
97 changes: 97 additions & 0 deletions
97
charts/loki-distributed/templates/compactor/deployment-compactor.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,97 @@ | ||
{{- if .Values.compactor.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "loki.compactorFullname" . }} | ||
labels: | ||
{{- include "loki.compactorLabels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
{{- include "loki.compactorSelectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") $ | sha256sum }} | ||
{{- with .Values.loki.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.compactor.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "loki.compactorSelectorLabels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "loki.serviceAccountName" . }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
fsGroup: 10001 | ||
runAsGroup: 10001 | ||
runAsNonRoot: true | ||
runAsUser: 10001 | ||
terminationGracePeriodSeconds: {{ .Values.compactor.terminationGracePeriodSeconds }} | ||
containers: | ||
- name: loki | ||
image: {{ include "loki.image" . }} | ||
imagePullPolicy: {{ .Values.loki.image.pullPolicy }} | ||
args: | ||
- -config.file=/etc/loki/loki.yaml | ||
- -target=compactor | ||
- -boltdb.shipper.compactor.working-directory=/var/loki/compactor | ||
{{- with .Values.compactor.extraArgs }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: 3100 | ||
protocol: TCP | ||
{{- with .Values.compactor.extraEnv }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.compactor.extraEnvFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: http | ||
initialDelaySeconds: 15 | ||
timeoutSeconds: 1 | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/loki | ||
- name: data | ||
mountPath: /var/loki | ||
resources: | ||
{{- toYaml .Values.compactor.resources | nindent 12 }} | ||
{{- with .Values.compactor.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.compactor.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: data-{{ include "loki.fullname" . }} | ||
- name: data | ||
{{- if .Values.compactor.persistence.enabled }} | ||
persistentVolumeClaim: | ||
claimName: {{ include "loki.compactorFullname" . }} | ||
{{- else }} | ||
emptyDir: {} | ||
{{- end }} | ||
{{- end }} |
17 changes: 17 additions & 0 deletions
17
charts/loki-distributed/templates/compactor/persistentvolumeclaim-compactor.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,17 @@ | ||
{{- if .Values.compactor.enabled }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: data-{{ include "loki.compactorFullname" . }} | ||
labels: | ||
{{- include "loki.compactorLabels" . | nindent 4 }} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
{{- with .Values.compactor.persistence.storageClass }} | ||
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: "{{ .Values.compactor.persistence.size }}" | ||
{{- end }} |
19 changes: 19 additions & 0 deletions
19
charts/loki-distributed/templates/compactor/service-compactor.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,19 @@ | ||
{{- if .Values.compactor.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "loki.fullname" . }}-compactor | ||
labels: | ||
{{- include "loki.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: compactor | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 3100 | ||
targetPort: http | ||
protocol: TCP | ||
selector: | ||
{{- include "loki.selectorLabels" . | nindent 4 }} | ||
app.kubernetes.io/component: compactor | ||
{{- end }} |
38 changes: 38 additions & 0 deletions
38
charts/loki-distributed/templates/compactor/servicemonitor-compactor.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,38 @@ | ||
{{- if .Values.compactor.enabled }} | ||
{{- with .Values.serviceMonitor }} | ||
{{- if .enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ include "loki.compactorFullname" $ }} | ||
{{- with .namespace }} | ||
namespace: {{ . }} | ||
{{- end }} | ||
{{- with .annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "loki.compactorLabels" $ | nindent 4 }} | ||
{{- with .labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- with .namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "loki.compactorSelectorLabels" $ | nindent 6 }} | ||
endpoints: | ||
- port: http | ||
{{- with .interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with .scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- 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