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.
use some shell script based on existing elasticsearch upgrade test
- Loading branch information
Showing
18 changed files
with
106 additions
and
387 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 was deleted.
Oops, something went wrong.
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,4 @@ | ||
--- | ||
apmConfig: | ||
apm-server.yml: | | ||
apm-server: | ||
|
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 was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <chart-name> --release <release-name> --from <version> [--to <docker-image-version>] | ||
$0 --help | ||
OPTIONS: | ||
--chart <chart-name> | ||
Name of the Helm chart to install (ie: elastic/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" "$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
Oops, something went wrong.