Summary:
I have deployed a microservice in OKD cluster through JenkinsX and am trying to delete the Persistent Volumes (PVs) associated with a helm release right after the deployment. So I found the following command from the jx documentation,
jx step helm delete <release_name> -n <namespace>
Steps to reproduce the behavior:
Deploy a service using jx preview command with release name,
jx preview --app $APP_NAME --dir ../.. --release preview-$APP_NAME
Expected behavior:
The jx step helm delete should remove the Persistent volumes (PVs) associated with the micro service deployment.
Actual behavior:
The above delete command is unable to delete the PVs which makes the promotion to staging build fails with port error.
Jx version:
The output of jx version is:
NAME VERSION
jx 2.0.785
jenkins x platform 2.0.1973
Kubernetes cluster v1.11.0+d4cacc0
kubectl v1.11.0+d4cacc0
helm client Client: v2.12.0+gd325d2a
git 2.22.0
Operating System "CentOS Linux release 7.7.1908 (Core)"
Jenkins type:
[ ] Serverless Jenkins X Pipelines (Tekton + Prow)
[*] Classic Jenkins
Kubernetes cluster:
Openstack cluster with 1 master and 2 worker nodes.
I need to delete the PVs through jx's jenkinsfile so tried using,
1. jx step helm delete <release_name> -n <namespace> ["Unable to delete PVs"]
2. helm delete purge <release_name> ["unable to list/delete the release created through jx helm"]
3. oc/kubectl commands are not working through Jenkinsfile.
But nothing helps. So, please suggest me anyway that I can delete PVs through Jenkinsfile of jx.