diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md deleted file mode 100644 index e6a39c5c9..000000000 --- a/BREAKING_CHANGES.md +++ /dev/null @@ -1,77 +0,0 @@ -# Breaking changes - - - - -- [6.8.9 - 2020/05/13](#689---20200513) - - [Known Issues](#known-issues) - - [GA support](#ga-support) - - [New branching model](#new-branching-model) - - [Filebeat container inputs](#filebeat-container-inputs) - - [Metricbeat upgrade issue](#metricbeat-upgrade-issue) - - [Metricbeat split values for daemonset and deployment](#metricbeat-split-values-for-daemonset-and-deployment) - - - - - - -## 6.8.9 - 2020/05/13 - -### Known Issues - -Elasticsearch nodes could be restarted too quickly during an upgrade or rolling restart, potentially resulting in service disruption. -This is due to a bug introduced by the changes to the Elasticsearch `readinessProbe` in [#586][]. - -### GA support - -Elasticsearch, Kibana, Filebeat and Metricbeat are moving from beta to GA and -are supported by Elastic following these limitations: -- only released charts coming from [Elastic Helm repo][] or -[GitHub releases][] are supported. -- released charts are only supported when using the same chart version and -application version (ie: using 7.7.0 chart with 6.8.8 or 7.6.2 application is -not supported). - -### New branching model - -Elastic Helm charts repository is now following a [new branching model][]: -- `master` branch is now a development branch for next major release. -- new `7.x` branch is a development branch for next minor release using SNAPSHOT -Docker images. -- new `7.7` branch is a development branch for next patch release using SNAPSHOT -Docker images - -### Filebeat container inputs - -Filebeat chart default config is now using [container input][] instead of -[docker input][] in [#568][]. - -### Metricbeat upgrade issue - -Metricbeat upgrade are failing with -`spec.selector: Invalid value: ... field is immutable` error. This is related to -Metricbeat deployment selector including chart version which is not immutable. -You should use `helm upgrade --force` to upgrade Metricbeat. See [#621][] for -more details. - -### Metricbeat split values for daemonset and deployment - -Metricbeat is now using dedicated values for daemonset and deployment config. -The old values are still working but are now deprecated. See [#572][] for more -details. - -[#94]: https://github.com/elastic/helm-charts/pull/94 -[#352]: https://github.com/elastic/helm-charts/pull/352 -[#458]: https://github.com/elastic/helm-charts/pull/458 -[#540]: https://github.com/elastic/helm-charts/pull/540 -[#568]: https://github.com/elastic/helm-charts/pull/568 -[#572]: https://github.com/elastic/helm-charts/pull/572 -[#586]: https://github.com/elastic/helm-charts/pull/586 -[#621]: https://github.com/elastic/helm-charts/pull/621 -[container input]: https://www.elastic.co/guide/en/beats/filebeat/7.7/filebeat-input-container.html -[docker input]: https://www.elastic.co/guide/en/beats/filebeat/7.7/filebeat-input-docker.html -[elastic helm repo]: https://helm.elastic.co -[github releases]: https://github.com/elastic/helm-charts/releases -[new branching model]: https://github.com/elastic/helm-charts/blob/master/CONTRIBUTING.md#branching -[kube-state-metrics]: https://github.com/helm/charts/tree/master/stable/kube-state-metrics diff --git a/metricbeat/templates/deployment.yaml b/metricbeat/templates/deployment.yaml index d612311c2..830438835 100644 --- a/metricbeat/templates/deployment.yaml +++ b/metricbeat/templates/deployment.yaml @@ -72,6 +72,10 @@ spec: image: "{{ .Values.image }}:{{ .Values.imageTag }}" imagePullPolicy: "{{ .Values.imagePullPolicy }}" args: + {{- if index .Values "metricbeatConfig" "kube-state-metrics-metricbeat.yml" }} + - "-c" + - "/usr/share/metricbeat/kube-state-metrics-metricbeat.yml" + {{- end }} - "-e" - "-E" - "http.enabled=true" diff --git a/metricbeat/tests/metricbeat_test.py b/metricbeat/tests/metricbeat_test.py index 83265498d..1e0e407d2 100644 --- a/metricbeat/tests/metricbeat_test.py +++ b/metricbeat/tests/metricbeat_test.py @@ -537,48 +537,77 @@ def test_adding_in_deprecated_metricbeat_config(): nestedkey: value dot.notation: test - other-config.yml: | + kube-state-metrics-metricbeat.yml: | hello = world """ r = helm_template(config) c = r["configmap"][name + "-config"]["data"] assert "metricbeat.yml" in c - assert "other-config.yml" in c + assert "kube-state-metrics-metricbeat.yml" in c assert "nestedkey: value" in c["metricbeat.yml"] assert "dot.notation: test" in c["metricbeat.yml"] - assert "hello = world" in c["other-config.yml"] + assert "hello = world" in c["kube-state-metrics-metricbeat.yml"] - d = r["daemonset"][name]["spec"]["template"]["spec"] + daemonset = r["daemonset"][name]["spec"]["template"]["spec"] assert { "configMap": {"name": name + "-config", "defaultMode": 0o600}, "name": project + "-config", - } in d["volumes"] + } in daemonset["volumes"] assert { "mountPath": "/usr/share/metricbeat/metricbeat.yml", "name": project + "-config", "subPath": "metricbeat.yml", "readOnly": True, - } in d["containers"][0]["volumeMounts"] + } in daemonset["containers"][0]["volumeMounts"] assert { - "mountPath": "/usr/share/metricbeat/other-config.yml", + "mountPath": "/usr/share/metricbeat/kube-state-metrics-metricbeat.yml", "name": project + "-config", - "subPath": "other-config.yml", + "subPath": "kube-state-metrics-metricbeat.yml", "readOnly": True, - } in d["containers"][0]["volumeMounts"] + } in daemonset["containers"][0]["volumeMounts"] assert ( "configChecksum" in r["daemonset"][name]["spec"]["template"]["metadata"]["annotations"] ) + deployment = r["deployment"][name + "-metrics"]["spec"]["template"]["spec"] + + assert { + "configMap": {"name": name + "-config", "defaultMode": 0o600}, + "name": project + "-config", + } in deployment["volumes"] + assert { + "mountPath": "/usr/share/metricbeat/metricbeat.yml", + "name": project + "-config", + "subPath": "metricbeat.yml", + "readOnly": True, + } in deployment["containers"][0]["volumeMounts"] + assert { + "mountPath": "/usr/share/metricbeat/kube-state-metrics-metricbeat.yml", + "name": project + "-config", + "subPath": "kube-state-metrics-metricbeat.yml", + "readOnly": True, + } in deployment["containers"][0]["volumeMounts"] + assert ("/usr/share/metricbeat/kube-state-metrics-metricbeat.yml") in deployment[ + "containers" + ][0]["args"] + + assert ( + "configChecksum" + in r["deployment"][name + "-metrics"]["spec"]["template"]["metadata"][ + "annotations" + ] + ) + def test_adding_a_secret_mount(): config = """ -daemonset: +daemonset: secretMounts: - name: elastic-certificates secretName: elastic-certificates-name @@ -614,7 +643,7 @@ def test_adding_a_secret_mount(): } not in r["deployment"][name + "-metrics"]["spec"]["template"]["spec"]["volumes"] config = """ -deployment: +deployment: secretMounts: - name: elastic-certificates secretName: elastic-certificates-name