This repository has been 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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
27 changed files
with
492 additions
and
20 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
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 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 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: | ||
- "7.11.0" |
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 |
---|---|---|
@@ -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 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,27 +1,17 @@ | ||
# Upgrade | ||
|
||
This example will deploy a 3 node Elasticsearch cluster using an old chart version, | ||
then upgrade it to version 7.11.0-SNAPSHOT. | ||
|
||
The following upgrades are tested: | ||
- Upgrade from [7.0.0-alpha1][] version on K8S <1.16 | ||
- Upgrade from [7.4.0][] version on K8S >=1.16 (Elasticsearch chart < 7.4.0 are | ||
not compatible with K8S >= 1.16) | ||
This example will deploy a 3 node Elasticsearch cluster chart using an old chart | ||
version, then upgrade it. | ||
|
||
|
||
## Usage | ||
|
||
Running `make install` command will do first install and 7.11.0-SNAPSHOT upgrade. | ||
|
||
Note: [jq][] is a requirement for this make target. | ||
* Deploy and upgrade Elasticsearch chart with the default values: `make install` | ||
|
||
|
||
## Testing | ||
|
||
You can also run [goss integration tests][] using `make test`. | ||
|
||
|
||
[7.0.0-alpha1]: https://github.com/elastic/helm-charts/releases/tag/7.0.0-alpha1 | ||
[7.4.0]: https://github.com/elastic/helm-charts/releases/tag/7.4.0 | ||
[goss integration tests]: https://github.com/elastic/helm-charts/tree/7.x/elasticsearch/examples/upgrade/test/goss.yaml | ||
[jq]: https://stedolan.github.io/jq/ | ||
[goss integration tests]: https://github.com/elastic/helm-charts/tree/master/elasticsearch/examples/upgrade/test/goss.yaml |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
clusterName: upgrade |
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 |
---|---|---|
@@ -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 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 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-7.11.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 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 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 |
---|---|---|
@@ -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 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 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 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 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 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.