Skip to content

Commit

Permalink
[Helm] Add flags needed for migration from distributed (grafana#7331)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:
Adds flags to the helm charts that are needed when doing a zero-downtime
migration from a `loki-distributed` helm chart deployment. The flags
allow for an additional memberlist join member to be specified. This
allows the new `grafana/loki` cluster to join the old
`grafana/loki-distributed` cluster, forming one big cluster. The
ingesters in the `grafana/loki-distributed` cluster can then be taken
down 1-by-1, allowing the whole `grafana/loki-distributed` cluster to be
deleted once all the ingesters have scaled down.

**Which issue(s) this PR fixes**:
Fixes grafana#7330

Co-authored-by: Karsten Jeschkies <k@jeschkies.xyz>
  • Loading branch information
trevorwhitney and jeschkies authored Oct 21, 2022
1 parent da5378c commit ae2a6f3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions production/helm/loki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ monitoring:
| loki.storage | object | `{"bucketNames":{"admin":"admin","chunks":"chunks","ruler":"ruler"},"filesystem":{"chunks_directory":"/var/loki/chunks","rules_directory":"/var/loki/rules"},"gcs":{"chunkBufferSize":0,"enableHttp2":true,"requestTimeout":"0s"},"s3":{"accessKeyId":null,"endpoint":null,"http_config":{},"insecure":false,"region":null,"s3":null,"s3ForcePathStyle":false,"secretAccessKey":null},"type":"s3"}` | Storage config. Providing this will automatically populate all necessary storage configs in the templated config. |
| loki.storage_config | object | `{"hedging":{"at":"250ms","max_per_second":20,"up_to":3}}` | Additional storage config |
| loki.structuredConfig | object | `{}` | Structured loki configuration, takes precedence over `loki.config`, `loki.schemaConfig`, `loki.storageConfig` |
| migrate | object | `{"fromDistributed":{"enabled":false,"memberlistService":""}}` | Options that may be necessary when performing a migration from another helm chart |
| migrate.fromDistributed | object | `{"enabled":false,"memberlistService":""}` | When migrating from a distributed chart like loki-distributed or enterprise-logs |
| migrate.fromDistributed.enabled | bool | `false` | Set to true if migrating from a distributed helm chart |
| migrate.fromDistributed.memberlistService | string | `""` | If migrating from a distributed service, provide the distributed deployment's memberlist service DNS so the new deployment can join it's ring. |
| minio | object | `{"buckets":[{"name":"chunks","policy":"none","purge":false},{"name":"ruler","policy":"none","purge":false},{"name":"admin","policy":"none","purge":false}],"drivesPerNode":2,"enabled":false,"persistence":{"size":"5Gi"},"replicas":1,"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"rootPassword":"supersecret","rootUser":"enterprise-logs"}` | ----------------------------------- |
| monitoring.alerts.annotations | object | `{}` | Additional annotations for the alerts PrometheusRule resource |
| monitoring.alerts.enabled | bool | `true` | If enabled, create PrometheusRule resource with Loki alerting rules |
Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/templates/loki-canary/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ spec:
- -labelvalue=$(POD_NAME)
{{- if $.Values.enterprise.enabled }}
- -user=$(USER)
- -tenant-id=$(USER)
- -pass=$(PASS)
{{- else if $.Values.loki.auth_enabled }}
- -user={{ $.Values.monitoring.selfMonitoring.tenant }}
- -tenant-id={{ $.Values.monitoring.selfMonitoring.tenant }}
{{- end }}
{{- with .extraArgs }}
{{- toYaml . | nindent 12 }}
Expand Down
15 changes: 15 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ loki:
memberlist:
join_members:
- {{ include "loki.memberlist" . }}
{{- with .Values.migrate.fromDistributed }}
{{- if .enabled }}
- {{ .memberlistService }}
{{- end }}
{{- end }}
{{- if .Values.loki.commonConfig}}
common:
Expand Down Expand Up @@ -511,6 +516,16 @@ enterprise:
}
}
# -- Options that may be necessary when performing a migration from another helm chart
migrate:
# -- When migrating from a distributed chart like loki-distributed or enterprise-logs
fromDistributed:
# -- Set to true if migrating from a distributed helm chart
enabled: false
# -- If migrating from a distributed service, provide the distributed deployment's
# memberlist service DNS so the new deployment can join it's ring.
memberlistService: ""

serviceAccount:
# -- Specifies whether a ServiceAccount should be created
create: true
Expand Down

0 comments on commit ae2a6f3

Please sign in to comment.