-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from percona/EVEREST-1512
EVEREST-1512 | Support for running pre-upgrade checks
- Loading branch information
Showing
15 changed files
with
90 additions
and
23 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
dependencies: | ||
- name: common | ||
repository: file://charts/common | ||
version: 0.0.3 | ||
version: 0.0.4 | ||
- name: everest-db-namespace | ||
repository: file://charts/everest-db-namespace | ||
version: 0.0.0 | ||
digest: sha256:99b7426a3f8df9d34dbdc6be2934e6bbde5351b5aa8f0ce4ce78ec18451c8b55 | ||
generated: "2024-10-31T16:32:12.88258+05:30" | ||
digest: sha256:2b5ec4cba791a9062cafe0a4eced850516b1f28b53b32a2f4a6787e9c941cbee | ||
generated: "2024-11-05T14:31:28.077684+05:30" |
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
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 |
---|---|---|
|
@@ -2,8 +2,8 @@ apiVersion: v2 | |
name: common | ||
description: A library chart for Everest containing common resources. | ||
type: library | ||
version: 0.0.3 | ||
appVersion: "0.0.2" | ||
version: 0.0.4 | ||
appVersion: "0.0.3" | ||
maintainers: | ||
- name: mayankshah1607 | ||
email: [email protected] | ||
|
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
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
38 changes: 38 additions & 0 deletions
38
charts/everest/charts/common/templates/_upgrade_checks.yaml.tpl
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,38 @@ | ||
# | ||
# @param .namespace The namespace where the operator is installed | ||
# @param .version Version to upgrade to | ||
# @param .versionMetadataURL The URL of the version metadata service | ||
# | ||
{{- define "everest.preUpgradeChecks" }} | ||
{{- $hookName := printf "everest-helm-pre-upgrade-hook" }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ $hookName }}-{{ randNumeric 6 }} | ||
namespace: {{ .namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-upgrade | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- image: alpine:3.20 | ||
name: {{ $hookName }} | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m) | ||
VERSION={{ .version }} | ||
apk add --no-cache --quiet curl | ||
curl -sSL -o everestctl https://github.com/percona/everest/releases/download/v${VERSION}/everestctl-${OS}-${ARCH} | ||
chmod -R 777 ./everestctl | ||
|
||
echo "Checking requirements for upgrade to version ${VERSION}" | ||
./everestctl upgrade --dry-run --version-metadata-url={{ .versionMetadataURL }} | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: OnFailure | ||
terminationGracePeriodSeconds: 30 | ||
{{- end }} |
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,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: file://../common | ||
version: 0.0.3 | ||
digest: sha256:9c473ddc333f399701ca42304b7c24defb59270a6e04d75254be0ccf6eec438a | ||
generated: "2024-10-31T16:32:16.267628+05:30" | ||
version: 0.0.4 | ||
digest: sha256:d4b492b530b0ae0b3234a3d287a2d3873c99d3dd273c569e82e6eeb83380abc9 | ||
generated: "2024-11-05T14:31:44.457971+05:30" |
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
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,3 @@ | ||
{{- if .Values.upgrade.preflightChecks }} | ||
{{- include "everest.preUpgradeChecks" (dict "namespace" (include "everest.namespace" .) "version" .Chart.Version "versionMetadataURL" .Values.versionMetadataURL) }} | ||
{{- end }} |
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