6 Uninstalling SCP

This chapter provides information about uninstalling SCP.

6.1 Uninstalling SCP Using Helm

To uninstall SCP using Helm, perform the following procedure on a server that has access to Kubectl and Helm commands.

  1. To uninstall SCP, run the following command:
    helm uninstall <release_name> --namespace <namespace>

    Where, <release_name> is a name provided by the user to identify the Helm deployment.

    Helm keeps a record of its releases, so you can still reactivate the release after uninstalling it.

    Example:

    helm uninstall ocscp --namespace scp

Note:

By default, SCP uses Helm 3.

6.2 Deleting Kubernetes Namespace

This section describes how to delete Kubernetes namespace where SCP is deployed.
To delete kubernetes namespace, run the following command:
kubectl delete namespace <release_namespace>

Where, <release_namespace> is the deployment namespace used by the Helm command.

Example:

kubectl delete namespace ocscp

6.3 Removing Database Users

This section describes how to remove MySQL users.

To remove MySQL users while uninstalling SCP, run the following commands:

Remove Privileged User:

DROP USER IF EXISTS <SCP Privileged-User Name>;

Example:

DROP USER IF EXISTS scpprivilegedusr';

Remove Application User:

DROP USER IF EXISTS <SCP Application User Name>;

Example:

DROP USER IF EXISTS scpusr;

Caution:

Removal of users must be done on all the SQL nodes for all SCP sites.

6.4 Removing the Application and Backup Database

This section describes how to remove the application and backup database.
Run the following commands to remove the application and backup database:
  • For application database:
    DROP DATABASE <scp_dbname>;

    Example:

    DROP DATABASE ocscpdb;
  • For backup database:
    DROP DATABASE <scp_backupdbname>;

    Example:

    DROP DATABASE ocscpbackupdb;

6.5 Starting and Stopping SCP Gracefully

You can update the SCP service status through the SystemOptions REST API before optional uninstallation. Use deRegistered or outOfService, depending on the intended operational state.

The accepted values are deRegistered and outOfService.

The SystemOptions endpoint specifies the GET and PUT targets:

GET/PUT http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions

For more information about configuration model, see "Configuring System Options" in Oracle Communications Cloud Native Core, Service Communication Proxy REST Specification Guide.

  1. To stop SCP, do the following:
    1. Read the current SCP operation state using the SystemOptions REST API configurations.
      The PUT request updates the SystemOptions resource. Use the current GET response as the base payload and change the scpServiceStatus parameter.
      curl -X GET \
        "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
        -H "accept: application/json"
    2. Move SCP to the selected stop state by selecting one of the following state updates:
      • Use deRegistered to take SCP out of normal service through deregistration behavior.

        In the full SystemOptions JSON payload, update the scpServiceStatus object:

        {
          "scpServiceStatus": {
            "serviceStatus": "deRegistered",
            "trafficRejectionErrorProfile": "defaultScpTrafficRejectionErrorProfile",
            "fwdVendorSpecificIEInErrorRsp": false,
            "trafficRejectionDelay": "10s"
          }
        }

        Submit the full updated SystemOptions payload:

        curl -X PUT \
          "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
          -H "accept: application/json" \
          -H "Content-Type: application/json" \
          -d @systemoptions-deregistered.json
      • Use outOfService to put SCP into out-of-service traffic rejection behavior. trafficRejectionDelay defines the delay before SCP starts rejecting traffic and must be between 0s and 60s.

        In the full SystemOptions JSON payload, update the scpServiceStatus object:

        {
          "scpServiceStatus": {
            "serviceStatus": "outOfService",
            "trafficRejectionErrorProfile": "defaultScpTrafficRejectionErrorProfile",
            "fwdVendorSpecificIEInErrorRsp": false,
            "trafficRejectionDelay": "10s"
          }
        }

        Submit the full updated SystemOptions payload:

        curl -X PUT \
          "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
          -H "accept: application/json" \
          -H "Content-Type: application/json" \
          -d @systemoptions-out-of-service.json
    3. Verify the stop state.
      Read SystemOptions again and confirm that scpServiceStatus.serviceStatus identifies the intended value.
      curl -X GET \
        "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
        -H "accept: application/json"
    4. Run the following command to uninstall SCP only after SCP moves to the selected stop state, and then verify the operational stop.
      helm uninstall <release name> -n <namespace>

      Example:

      helm uninstall ocscp -n scpsvc

      For the SCP uninstall procedure, see Uninstalling SCP.

  2. If you want to start SCP, do the following:
    You must update the SystemOptions configuration so that SCP status returns to inService. Use this procedure when SCP is installed and reachable through the configuration service.

    If you have uninstalled SCP after graceful stop, install SCP first, and then verify that SystemOptions specifies serviceStatus as inService.

    1. Read the current SystemOptions REST API configuration.
      curl -X GET \
        "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
        -H "accept: application/json"
    2. Move SCP back to the in-service state.

      In the SystemOptions JSON payload, update the scpServiceStatus object:

      {
        "scpServiceStatus": {
          "serviceStatus": "inService",
          "trafficRejectionErrorProfile": "defaultScpTrafficRejectionErrorProfile",
          "fwdVendorSpecificIEInErrorRsp": false,
          "trafficRejectionDelay": "10s"
        }
      }

      Submit the updated SystemOptions payload:

      curl -X PUT \
        "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
        -H "accept: application/json" \
        -H "Content-Type: application/json" \
        -d @systemoptions-in-service.json
    3. Verify the start state.

      Read SystemOptions again and confirm that scpServiceStatus.serviceStatus is inService.

      curl -X GET \
        "http://<SCP configuration FQDN>:8081/ocscp/scpc-configuration/v1/systemoptions" \
        -H "accept: application/json"

    After you apply inService, expect SCP to return to normal service availability according to the SystemOptions REST API configuration and SCP service status design.