Skip to content
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
4 changes: 2 additions & 2 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ parameters:
enabled: true
# Ingress
gateway:
enabled: false
nginx:
enabled: true
nginx:
enabled: false
# Optional
alertmanager:
enabled: true
Expand Down
105 changes: 105 additions & 0 deletions docs/modules/ROOT/pages/how-tos/migrate-to-gateway.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
= Migration to Unified Gateway Deployment

[IMPORTANT]
====
The nginx deployment is deprecated and will be removed with Helm chart v7.x.
It is recommended to migrate to the unified gateway deployment.
====

You have the following options to migrate to the unified gateway deployment:

* Migrate with short service disruption
* Migrate without service disruption


== Migrate with Short Service Disruption

You dont have to do any migration steps, v4.x of this component will automatically migrate to the unified gateway deployment.
If you have integrated this Mimir as datasource in Grafana, then the service name will change and you have to update your Grafana deployment.

Update the Grafana datasource url like following:

Old name: `<instance_name>-nginx.<instance_namespace>.svc.cluster.local`

New name: `<instance_name>-gateway.<instance_namespace>.svc.cluster.local`


== Migrate without Service Disruption

This guide follows the official documentaton for the https://grafana.com/docs/helm-charts/mimir-distributed/v5.8.x/migration-guides/migrate-to-unified-proxy-deployment[Migration to Unified Gateway Deployment].

[TIP]
====
Please read the official documentation about the migration before you continue.
====

=== Step 1: Enable Nginx Deployment

When upgrading to this version of the component, make sure you have nginx and gateway (default) enabled:

[source,yaml]
----
components:
gateway:
enabled: true <1>
nginx:
enabled: true <2>
----
<1> In component v4.x this is enabled by default.
<2> Enable nginx deployment, this will also keep the ingress associated with the nginx deployment.

Compile and push the catalog.

=== (Optional) Keep the old Service Name

If you want to migrate to the unified gateway deployment but want to keep the service name, you need to add the following configuration:

[source,yaml]
----
components:
gateway:
service:
nameOverride: mimir-nginx <1>
----
<1> Overwrite the service name.

[IMPORTANT]
====
When you override the service name, use the correct name.
The example above is only for illustration.
====

=== Step 2: Disable Nginx Deployment

In the first step we ensured the gateway deployment is present but not yet active, this makes sure the transition to the gateway deployment has the least disruption.

Disable nginx deployment and optionally keep the service name the same as before:

[source,yaml]
----
components:
gateway:
enabled: true <1>
nginx:
enabled: false <2>
----
<1> In component v4.x this is enabled by default, you can remove that configuration.
<2> In component v4.x this is disabled by default, you can remove that configuration.
Comment thread
DebakelOrakel marked this conversation as resolved.

Compile and push the catalog.


== (Optional) Keep Nginx Deployment

To stay with the deprecated nginx deployment you need to add the following configuration:

[source,yaml]
----
components:
gateway:
enabled: false <1>
nginx:
enabled: true <2>
----
<1> Disable gateway deployment.
<2> Enable nginx deployment.
25 changes: 25 additions & 0 deletions docs/modules/ROOT/pages/how-tos/upgrade-mimir-v3-v4.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,34 @@ https://github.com/projectsyn/component-mimir/releases/tag/v4.0.0[see Release No
The component has lots of options to configure each part of the Mimir installation.
Please have a look at the xref:references/parameters.adoc[parameters documentation] for reference.

[IMPORTANT]
====
This component will automatically migrate to the unified gateway deployment.
See xref:how-tos/migrate-to-gateway.adoc[] for further instructions.
====

[IMPORTANT]
====
This component will no longer support Helm charts < v5.x of Mimir.
====

== Explanation of configuration changes

=== new default resource requests

[IMPORTANT]
====
This component changes its default resource requests and limits, please check the output of your catalog compilation and adjust if needed.
See xref:references/parameters.adoc#_components[components] and xref:references/parameters.adoc#_caches[caches] to adjust your settings.
====

This component supports the following presets:

* `none`: Use the Helm charts defaults.
* `extra-small`: Component defaults for small production deployments (default).
* `small`: Upstream defaults for small production deployments.
* `large`: Upstream defaults for large production deployments.

=== legacy `globalNodeSelector`

