-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: remove replacing values in configuration marked by 'replace' …
…suffix make values in configuration for otelcol dependended on otelcol parameters in values.yaml removes "otelcol.k8s.cluster.name" which was added in #1721 and it is no longer in use this pull request reverts changes introduced in #1721 related to #1729
- Loading branch information
1 parent
3663de6
commit 98dee38
Showing
7 changed files
with
174 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,119 @@ | ||
# Kubernetes Collection `v3.0.0` - Breaking Changes | ||
|
||
<<<<<<< HEAD | ||
Moved to [/docs/v3-migration-doc.md](/docs/v3-migration-doc.md) | ||
======= | ||
- [Changes](#changes) | ||
- [How to upgrade](#how-to-upgrade) | ||
- [Requirements](#requirements) | ||
- [Manual steps](#manual-steps) | ||
- [Upgrade kube-prometheus-stack](#upgrade-kube-prometheus-stack) | ||
- [Replace special configuration values marked by 'replace' suffix](#replace-special-configuration-values-marked-by-replace-suffix) | ||
|
||
Based on the feedback from our users, we will be introducing several changes | ||
to the Sumo Logic Kubernetes Collection solution. | ||
|
||
In this document we detail the changes as well as the exact steps for migration. | ||
|
||
## Changes | ||
|
||
- Upgrading kube-prometheus stack | ||
|
||
We are updating Kube-prometheus-stack to newest available version. | ||
Major feature related to that change is upgrading kube-state-metrics to v2 | ||
|
||
- Removing mechanism to replace values in configuration for traces marked by 'replace' suffix, | ||
following special values in configuration are no longer automatically replaced and they need to be changed: | ||
|
||
- `exporters.otlptraces.endpoint.replace` | ||
- `exporters.otlpmetrics.endpoint.replace` | ||
- `processors.source.collector.replace` | ||
- `processors.source.name.replace` | ||
- `processors.source.category.replace` | ||
- `processors.source.category_prefix.replace` | ||
- `processors.source.category_replace_dash.replace` | ||
- `processors.source.exclude_namespace_regex.replace` | ||
- `processors.source.exclude_pod_regex.replace` | ||
- `processors.source.exclude_container_regex.replace` | ||
- `processors.source.exclude_host_regex.replace` | ||
- `processors.resource.cluster.replace` | ||
- `exporters.sumologic.source_name.replace` | ||
- `exporters.sumologic.source_category.replace` | ||
|
||
## How to upgrade | ||
|
||
### Requirements | ||
|
||
- `helm3` | ||
- `kubectl` | ||
- `jq` | ||
|
||
### Manual steps | ||
|
||
1. Perform required manual steps: | ||
- [Upgrade kube-prometheus-stack](#upgrade-kube-prometheus-stack) | ||
|
||
#### Upgrade kube-prometheus-stack | ||
|
||
Upgrade of kube-prometheus-stack is a breaking change and requires manual steps: | ||
|
||
- Upgrading prometheus CRDs: | ||
|
||
```bash | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.58.0/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml | ||
``` | ||
|
||
due to: | ||
|
||
```text | ||
Error: UPGRADE FAILED: error validating "": error validating data: ValidationError(Prometheus.spec): unknown field "shards" in com.coreos.monitoring.v1.Prometheus.spec | ||
``` | ||
|
||
- Patching `kube-state-metrics` deployment: | ||
|
||
```bash | ||
kubectl get deployment \ | ||
--namespace="${NAMESPACE}" \ | ||
--selector 'app.kubernetes.io/name=kube-state-metrics' \ | ||
-o json | \ | ||
jq ". | .items[].spec.selector.matchLabels[\"app.kubernetes.io/instance\"] |= \"${HELM_RELEASE_NAME}\"" | \ | ||
kubectl apply \ | ||
--namespace="${NAMESPACE}" \ | ||
--force \ | ||
--filename - | ||
``` | ||
|
||
due to: | ||
|
||
```text | ||
Error: UPGRADE FAILED: cannot patch "collection-kube-state-metrics" with kind Deployment: Deployment.apps "collection-kube-state-metrics" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"collection", "app.kubernetes.io/name":"kube-state-metrics"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable | ||
``` | ||
|
||
### Replace special configuration values marked by 'replace' suffix | ||
|
||
Mechanism to replace special configuration values for traces marked by 'replace' suffix was removed and following special values in configuration are no longer automatically replaced and they need to be changed: | ||
|
||
- `exporters.otlptraces.endpoint.replace` | ||
- `exporters.otlpmetrics.endpoint.replace` | ||
- `processors.source.collector.replace` | ||
- `processors.source.name.replace` | ||
- `processors.source.category.replace` | ||
- `processors.source.category_prefix.replace` | ||
- `processors.source.category_replace_dash.replace` | ||
- `processors.source.exclude_namespace_regex.replace` | ||
- `processors.source.exclude_pod_regex.replace` | ||
- `processors.source.exclude_container_regex.replace` | ||
- `processors.source.exclude_host_regex.replace` | ||
- `processors.resource.cluster.replace` | ||
- `exporters.sumologic.source_name.replace` | ||
- `exporters.sumologic.source_category.replace` | ||
|
||
Above special configuration values can be replaced either to direct values or be set as reference to other parameters form `values.yaml`. | ||
>>>>>>> 4892a552 (chore!: remove replacing values in configuration marked by 'replace' suffix) |
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 |
---|---|---|
@@ -1,6 +1 @@ | ||
{{- $yamlFile := toYaml $.Values.otelagent.config }} | ||
{{- $otelTracesService := include "traces.otelagent.exporter.endpoint" . }} | ||
{{- $yamlFile = replace "exporters.otlptraces.endpoint.replace" $otelTracesService $yamlFile }} | ||
{{- $otelMetricsService := printf "%s.%s" ( include "sumologic.metadata.name.otelcol.service-metrics" . ) .Release.Namespace }} | ||
{{- $yamlFile = replace "exporters.otlpmetrics.endpoint.replace" $otelMetricsService $yamlFile }} | ||
{{ tpl ($yamlFile | replace ": '{{" ": {{" | replace "}}'" "}}") . | nindent 2 }} | ||
{{ tpl (toYaml .Values.otelagent.config | replace ": '{{" ": {{" | replace "}}'" "}}") . | nindent 2 }} |
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 |
---|---|---|
@@ -1,26 +1 @@ | ||
{{- $yamlFile := toYaml $.Values.otelcol.config }} | ||
{{- $_collector := .Values.sumologic.collectorName | default .Values.sumologic.clusterName | quote }} | ||
{{- $sourceName := .Values.otelcol.sourceMetadata.sourceName | quote }} | ||
{{- $sourceCategory := .Values.otelcol.sourceMetadata.sourceCategory | quote }} | ||
{{- $sourceCategoryPrefix := .Values.otelcol.sourceMetadata.sourceCategoryPrefix | quote }} | ||
{{- $sourceCategoryReplaceDash := .Values.otelcol.sourceMetadata.sourceCategoryReplaceDash | quote }} | ||
{{- $excludeNamespaceRegex := .Values.otelcol.sourceMetadata.excludeNamespaceRegex | quote }} | ||
{{- $excludePodRegex := .Values.otelcol.sourceMetadata.excludePodRegex | quote }} | ||
{{- $excludeContainerRegex := .Values.otelcol.sourceMetadata.excludeContainerRegex | quote }} | ||
{{- $excludeHostRegex := .Values.otelcol.sourceMetadata.excludeHostRegex | quote }} | ||
{{- $clusterName := include "sumologic.clusterNameReplaceSpaceWithDash" . }} | ||
|
||
{{- $yamlFile := replace "processors.source.collector.replace" $_collector $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.name.replace" $sourceName $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.category.replace" $sourceCategory $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.category_prefix.replace" $sourceCategoryPrefix $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.category_replace_dash.replace" $sourceCategoryReplaceDash $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.exclude_namespace_regex.replace" $excludeNamespaceRegex $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.exclude_pod_regex.replace" $excludePodRegex $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.exclude_container_regex.replace" $excludeContainerRegex $yamlFile }} | ||
{{- $yamlFile := replace "processors.source.exclude_host_regex.replace" $excludeHostRegex $yamlFile }} | ||
{{- $yamlFile := replace "processors.resource.cluster.replace" $clusterName $yamlFile }} | ||
{{- $yamlFile := replace "exporters.sumologic.source_name.replace" $sourceName $yamlFile }} | ||
{{- $yamlFile := replace "exporters.sumologic.source_category.replace" $sourceCategory $yamlFile }} | ||
|
||
{{- tpl ($yamlFile | replace ": '{{" ": {{" | replace "}}'" "}}") . | nindent 2 }} | ||
{{- tpl (toYaml .Values.otelcol.config | replace ": '{{" ": {{" | replace "}}'" "}}") . | nindent 2 }} |
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