Optional: Running the cp4a-prerequisites.sh script in validate mode

Use the validate mode to verify that your databases and secrets are correctly configured and ready for a CP4BA deployment. The validate mode can also perform storage validation tests.

Before you begin

For the prerequisites to be able to run the script, see Recommended: Preparing databases and secrets for your chosen capabilities by running a script.

About this task

Run the cp4a-prerequisites.sh script in the validate mode to do a Storage Validation.

The validate mode performs the following checks:

  • Verifies database connections and configurations.
  • Validates that secrets are correctly created in the cluster.
  • Tests storage class functions (Storage Validation).

By default, the script skips Storage Validation tests. To run the tests, you add the appropriate parameters when you run the validate mode. The cp4a-prerequisites.sh script without any parameter checks the functional availability of the storage classes by creating temporary PVCs and confirming whether they bind successfully.

If you enter the command incorrectly, the help for the cp4a-prerequisites.sh script is displayed.

Usage
./cp4a-prerequisites.sh -m validate -n <CP4BA-NAMESPACE> [options]
Optional parameters
  • run-storage-validation: Run Storage Validation.
Examples

The following example shows how to run the command skipping the validation.

./cp4a-prerequisites.sh -m validate -n $NAMESPACE

The following example shows how to run the command with Storage Validation.

./cp4a-prerequisites.sh -m validate -n $NAMESPACE --run-storage-validation

The storage validation takes approximately 25 minutes.

Important: Running storage validation is optional. However, it is necessary that your storage meets the storage requirements, so it is advisable to run some tests. If you run the storage validation tool with ROKS storage classes, you might find that it fails. These failures do not mean that the storage classes are invalid for your CP4BA deployment.

Procedure

  1. Optional: Set the language and country values for validation messages.

    If no values are set, English (-Duser.language=en) is set as the language, and the United States (-Duser.country=US) is set as the country.

    Run the export command to set values for language and country as environment variables before you run the script in validate mode. The following variables set the language to Hindi and the country to India:

    export CP4BA_AUTO_LANGUAGE="HI"
    export CP4BA_AUTO_REGION="IN"
  2. Change directory to the scripts folder under cert-kubernetes.
  3. Run the script in validate mode.
    ./cp4a-prerequisites.sh -m validate -n $NAMESPACE

    Without any optional parameters, the script immediately asks whether you want to run Storage Validation tests.

    Note: When you run the script in validate mode without the Storage Validation parameter, the script skips the tests and outputs the commands in case you want to run the tests later.
    ./cp4a-prerequisites.sh -m validate -n <CP4BA_NAMESPACE> --run-storage-validation
    If you run the command, the script checks that prerequisite tools are installed on your system for the test.
    1. If a prerequisite tool is not installed, the script displays an error message and exits. Install the missing tools and then run the validation tests.
    2. When all prerequisites are installed, the script proceeds with the selected validation test.
  4. If you ran the Storage Validation test, review the results.

    The Storage Validation validates that the storage classes you entered in property mode meet the RWX and RWO requirements. If the validation is successful, it is marked as PASSED!

    If a connection is not successful for a particular test, a message informs you, which test failed. To resolve the issue, check the values in your property files so you can correct them and try again.

    Note: The Storage Validation test uses a simple JDBC method to test the connection to remote database servers with the Cloud Pak for Business Automation default JDBC drivers.

    If you need to use customized JDBC drivers in your production deployment, you can locate these drivers by using the sc_drivers_url parameter during custom resource configuration. For more information, see Optional: Preparing customized versions of JDBC drivers and ICCSAP libraries.

    If you ran the Storage Validation, the script asks whether you want to clean up the resources.

Results

Your databases, secrets, and storage are correctly configured and ready for CP4BA deployment.

Tip: You can change (add or remove) the selected CP4BA capabilities by rerunning the script and merging the new property files with the backed-up property files.

You can rerun the script in property mode with the update-components parameter to create new property files. For more information, see Adding or removing capabilities to an existing CP4BA production deployment.

What to do next

The next task to complete depends on the capabilities you selected for your deployment. Prepare all these capabilities and any dependencies. Go to the next task Optional: Preparing to monitor your containers or jump to the capability in the table of contents or from Preparing your chosen capabilities.

Remember: When you run the cp4a-deployment.sh script from the location that outputs the cp4ba-prerequisites folder, the values that are defined in your property files are used in the custom resource file.