This repository was archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[meta] upgrade test #907
Merged
Merged
[meta] upgrade test #907
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6039c78
[meta] add upgrade test for every chart
jmlrt a19009b
add readme
jmlrt 1e978f0
add elastic helm repo and update it
jmlrt b63e08f
fix tests
jmlrt 54c067d
fix version in test
jmlrt bb5386a
[kibana] upgrade to 7.10.0
jmlrt e7a2df5
disable metricbeat upgrade test for now
jmlrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| default: test | ||
|
|
||
| include ../../../helpers/examples.mk | ||
|
|
||
| CHART := 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) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Upgrade | ||
|
|
||
| This example will deploy APM Server chart using an old chart version, | ||
| then upgrade it. | ||
|
|
||
|
|
||
| ## Usage | ||
|
|
||
| * 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` | ||
|
|
||
|
|
||
| ## 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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| http: | ||
| http://localhost:8200?pretty: | ||
| status: 200 | ||
| timeout: 2000 | ||
| body: | ||
| - "8.0.0" |
This file contains hidden or 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 |
|---|---|---|
| @@ -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"] |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| default: test | ||
|
|
||
| include ../../../helpers/examples.mk | ||
|
|
||
| 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 | ||
|
|
||
| install: | ||
| ../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) --to $(TO) | ||
|
|
||
| test: install goss | ||
|
|
||
| purge: | ||
| helm del $(RELEASE) | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -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' |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| clusterName: upgrade |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| default: test | ||
|
|
||
| include ../../../helpers/examples.mk | ||
|
|
||
| CHART := 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) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Upgrade | ||
|
|
||
| This example will deploy Filebeat chart using an old chart version, | ||
| then upgrade it. | ||
|
|
||
|
|
||
| ## Usage | ||
|
|
||
| * 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` | ||
|
|
||
|
|
||
| ## 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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -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-8.0.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" |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| extraEnvs: | ||
| - name: ELASTICSEARCH_HOSTS | ||
| value: upgrade-master:9200 |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/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 <chart-name> --release <release-name> --from <version> [--to <docker-image-version>] | ||
| $0 --help | ||
|
|
||
| OPTIONS: | ||
| --chart <chart-name> | ||
| Name of the Elastic Helm chart to install (ie: elasticsearch) | ||
| --release <release-name> | ||
| Name of the Helm release to install (ie: helm-upgrade-elasticsearch) | ||
| --from <version> | ||
| Version to use for first install (ie: 7.7.0) | ||
| --to <docker-image-version> | ||
| 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" elastic/"$CHART" | ||
|
|
||
| # Upgrade | ||
| printf "Upgrading %s\n" "$RELEASE" | ||
| # shellcheck disable=SC2086 | ||
| helm upgrade --wait --timeout=1200s --install --set terminationGracePeriod=121 $TO --values values.yaml "$RELEASE" ../../ |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| default: test | ||
|
|
||
| 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) --to $(TO) | ||
|
|
||
| test: install goss | ||
|
|
||
| purge: | ||
| helm del $(RELEASE) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Upgrade | ||
|
|
||
| This example will deploy Kibana chart using an old chart version, | ||
| then upgrade it. | ||
|
|
||
|
|
||
| ## Usage | ||
|
|
||
| * 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` | ||
|
|
||
|
|
||
| ## 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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| elasticsearchHosts: "http://upgrade-master:9200" |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| default: test | ||
|
|
||
| include ../../../helpers/examples.mk | ||
|
|
||
| CHART := 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) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.