Delete a Solution from Production
Detailed information on how you can delete your solution from production environment
Overview
To delete a solution from production environment you therefore need to consider at least the following additional requirements:
- The k5-delete task run must be created by calling the REST API directly.
This guide explains the basic workflow for this deletion and shows examples of how these requirements can be implemented. However, it does not provide a production-ready workflow, but is a useful example that you can adapt to your specific security and automation requirements.
For this explanation, the following scenario is assumed:
-
You have an OpenShift project
{Destination Project}
in your production cluster{Destination Cluster}
. Your solution{Solution Acronym}
is deployed in this project.
The following steps outline the process:
Check Prerequisites
Before you begin, ensure that the following tasks are complete:
-
Obtain OpenShift account with sufficient permissions
Creating the k5-delete task run for solution deletion via a REST API call requires the Project Administrator role for the project for which you are creating the pipeline.
Create the k5-delete task run for solution deletion via REST API call
The solution {Solution Acronym}
will be deleted by executing a
k5-delete task run on the production cluster.
You can find the URL of the Swagger UI for this API on the Solution
Envoy Dashboard for your target project {Destination Project}
under Infrastructure on the production cluster. If {Destination
Domain}
denotes the cluster domain, the URL is usually as follows:
https://{Destination Project}.{Destination
Domain}/swagger/-/swagger-ui.html?urls.primaryName=pipeline-manager#/task-controller
To create the k5-delete task, make a POST
request on the
production cluster using, for example, the cURL command line tool as shown in the
following example:
$ TOKEN=$(oc whoami -t) $ URL="https://{Destination Project}.{Destination Domain}/-/pipelines/v1/tasks/delete?cleanupPipelineResources={cleanupPipelineResources}" $ curl -k \ -X POST \ -d @- \ -H "Authorization: Bearer $TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ $URL <<'EOF' { "solutionAcronym": "{Solution Acronym}", } EOF
-
In this example, replace the placeholder variables
{..}
as follows:{Destination Project}
: Project to which the solution should be deployed.{Destination Domain}
: URL of the domain of the production cluster.{cleanupPipelineResources}
Optional boolean flag (true / false), default value: false, indicates whether to clean up used pipeline resources or not (this does not include Kafka and database resources).{Solution Acronym}
: Solution acronym in capital letters.
-
Expect an
HTTP 200/OK
message returning the k5-delete task run name.