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.
[elasticsearch] Add upgrade integration test
This test will install the latest chart release and then attempt to upgrade to what is currently in git. This is designed to test two things. 1. That any changes do not happen to the statefulset that isn't allowed by Kubernetes. An example of this happening is #94 where the change was not caught as part of pull request testing but was luckily caught during manual testing before the release. 2. That a rolling upgrade actually works and results in a healthy cluster at the end. The test will always override the "terminationGracePeriod" to make sure that a rolling upgrade is always done even if there are no changes. Kubectl and helm have also been updated to the latest releases. Oddly enough there was a breaking change in the mock value used for release names where it is now lowercased for some reason. The kubectl upgraded was needed to get the handy timeout flag for the `kubectl rollout status`command to make sure that jobs don't hang forever if something does actually go wrong. This command is needed because the `helm --wait` flag only works `apps/v1` resources. See helm/helm#3173 for more information.
- Loading branch information
Showing
6 changed files
with
46 additions
and
4 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,22 @@ | ||
default: test | ||
|
||
include ../../../helpers/examples.mk | ||
|
||
RELEASE := helm-es-upgrade | ||
|
||
# Right now the version is hardcoded because helm install will ignore | ||
# anything with an alpha tag when trying to install the latest release | ||
# This hardcoding can be removed once we drop the alpha tag | ||
# The "--set terminationGracePeriod=121" always makes sure that a rolling | ||
# upgrade is forced for this test | ||
install: | ||
helm repo add elastic https://helm.elastic.co && \ | ||
helm upgrade --wait --timeout=600 --install $(RELEASE) elastic/elasticsearch --version 7.0.0-alpha1 --set clusterName=upgrade ; \ | ||
kubectl rollout status sts/upgrade-master --timeout=600s | ||
helm upgrade --wait --timeout=600 --set terminationGracePeriod=121 --install $(RELEASE) ../../ --set clusterName=upgrade ; \ | ||
kubectl rollout status sts/upgrade-master --timeout=600s | ||
|
||
test: install goss | ||
|
||
purge: | ||
helm del --purge $(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,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.0.0"' | ||
- '"cluster_name" : "upgrade"' | ||
- '"name" : "upgrade-master-0"' | ||
- 'You Know, for Search' |
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,6 +1,8 @@ | ||
FROM python:2.7-onbuild | ||
|
||
RUN wget https://storage.googleapis.com/kubernetes-helm/helm-v2.7.2-linux-amd64.tar.gz && \ | ||
tar xfv helm-v2.7.2-linux-amd64.tar.gz && \ | ||
ENV HELM_VERSION=2.13.1 | ||
|
||
RUN wget https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz && \ | ||
tar xfv helm-v${HELM_VERSION}-linux-amd64.tar.gz && \ | ||
mv linux-amd64/helm /usr/local/bin/ && \ | ||
rm -rf linux-amd64 |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ ES_SUITE: | |
- default | ||
- multi | ||
- security | ||
- upgrade | ||
- 5.x | ||
- 6.x | ||
KIBANA_SUITE: | ||
|
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