The values for the global node selector has moved to `global.nodeSelector`.
Expand Down
5 changes: 3 additions & 2 deletions docs/modules/ROOT/partials/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* xref:index.adoc[Home]
* xref:how-tos/upgrade-mimir-v1-v2.adoc[Upgrade component-mimir from v1 to v2]
* xref:how-tos/upgrade-mimir-v3-v4.adoc[Upgrade component-mimir from v3 to v4]
* xref:references/parameters.adoc[Parameters]
* xref:how-tos/upgrade-mimir-v1-v2.adoc[]
* xref:how-tos/upgrade-mimir-v3-v4.adoc[]
* xref:how-tos/migrate-to-gateway.adoc[]
3 changes: 3 additions & 0 deletions tests/extra-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ parameters:
replicas: 1
persistentVolume:
size: 20Gi
gateway:
service:
nameOverride: mimir-nginx

caches:
results:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ kind: Deployment
metadata:
annotations: {}
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mimir
app.kubernetes.io/version: 2.17.0
helm.sh/chart: mimir-distributed-5.8.0
name: mimir-nginx
name: mimir-gateway
namespace: syn-mimir
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/name: mimir
strategy:
Expand All @@ -27,9 +27,9 @@ spec:
metadata:
annotations:
bucketSecretVersion: '0'
checksum/config: d8e5e5d94deb56bc67ea032493d814096eed0d01b11655d587eb41ae658023b1
checksum/config: 4820f155d6cd0e9f89c0ed25fe3fefb5b0ea17af83545c8adff8195b16ac9df2
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mimir
Expand All @@ -43,15 +43,15 @@ spec:
name: mimir-bucket-secret
image: docker.io/nginxinc/nginx-unprivileged:1.28-alpine
imagePullPolicy: IfNotPresent
name: nginx
name: gateway
ports:
- containerPort: 8080
name: http-metric
name: http-metrics
protocol: TCP
readinessProbe:
httpGet:
path: /
port: http-metric
path: /ready
port: http-metrics
initialDelaySeconds: 15
timeoutSeconds: 1
resources:
Expand All @@ -68,7 +68,7 @@ spec:
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: config
name: nginx-config
subPath: nginx.conf
- mountPath: /tmp
name: tmp
Expand All @@ -86,17 +86,26 @@ spec:
topologySpreadConstraints:
- labelSelector:
matchLabels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/name: mimir
maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
volumes:
- configMap:
name: mimir-nginx
items:
- key: mimir.yaml
path: mimir.yaml
name: mimir-config
name: config
- emptyDir: {}
name: tmp
- configMap:
name: mimir-runtime
name: runtime-config
- configMap:
name: mimir-gateway-nginx
name: nginx-config
- emptyDir: {}
name: docker-entrypoint-d-override
- emptyDir: {}
name: tmp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mimir
app.kubernetes.io/version: 2.17.0
helm.sh/chart: mimir-distributed-5.8.0
name: mimir-nginx
name: mimir-gateway
namespace: syn-mimir
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/name: mimir
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ kind: Service
metadata:
annotations: {}
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mimir
app.kubernetes.io/version: 2.17.0
helm.sh/chart: mimir-distributed-5.8.0
name: mimir-nginx
name: mimir-gateway
namespace: syn-mimir
spec:
internalTrafficPolicy: Cluster
ports:
- name: http-metric
- name: http-metrics
port: 80
protocol: TCP
targetPort: http-metric
targetPort: http-metrics
- name: legacy-http-metrics
port: 8080
protocol: TCP
targetPort: http-metrics
selector:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: mimir
app.kubernetes.io/name: mimir
type: ClusterIP
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data:
server {
listen 8080;
listen [::]:8080;
client_max_body_size 540M;

if ($has_multiple_orgid_headers = 1) {
return 400 'Sending multiple X-Scope-OrgID headers is not allowed. Use a single header with | as separator instead.';
Expand All @@ -53,6 +54,11 @@ data:
auth_basic off;
}

location = /ready {
return 200 'OK';
auth_basic off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
Expand Down Expand Up @@ -128,11 +134,11 @@ data:
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/component: gateway-nginx
app.kubernetes.io/instance: mimir
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mimir
app.kubernetes.io/version: 2.17.0
helm.sh/chart: mimir-distributed-5.8.0
name: mimir-nginx
name: mimir-gateway-nginx
namespace: syn-mimir
Loading
Loading