Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
CORTX-31239: Support variable timeout values in deploy-cortx-cloud.sh (
Browse files Browse the repository at this point in the history
…#234)

* CORTX-31239: Support variable timeout values in deploy-cortx-cloud.sh

There is a "wait" after each of the cortx helm charts
are deployed.  This wait is guarded by a timeout.
Prior to this change the timeout values were hard-coded.

With this change in environment variable can override
the timeout value.  The supported environment
variables are:

  CORTX_DEPLOY_CONTROL_TIMEOUT (default 300s)
  CORTX_DEPLOY_DATA_TIMEOUT (default 300s)
  CORTX_DEPLOY_SERVER_TIMEOUT (default 300s)
  CORTX_DEPLOY_HA_TIMEOUT (default 120s)

This value is passed directly to "kubectl wait --timeout=${TIMEOUT}"

Signed-off-by: Walter Lopatka <[email protected]>

* CORTX_31239: Fix README.md

Signed-off-by: Walter Lopatka <[email protected]>

* CORTX-31239: Fix readme

Signed-off-by: Walter Lopatka <[email protected]>

* Update to address Codacy issue

Signed-off-by: Walter Lopatka <[email protected]>
  • Loading branch information
walterlopatka authored May 5, 2022
1 parent a03d193 commit 7f879c1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,17 @@ This section contains information about all the worker nodes used to deploy CORT

The Helm charts work with both "stub" and "CORTX ALL" containers, allowing users to deploy both placeholder Kubernetes artifacts and functioning CORTX deployments using the same code base. If you are encountering issues deploying CORTX on Kubernetes, you can utilize the stub container method by setting the necessary component in `solution.yaml` to use an image of `ghcr.io/seagate/centos:7` instead of a CORTX-based image. This will deploy the same Kubernetes structure, expect the container entrypoints will be set to `sleep 3650d` to allow for deployment progression and user inspection of the overall deployment.

### Overriding Helm Install / Wait Timeouts

There is a "wait" after each of the cortx helm charts are deployed. This wait is guarded by a timeout. If needed, these timeout values can be overridden by environment variables.

| Environment Variable | Default Value |
| ------------------------------ | ------------- |
| `CORTX_DEPLOY_CONTROL_TIMEOUT` | `300s` |
| `CORTX_DEPLOY_DATA_TIMEOUT` | `300s` |
| `CORTX_DEPLOY_SERVER_TIMEOUT` | `300s` |
| `CORTX_DEPLOY_HA_TIMEOUT` | `120s` |

### Crash-looping InitContainers

During CORTX deployments, there are edge cases where the InitContainers of a CORTX pod will fail into a CrashLoopBackoff state and it becomes difficult to capture the internal logs that provide necessary context for such error conditions. This command can be used to spin up a debugging container instance that has access to those same logs.
Expand Down
16 changes: 12 additions & 4 deletions k8_cortx_cloud/deploy-cortx-cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,9 @@ function deployCortxControl()
|| exit $?

printf "\nWait for CORTX Control to be ready"
if ! waitForAllDeploymentsAvailable 300s "CORTX Control" "${namespace}" deployment/cortx-control; then
if ! waitForAllDeploymentsAvailable "${CORTX_DEPLOY_CONTROL_TIMEOUT:-300s}" \
"CORTX Control" "${namespace}" \
deployment/cortx-control; then
echo "Failed. Exiting script."
exit 1
fi
Expand Down Expand Up @@ -1027,7 +1029,9 @@ function deployCortxData()
for i in "${!node_selector_list[@]}"; do
deployments+=("deployment/cortx-data-${node_name_list[i]}")
done
if ! waitForAllDeploymentsAvailable 300s "CORTX Data" "${namespace}" "${deployments[@]}"; then
if ! waitForAllDeploymentsAvailable "${CORTX_DEPLOY_DATA_TIMEOUT:-300s}" \
"CORTX Data" "${namespace}" \
"${deployments[@]}"; then
echo "Failed. Exiting script."
exit 1
fi
Expand Down Expand Up @@ -1097,7 +1101,9 @@ function deployCortxServer()
for i in "${!node_selector_list[@]}"; do
deployments+=("deployment/cortx-server-${node_name_list[i]}")
done
if ! waitForAllDeploymentsAvailable 300s "CORTX Server" "${namespace}" "${deployments[@]}"; then
if ! waitForAllDeploymentsAvailable "${CORTX_DEPLOY_SERVER_TIMEOUT:-300s}" \
"CORTX Server" "${namespace}" \
"${deployments[@]}"; then
echo "Failed. Exiting script."
exit 1
fi
Expand Down Expand Up @@ -1144,7 +1150,9 @@ function deployCortxHa()
|| exit $?

printf "\nWait for CORTX HA to be ready"
if ! waitForAllDeploymentsAvailable 120s "CORTX HA" "${namespace}" deployment/cortx-ha; then
if ! waitForAllDeploymentsAvailable "${CORTX_DEPLOY_HA_TIMEOUT:-120s}" \
"CORTX HA" "${namespace}" \
deployment/cortx-ha; then
echo "Failed. Exiting script."
exit 1
fi
Expand Down

0 comments on commit 7f879c1

Please sign in to comment.