From 6039c788892416d8d658b5533a405550aa44384e Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Mon, 16 Nov 2020 18:10:46 +0100 Subject: [PATCH 1/7] [meta] add upgrade test for every chart This commit add a new test which deploy a 7.7.0 chart and upgrade it to latest version. --- apm-server/examples/upgrade/Makefile | 15 ++++ apm-server/examples/upgrade/test/goss.yaml | 6 ++ apm-server/examples/upgrade/values.yaml | 12 +++ elasticsearch/examples/upgrade/Makefile | 16 ++++ elasticsearch/examples/upgrade/test/goss.yaml | 17 +++++ elasticsearch/examples/upgrade/values.yaml | 2 + filebeat/examples/upgrade/Makefile | 15 ++++ filebeat/examples/upgrade/test/goss.yaml | 45 +++++++++++ filebeat/examples/upgrade/values.yaml | 4 + helpers/matrix.yml | 11 ++- helpers/upgrade.sh | 75 +++++++++++++++++++ kibana/examples/upgrade/Makefile | 15 ++++ kibana/examples/upgrade/test/goss.yaml | 14 ++++ kibana/examples/upgrade/values.yaml | 2 + logstash/examples/upgrade/Makefile | 15 ++++ logstash/examples/upgrade/test/goss.yaml | 43 +++++++++++ logstash/examples/upgrade/values.yaml | 1 + metricbeat/examples/upgrade/Makefile | 17 +++++ .../examples/upgrade/test/goss-metrics.yaml | 42 +++++++++++ metricbeat/examples/upgrade/test/goss.yaml | 46 ++++++++++++ metricbeat/examples/upgrade/values.yaml | 4 + 21 files changed, 414 insertions(+), 3 deletions(-) create mode 100644 apm-server/examples/upgrade/Makefile create mode 100644 apm-server/examples/upgrade/test/goss.yaml create mode 100644 apm-server/examples/upgrade/values.yaml create mode 100644 elasticsearch/examples/upgrade/Makefile create mode 100644 elasticsearch/examples/upgrade/test/goss.yaml create mode 100644 elasticsearch/examples/upgrade/values.yaml create mode 100644 filebeat/examples/upgrade/Makefile create mode 100644 filebeat/examples/upgrade/test/goss.yaml create mode 100644 filebeat/examples/upgrade/values.yaml create mode 100755 helpers/upgrade.sh create mode 100644 kibana/examples/upgrade/Makefile create mode 100644 kibana/examples/upgrade/test/goss.yaml create mode 100644 kibana/examples/upgrade/values.yaml create mode 100644 logstash/examples/upgrade/Makefile create mode 100644 logstash/examples/upgrade/test/goss.yaml create mode 100644 logstash/examples/upgrade/values.yaml create mode 100644 metricbeat/examples/upgrade/Makefile create mode 100644 metricbeat/examples/upgrade/test/goss-metrics.yaml create mode 100644 metricbeat/examples/upgrade/test/goss.yaml create mode 100644 metricbeat/examples/upgrade/values.yaml diff --git a/apm-server/examples/upgrade/Makefile b/apm-server/examples/upgrade/Makefile new file mode 100644 index 000000000..cf1da3116 --- /dev/null +++ b/apm-server/examples/upgrade/Makefile @@ -0,0 +1,15 @@ +default: test + +include ../../../helpers/examples.mk + +CHART := elastic/apm-server +RELEASE := helm-apm-server-upgrade +FROM := 7.6.0 # 7.6.0 is the first release for apm-server + +install: + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) + +test: install goss + +purge: + helm del $(RELEASE) diff --git a/apm-server/examples/upgrade/test/goss.yaml b/apm-server/examples/upgrade/test/goss.yaml new file mode 100644 index 000000000..9dccc1d29 --- /dev/null +++ b/apm-server/examples/upgrade/test/goss.yaml @@ -0,0 +1,6 @@ +http: + http://localhost:8200?pretty: + status: 200 + timeout: 2000 + body: + - '7.10.0' diff --git a/apm-server/examples/upgrade/values.yaml b/apm-server/examples/upgrade/values.yaml new file mode 100644 index 000000000..4b66615c5 --- /dev/null +++ b/apm-server/examples/upgrade/values.yaml @@ -0,0 +1,12 @@ +--- +apmConfig: + apm-server.yml: | + apm-server: + host: "0.0.0.0:8200" + + queue: {} + output.file: + enabled: false + + output.elasticsearch: + hosts: ["http://upgrade-master:9200"] diff --git a/elasticsearch/examples/upgrade/Makefile b/elasticsearch/examples/upgrade/Makefile new file mode 100644 index 000000000..7997c4092 --- /dev/null +++ b/elasticsearch/examples/upgrade/Makefile @@ -0,0 +1,16 @@ +default: test + +include ../../../helpers/examples.mk + +CHART := elastic/elasticsearch +RELEASE := helm-es-upgrade +FROM := 7.4.0 # versions before 7.4.O aren't compatible with Kubernetes >= 1.16.0 +TO := 7.10.0 # upgrade from 7.x to 8.0.0-SNAPSHOT currently doesn't work + +install: + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) --to $(TO) + +test: install goss + +purge: + helm del $(RELEASE) diff --git a/elasticsearch/examples/upgrade/test/goss.yaml b/elasticsearch/examples/upgrade/test/goss.yaml new file mode 100644 index 000000000..9f8a0b0f7 --- /dev/null +++ b/elasticsearch/examples/upgrade/test/goss.yaml @@ -0,0 +1,17 @@ +http: + http://localhost:9200/_cluster/health: + status: 200 + timeout: 2000 + body: + - 'green' + - '"number_of_nodes":3' + - '"number_of_data_nodes":3' + + http://localhost:9200: + status: 200 + timeout: 2000 + body: + - '"number" : "7.10.0"' + - '"cluster_name" : "upgrade"' + - '"name" : "upgrade-master-0"' + - 'You Know, for Search' diff --git a/elasticsearch/examples/upgrade/values.yaml b/elasticsearch/examples/upgrade/values.yaml new file mode 100644 index 000000000..de0283af4 --- /dev/null +++ b/elasticsearch/examples/upgrade/values.yaml @@ -0,0 +1,2 @@ +--- +clusterName: upgrade diff --git a/filebeat/examples/upgrade/Makefile b/filebeat/examples/upgrade/Makefile new file mode 100644 index 000000000..2644813c3 --- /dev/null +++ b/filebeat/examples/upgrade/Makefile @@ -0,0 +1,15 @@ +default: test + +include ../../../helpers/examples.mk + +CHART := elastic/filebeat +RELEASE := helm-filebeat-upgrade +FROM := 7.9.0 # registry file version 1 not supported error with previous version + +install: + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) + +test: install goss + +purge: + helm del $(RELEASE) diff --git a/filebeat/examples/upgrade/test/goss.yaml b/filebeat/examples/upgrade/test/goss.yaml new file mode 100644 index 000000000..b2feb42e7 --- /dev/null +++ b/filebeat/examples/upgrade/test/goss.yaml @@ -0,0 +1,45 @@ +port: + tcp:5066: + listening: true + ip: + - "127.0.0.1" + +mount: + /usr/share/filebeat/data: + exists: true + /run/docker.sock: + exists: true + /var/lib/docker/containers: + exists: true + opts: + - ro + /usr/share/filebeat/filebeat.yml: + exists: true + opts: + - ro + +user: + filebeat: + exists: true + uid: 1000 + gid: 1000 + +http: + http://upgrade-master:9200/_cat/indices: + status: 200 + timeout: 2000 + body: + - "filebeat-7.10.0" + +file: + /usr/share/filebeat/filebeat.yml: + exists: true + contains: + - "add_kubernetes_metadata" + - "output.elasticsearch" + +command: + cd /usr/share/filebeat && filebeat test output: + exit-status: 0 + stdout: + - "elasticsearch: http://upgrade-master:9200" diff --git a/filebeat/examples/upgrade/values.yaml b/filebeat/examples/upgrade/values.yaml new file mode 100644 index 000000000..8b230601e --- /dev/null +++ b/filebeat/examples/upgrade/values.yaml @@ -0,0 +1,4 @@ +--- +extraEnvs: + - name: ELASTICSEARCH_HOSTS + value: upgrade-master:9200 diff --git a/helpers/matrix.yml b/helpers/matrix.yml index 7dc71f9d3..2742cf5f5 100644 --- a/helpers/matrix.yml +++ b/helpers/matrix.yml @@ -11,10 +11,12 @@ ES_SUITE: - multi - oss - security + - upgrade KIBANA_SUITE: - default - oss - security + - upgrade FILEBEAT_SUITE: - default - oss @@ -23,16 +25,19 @@ METRICBEAT_SUITE: - default - oss - security + - upgrade LOGSTASH_SUITE: - default - oss - elasticsearch - security + - upgrade APM_SERVER_SUITE: - default - oss - security + - upgrade KUBERNETES_VERSION: - - '1.15' - - '1.16' - - '1.17' + - "1.15" + - "1.16" + - "1.17" diff --git a/helpers/upgrade.sh b/helpers/upgrade.sh new file mode 100755 index 000000000..955d45f67 --- /dev/null +++ b/helpers/upgrade.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# +# upgrade.sh deploy some Helm chart to a specific released version, +# then upgrade it. +# +# An optional version can be specified for Docker image tag to use for upgrade. +# This is required for master branch because upgrade from Elasticsearch 7.X +# to 8.0.0-SNAPSHOT doesn't work. +# +set -euo pipefail + +TO="" + +usage() { + cat <<-EOF + USAGE: + $0 --chart --release --from [--to ] + $0 --help + + OPTIONS: + --chart + Name of the Helm chart to install (ie: elastic/elasticsearch) + --release + Name of the Helm release to install (ie: helm-upgrade-elasticsearch) + --from + Version to use for first install (ie: 7.7.0) + --to + Version of the Docker images to use for upgrade (ie: 7.10.0) + EOF + exit 1 +} + +while [[ $# -gt 0 ]] +do + key="$1" + + case $key in + --help) + usage + ;; + --chart) + CHART="$2" + shift 2 + ;; + --release) + RELEASE="$2" + shift 2 + ;; + --from) + FROM="$2" + shift 2 + ;; + --to) + TO="--set imageTag=$2" + shift 2 + ;; + *) + log "Unrecognized argument: '$key'" + usage + ;; + esac +done + + + +helm repo add elastic https://helm.elastic.co + +# Initial install +printf "Installing %s %s\n" "$RELEASE" "$FROM" +helm upgrade --wait --timeout=1200s --install --version "$FROM" --values values.yaml "$RELEASE" "$CHART" + +# Upgrade +printf "Upgrading %s\n" "$RELEASE" +# shellcheck disable=SC2086 +helm upgrade --wait --timeout=1200s --install --set terminationGracePeriod=121 $TO --values values.yaml "$RELEASE" ../../ diff --git a/kibana/examples/upgrade/Makefile b/kibana/examples/upgrade/Makefile new file mode 100644 index 000000000..17186b065 --- /dev/null +++ b/kibana/examples/upgrade/Makefile @@ -0,0 +1,15 @@ +default: test + +include ../../../helpers/examples.mk + +CHART := elastic/kibana +RELEASE := helm-kibana-upgrade +FROM := 7.4.0 # versions before 7.4.O aren't compatible with Kubernetes >= 1.16.0 + +install: + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) + +test: install goss + +purge: + helm del $(RELEASE) diff --git a/kibana/examples/upgrade/test/goss.yaml b/kibana/examples/upgrade/test/goss.yaml new file mode 100644 index 000000000..5b3a1b28a --- /dev/null +++ b/kibana/examples/upgrade/test/goss.yaml @@ -0,0 +1,14 @@ +http: + http://localhost:5601/api/status: + status: 200 + timeout: 2000 + body: + - '"number":"7.10.0"' + + http://localhost:5601/app/kibana: + status: 200 + timeout: 2000 + + http://helm-kibana-upgrade-kibana:5601/app/kibana: + status: 200 + timeout: 2000 diff --git a/kibana/examples/upgrade/values.yaml b/kibana/examples/upgrade/values.yaml new file mode 100644 index 000000000..01d99c838 --- /dev/null +++ b/kibana/examples/upgrade/values.yaml @@ -0,0 +1,2 @@ +--- +elasticsearchHosts: "http://upgrade-master:9200" diff --git a/logstash/examples/upgrade/Makefile b/logstash/examples/upgrade/Makefile new file mode 100644 index 000000000..15ae81db3 --- /dev/null +++ b/logstash/examples/upgrade/Makefile @@ -0,0 +1,15 @@ +default: test + +include ../../../helpers/examples.mk + +CHART := elastic/logstash +RELEASE := helm-logstash-upgrade +FROM := 7.9.0 # upgrade from version < 7.9.0 is failing due to headless service breaking change + +install: + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) + +test: install goss + +purge: + helm del $(RELEASE) diff --git a/logstash/examples/upgrade/test/goss.yaml b/logstash/examples/upgrade/test/goss.yaml new file mode 100644 index 000000000..71e7b508a --- /dev/null +++ b/logstash/examples/upgrade/test/goss.yaml @@ -0,0 +1,43 @@ +user: + logstash: + exists: true + uid: 1000 + gid: 1000 + +http: + http://localhost:9600?pretty: + status: 200 + timeout: 2000 + body: + - '"host" : "helm-logstash-upgrade-logstash-0"' + - '"version" : "7.10.0"' + - '"http_address" : "0.0.0.0:9600"' + - '"name" : "helm-logstash-upgrade-logstash-0"' + - '"status" : "green"' + - '"workers" : 1' + - '"batch_size" : 125' + - '"batch_delay" : 50' + +file: + /usr/share/logstash/config/logstash.yml: + exists: true + mode: "0644" + owner: logstash + group: root + filetype: file + contains: + - 'http.host: "0.0.0.0"' + - 'xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ]' + /usr/share/logstash/pipeline/logstash.conf: + exists: true + mode: "0644" + owner: logstash + group: root + filetype: file + contains: + - "input {" + - "beats {" + - "port => 5044" + - "output {" + - "stdout {" + - "codec => rubydebug" diff --git a/logstash/examples/upgrade/values.yaml b/logstash/examples/upgrade/values.yaml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/logstash/examples/upgrade/values.yaml @@ -0,0 +1 @@ +--- diff --git a/metricbeat/examples/upgrade/Makefile b/metricbeat/examples/upgrade/Makefile new file mode 100644 index 000000000..0d5df0efe --- /dev/null +++ b/metricbeat/examples/upgrade/Makefile @@ -0,0 +1,17 @@ +default: test + +include ../../../helpers/examples.mk + +CHART := elastic/metricbeat +RELEASE := helm-metricbeat-upgrade +#FROM := 7.10.0 # upgrade from version < 7.10.0 is failing due to selector + # breaking change in https://github.com/elastic/helm-charts/pull/516 + +install: + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) + +#TODO: uncomment after 7.10.0 release +test: #install goss + +purge: + helm del $(RELEASE) diff --git a/metricbeat/examples/upgrade/test/goss-metrics.yaml b/metricbeat/examples/upgrade/test/goss-metrics.yaml new file mode 100644 index 000000000..ed1d30db3 --- /dev/null +++ b/metricbeat/examples/upgrade/test/goss-metrics.yaml @@ -0,0 +1,42 @@ +port: + tcp:5066: + listening: true + ip: + - "127.0.0.1" + +mount: + /usr/share/metricbeat/metricbeat.yml: + exists: true + opts: + - ro + +user: + metricbeat: + exists: true + uid: 1000 + gid: 1000 + +http: + http://upgrade-master:9200/_cat/indices: + status: 200 + timeout: 2000 + body: + - "metricbeat-7.10.0" + + ? "http://upgrade-master:9200/_search?q=metricset.name:state_container%20AND%20kubernetes.container.name:metricbeat" + : status: 200 + timeout: 2000 + body: + - "metricbeat-7.10.0" + +file: + /usr/share/metricbeat/metricbeat.yml: + exists: true + contains: + - "output.elasticsearch" + +command: + cd /usr/share/metricbeat && metricbeat test output: + exit-status: 0 + stdout: + - "elasticsearch: http://upgrade-master:9200" diff --git a/metricbeat/examples/upgrade/test/goss.yaml b/metricbeat/examples/upgrade/test/goss.yaml new file mode 100644 index 000000000..a8084bed6 --- /dev/null +++ b/metricbeat/examples/upgrade/test/goss.yaml @@ -0,0 +1,46 @@ +port: + tcp:5066: + listening: true + ip: + - "127.0.0.1" + +mount: + /usr/share/metricbeat/data: + exists: true + /run/docker.sock: + exists: true + /usr/share/metricbeat/metricbeat.yml: + exists: true + opts: + - ro + +user: + metricbeat: + exists: true + uid: 1000 + gid: 1000 + +http: + http://upgrade-master:9200/_cat/indices: + status: 200 + timeout: 2000 + body: + - "metricbeat-7.10.0" + ? "http://upgrade-master:9200/_search?q=metricset.name:container%20AND%20kubernetes.container.name:metricbeat" + : status: 200 + timeout: 2000 + body: + - "metricbeat-7.10.0" + +file: + /usr/share/metricbeat/metricbeat.yml: + exists: true + contains: + - "add_kubernetes_metadata" + - "output.elasticsearch" + +command: + cd /usr/share/metricbeat && metricbeat test output: + exit-status: 0 + stdout: + - "elasticsearch: http://upgrade-master:9200" diff --git a/metricbeat/examples/upgrade/values.yaml b/metricbeat/examples/upgrade/values.yaml new file mode 100644 index 000000000..8b230601e --- /dev/null +++ b/metricbeat/examples/upgrade/values.yaml @@ -0,0 +1,4 @@ +--- +extraEnvs: + - name: ELASTICSEARCH_HOSTS + value: upgrade-master:9200 From a19009bb7df4389cb2ce98dfcb1aa1a3bdb4c4ba Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 17 Nov 2020 17:08:51 +0100 Subject: [PATCH 2/7] add readme --- apm-server/examples/upgrade/README.md | 19 +++++++++++++++++++ elasticsearch/examples/upgrade/README.md | 17 +++++++++++++++++ filebeat/examples/upgrade/README.md | 19 +++++++++++++++++++ kibana/examples/upgrade/README.md | 19 +++++++++++++++++++ logstash/examples/upgrade/README.md | 17 +++++++++++++++++ metricbeat/examples/upgrade/README.md | 19 +++++++++++++++++++ 6 files changed, 110 insertions(+) create mode 100644 apm-server/examples/upgrade/README.md create mode 100644 elasticsearch/examples/upgrade/README.md create mode 100644 filebeat/examples/upgrade/README.md create mode 100644 kibana/examples/upgrade/README.md create mode 100644 logstash/examples/upgrade/README.md create mode 100644 metricbeat/examples/upgrade/README.md diff --git a/apm-server/examples/upgrade/README.md b/apm-server/examples/upgrade/README.md new file mode 100644 index 000000000..c7e418051 --- /dev/null +++ b/apm-server/examples/upgrade/README.md @@ -0,0 +1,19 @@ +# Upgrade + +This example will deploy APM Server chart using an old chart version, +then upgrade it. + + +## Usage + +* Deploy [Elasticsearch Helm chart][]. + +* Deploy and upgrade APM Server chart with the default values: `make install` + + +## Testing + +You can also run [goss integration tests][] using `make test`. + + +[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/apm-server/examples/upgrade/test/goss.yaml diff --git a/elasticsearch/examples/upgrade/README.md b/elasticsearch/examples/upgrade/README.md new file mode 100644 index 000000000..85977f52e --- /dev/null +++ b/elasticsearch/examples/upgrade/README.md @@ -0,0 +1,17 @@ +# Upgrade + +This example will deploy a 3 node Elasticsearch cluster chart using an old chart +version, then upgrade it. + + +## Usage + +* Deploy and upgrade Elasticsearch chart with the default values: `make install` + + +## Testing + +You can also run [goss integration tests][] using `make test`. + + +[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/elasticsearch/examples/upgrade/test/goss.yaml diff --git a/filebeat/examples/upgrade/README.md b/filebeat/examples/upgrade/README.md new file mode 100644 index 000000000..3b4aa532a --- /dev/null +++ b/filebeat/examples/upgrade/README.md @@ -0,0 +1,19 @@ +# Upgrade + +This example will deploy Filebeat chart using an old chart version, +then upgrade it. + + +## Usage + +* Deploy [Elasticsearch Helm chart][]. + +* Deploy and upgrade Filebeat chart with the default values: `make install` + + +## Testing + +You can also run [goss integration tests][] using `make test`. + + +[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/filebeat/examples/upgrade/test/goss.yaml diff --git a/kibana/examples/upgrade/README.md b/kibana/examples/upgrade/README.md new file mode 100644 index 000000000..1e7c9477c --- /dev/null +++ b/kibana/examples/upgrade/README.md @@ -0,0 +1,19 @@ +# Upgrade + +This example will deploy Kibana chart using an old chart version, +then upgrade it. + + +## Usage + +* Deploy [Elasticsearch Helm chart][]. + +* Deploy and upgrade Kibana chart with the default values: `make install` + + +## Testing + +You can also run [goss integration tests][] using `make test`. + + +[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/kibana/examples/upgrade/test/goss.yaml diff --git a/logstash/examples/upgrade/README.md b/logstash/examples/upgrade/README.md new file mode 100644 index 000000000..450406172 --- /dev/null +++ b/logstash/examples/upgrade/README.md @@ -0,0 +1,17 @@ +# Upgrade + +This example will deploy Logstash chart using an old chart version, +then upgrade it. + + +## Usage + +* Deploy and upgrade Logstash chart with the default values: `make install` + + +## Testing + +You can also run [goss integration tests][] using `make test`. + + +[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/logstash/examples/upgrade/test/goss.yaml diff --git a/metricbeat/examples/upgrade/README.md b/metricbeat/examples/upgrade/README.md new file mode 100644 index 000000000..d506c8835 --- /dev/null +++ b/metricbeat/examples/upgrade/README.md @@ -0,0 +1,19 @@ +# Upgrade + +This example will deploy Metricbeat chart using an old chart version, +then upgrade it. + + +## Usage + +* Deploy [Elasticsearch Helm chart][]. + +* Deploy and upgrade Metricbeat chart with the default values: `make install` + + +## Testing + +You can also run [goss integration tests][] using `make test`. + + +[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/metricbeat/examples/upgrade/test/goss.yaml From 1e978f0a58f786f8186c7369239ebf94151d5a50 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 17 Nov 2020 17:17:02 +0100 Subject: [PATCH 3/7] add elastic helm repo and update it --- apm-server/examples/upgrade/README.md | 4 +++- filebeat/examples/upgrade/README.md | 4 +++- helpers/upgrade.sh | 3 +-- kibana/examples/upgrade/README.md | 4 +++- logstash/examples/upgrade/README.md | 2 ++ metricbeat/examples/upgrade/README.md | 4 +++- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apm-server/examples/upgrade/README.md b/apm-server/examples/upgrade/README.md index c7e418051..835b3c7ed 100644 --- a/apm-server/examples/upgrade/README.md +++ b/apm-server/examples/upgrade/README.md @@ -6,7 +6,9 @@ then upgrade it. ## Usage -* Deploy [Elasticsearch Helm chart][]. +* Add the Elastic Helm charts repo: `helm repo add elastic https://helm.elastic.co` + +* Deploy [Elasticsearch Helm chart][]: `helm install elasticsearch elastic/elasticsearch` * Deploy and upgrade APM Server chart with the default values: `make install` diff --git a/filebeat/examples/upgrade/README.md b/filebeat/examples/upgrade/README.md index 3b4aa532a..fa3ee3b85 100644 --- a/filebeat/examples/upgrade/README.md +++ b/filebeat/examples/upgrade/README.md @@ -6,7 +6,9 @@ then upgrade it. ## Usage -* Deploy [Elasticsearch Helm chart][]. +* Add the Elastic Helm charts repo: `helm repo add elastic https://helm.elastic.co` + +* Deploy [Elasticsearch Helm chart][]: `helm install elasticsearch elastic/elasticsearch` * Deploy and upgrade Filebeat chart with the default values: `make install` diff --git a/helpers/upgrade.sh b/helpers/upgrade.sh index 955d45f67..b79a08121 100755 --- a/helpers/upgrade.sh +++ b/helpers/upgrade.sh @@ -61,9 +61,8 @@ do esac done - - helm repo add elastic https://helm.elastic.co +helm repo update # Initial install printf "Installing %s %s\n" "$RELEASE" "$FROM" diff --git a/kibana/examples/upgrade/README.md b/kibana/examples/upgrade/README.md index 1e7c9477c..ad28f65c6 100644 --- a/kibana/examples/upgrade/README.md +++ b/kibana/examples/upgrade/README.md @@ -6,7 +6,9 @@ then upgrade it. ## Usage -* Deploy [Elasticsearch Helm chart][]. +* Add the Elastic Helm charts repo: `helm repo add elastic https://helm.elastic.co` + +* Deploy [Elasticsearch Helm chart][]: `helm install elasticsearch elastic/elasticsearch` * Deploy and upgrade Kibana chart with the default values: `make install` diff --git a/logstash/examples/upgrade/README.md b/logstash/examples/upgrade/README.md index 450406172..c8986a070 100644 --- a/logstash/examples/upgrade/README.md +++ b/logstash/examples/upgrade/README.md @@ -6,6 +6,8 @@ then upgrade it. ## Usage +* Add the Elastic Helm charts repo: `helm repo add elastic https://helm.elastic.co` + * Deploy and upgrade Logstash chart with the default values: `make install` diff --git a/metricbeat/examples/upgrade/README.md b/metricbeat/examples/upgrade/README.md index d506c8835..4c1821b1f 100644 --- a/metricbeat/examples/upgrade/README.md +++ b/metricbeat/examples/upgrade/README.md @@ -6,7 +6,9 @@ then upgrade it. ## Usage -* Deploy [Elasticsearch Helm chart][]. +* Add the Elastic Helm charts repo: `helm repo add elastic https://helm.elastic.co` + +* Deploy [Elasticsearch Helm chart][]: `helm install elasticsearch elastic/elasticsearch` * Deploy and upgrade Metricbeat chart with the default values: `make install` From b63e08fd51ddd2674d7af9bfe870a380445933b9 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 17 Nov 2020 19:10:41 +0100 Subject: [PATCH 4/7] fix tests --- apm-server/examples/upgrade/Makefile | 2 +- elasticsearch/examples/upgrade/Makefile | 2 +- filebeat/examples/upgrade/Makefile | 2 +- helpers/matrix.yml | 1 + helpers/upgrade.sh | 5 ++--- kibana/examples/upgrade/Makefile | 2 +- logstash/examples/upgrade/Makefile | 2 +- metricbeat/examples/upgrade/Makefile | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apm-server/examples/upgrade/Makefile b/apm-server/examples/upgrade/Makefile index cf1da3116..02ea4dbcb 100644 --- a/apm-server/examples/upgrade/Makefile +++ b/apm-server/examples/upgrade/Makefile @@ -2,7 +2,7 @@ default: test include ../../../helpers/examples.mk -CHART := elastic/apm-server +CHART := apm-server RELEASE := helm-apm-server-upgrade FROM := 7.6.0 # 7.6.0 is the first release for apm-server diff --git a/elasticsearch/examples/upgrade/Makefile b/elasticsearch/examples/upgrade/Makefile index 7997c4092..58dd7d4a8 100644 --- a/elasticsearch/examples/upgrade/Makefile +++ b/elasticsearch/examples/upgrade/Makefile @@ -2,7 +2,7 @@ default: test include ../../../helpers/examples.mk -CHART := elastic/elasticsearch +CHART := elasticsearch RELEASE := helm-es-upgrade FROM := 7.4.0 # versions before 7.4.O aren't compatible with Kubernetes >= 1.16.0 TO := 7.10.0 # upgrade from 7.x to 8.0.0-SNAPSHOT currently doesn't work diff --git a/filebeat/examples/upgrade/Makefile b/filebeat/examples/upgrade/Makefile index 2644813c3..252b39250 100644 --- a/filebeat/examples/upgrade/Makefile +++ b/filebeat/examples/upgrade/Makefile @@ -2,7 +2,7 @@ default: test include ../../../helpers/examples.mk -CHART := elastic/filebeat +CHART := filebeat RELEASE := helm-filebeat-upgrade FROM := 7.9.0 # registry file version 1 not supported error with previous version diff --git a/helpers/matrix.yml b/helpers/matrix.yml index 2742cf5f5..aa2f4b3c4 100644 --- a/helpers/matrix.yml +++ b/helpers/matrix.yml @@ -21,6 +21,7 @@ FILEBEAT_SUITE: - default - oss - security + - upgrade METRICBEAT_SUITE: - default - oss diff --git a/helpers/upgrade.sh b/helpers/upgrade.sh index b79a08121..269b64d8a 100755 --- a/helpers/upgrade.sh +++ b/helpers/upgrade.sh @@ -19,7 +19,7 @@ usage() { OPTIONS: --chart - Name of the Helm chart to install (ie: elastic/elasticsearch) + Name of the Elastic Helm chart to install (ie: elasticsearch) --release Name of the Helm release to install (ie: helm-upgrade-elasticsearch) --from @@ -62,11 +62,10 @@ do done helm repo add elastic https://helm.elastic.co -helm repo update # Initial install printf "Installing %s %s\n" "$RELEASE" "$FROM" -helm upgrade --wait --timeout=1200s --install --version "$FROM" --values values.yaml "$RELEASE" "$CHART" +helm upgrade --wait --timeout=1200s --install --version "$FROM" --values values.yaml "$RELEASE" elastic/"$CHART" # Upgrade printf "Upgrading %s\n" "$RELEASE" diff --git a/kibana/examples/upgrade/Makefile b/kibana/examples/upgrade/Makefile index 17186b065..6ccd8f62b 100644 --- a/kibana/examples/upgrade/Makefile +++ b/kibana/examples/upgrade/Makefile @@ -2,7 +2,7 @@ default: test include ../../../helpers/examples.mk -CHART := elastic/kibana +CHART := kibana RELEASE := helm-kibana-upgrade FROM := 7.4.0 # versions before 7.4.O aren't compatible with Kubernetes >= 1.16.0 diff --git a/logstash/examples/upgrade/Makefile b/logstash/examples/upgrade/Makefile index 15ae81db3..db739a141 100644 --- a/logstash/examples/upgrade/Makefile +++ b/logstash/examples/upgrade/Makefile @@ -2,7 +2,7 @@ default: test include ../../../helpers/examples.mk -CHART := elastic/logstash +CHART := logstash RELEASE := helm-logstash-upgrade FROM := 7.9.0 # upgrade from version < 7.9.0 is failing due to headless service breaking change diff --git a/metricbeat/examples/upgrade/Makefile b/metricbeat/examples/upgrade/Makefile index 0d5df0efe..d2d8d8509 100644 --- a/metricbeat/examples/upgrade/Makefile +++ b/metricbeat/examples/upgrade/Makefile @@ -2,7 +2,7 @@ default: test include ../../../helpers/examples.mk -CHART := elastic/metricbeat +CHART := metricbeat RELEASE := helm-metricbeat-upgrade #FROM := 7.10.0 # upgrade from version < 7.10.0 is failing due to selector # breaking change in https://github.com/elastic/helm-charts/pull/516 From 54c067d3882d0b67a08d188d61bb0e8710d8e2a8 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 17 Nov 2020 19:41:14 +0100 Subject: [PATCH 5/7] fix version in test --- apm-server/examples/upgrade/test/goss.yaml | 2 +- filebeat/examples/upgrade/test/goss.yaml | 2 +- kibana/examples/upgrade/test/goss.yaml | 2 +- logstash/examples/upgrade/test/goss.yaml | 2 +- metricbeat/examples/upgrade/test/goss.yaml | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apm-server/examples/upgrade/test/goss.yaml b/apm-server/examples/upgrade/test/goss.yaml index 9dccc1d29..5dbc51660 100644 --- a/apm-server/examples/upgrade/test/goss.yaml +++ b/apm-server/examples/upgrade/test/goss.yaml @@ -3,4 +3,4 @@ http: status: 200 timeout: 2000 body: - - '7.10.0' + - "8.0.0" diff --git a/filebeat/examples/upgrade/test/goss.yaml b/filebeat/examples/upgrade/test/goss.yaml index b2feb42e7..b71a24325 100644 --- a/filebeat/examples/upgrade/test/goss.yaml +++ b/filebeat/examples/upgrade/test/goss.yaml @@ -29,7 +29,7 @@ http: status: 200 timeout: 2000 body: - - "filebeat-7.10.0" + - "filebeat-8.0.0" file: /usr/share/filebeat/filebeat.yml: diff --git a/kibana/examples/upgrade/test/goss.yaml b/kibana/examples/upgrade/test/goss.yaml index 5b3a1b28a..f2ccdb607 100644 --- a/kibana/examples/upgrade/test/goss.yaml +++ b/kibana/examples/upgrade/test/goss.yaml @@ -3,7 +3,7 @@ http: status: 200 timeout: 2000 body: - - '"number":"7.10.0"' + - '"number":"8.0.0"' http://localhost:5601/app/kibana: status: 200 diff --git a/logstash/examples/upgrade/test/goss.yaml b/logstash/examples/upgrade/test/goss.yaml index 71e7b508a..f58d38d05 100644 --- a/logstash/examples/upgrade/test/goss.yaml +++ b/logstash/examples/upgrade/test/goss.yaml @@ -10,7 +10,7 @@ http: timeout: 2000 body: - '"host" : "helm-logstash-upgrade-logstash-0"' - - '"version" : "7.10.0"' + - '"version" : "8.0.0"' - '"http_address" : "0.0.0.0:9600"' - '"name" : "helm-logstash-upgrade-logstash-0"' - '"status" : "green"' diff --git a/metricbeat/examples/upgrade/test/goss.yaml b/metricbeat/examples/upgrade/test/goss.yaml index a8084bed6..a0480583c 100644 --- a/metricbeat/examples/upgrade/test/goss.yaml +++ b/metricbeat/examples/upgrade/test/goss.yaml @@ -25,12 +25,12 @@ http: status: 200 timeout: 2000 body: - - "metricbeat-7.10.0" + - "metricbeat-8.0.0" ? "http://upgrade-master:9200/_search?q=metricset.name:container%20AND%20kubernetes.container.name:metricbeat" : status: 200 timeout: 2000 body: - - "metricbeat-7.10.0" + - "metricbeat-8.0.0" file: /usr/share/metricbeat/metricbeat.yml: From bb5386aefc4e6a3b56667dc4faf3f2a4636ed806 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 17 Nov 2020 21:04:21 +0100 Subject: [PATCH 6/7] [kibana] upgrade to 7.10.0 --- kibana/examples/upgrade/Makefile | 3 ++- kibana/examples/upgrade/test/goss.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kibana/examples/upgrade/Makefile b/kibana/examples/upgrade/Makefile index 6ccd8f62b..6fcb2103e 100644 --- a/kibana/examples/upgrade/Makefile +++ b/kibana/examples/upgrade/Makefile @@ -5,9 +5,10 @@ include ../../../helpers/examples.mk CHART := kibana RELEASE := helm-kibana-upgrade FROM := 7.4.0 # versions before 7.4.O aren't compatible with Kubernetes >= 1.16.0 +TO := 7.10.0 # required to use with Elasticsearch 7.10.0 install: - ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) + ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) --to $(TO) test: install goss diff --git a/kibana/examples/upgrade/test/goss.yaml b/kibana/examples/upgrade/test/goss.yaml index f2ccdb607..5b3a1b28a 100644 --- a/kibana/examples/upgrade/test/goss.yaml +++ b/kibana/examples/upgrade/test/goss.yaml @@ -3,7 +3,7 @@ http: status: 200 timeout: 2000 body: - - '"number":"8.0.0"' + - '"number":"7.10.0"' http://localhost:5601/app/kibana: status: 200 From e7a2df58b12a3b2cae591d7ab05a88b40aba1c28 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Thu, 19 Nov 2020 09:34:23 +0100 Subject: [PATCH 7/7] disable metricbeat upgrade test for now --- helpers/matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/matrix.yml b/helpers/matrix.yml index aa2f4b3c4..a8fd93a32 100644 --- a/helpers/matrix.yml +++ b/helpers/matrix.yml @@ -26,7 +26,7 @@ METRICBEAT_SUITE: - default - oss - security - - upgrade + #- upgrade TODO: uncomment after 7.10.0 release LOGSTASH_SUITE: - default - oss