For my project, I want to load some XML's post deployment on adhoc when required(don't want to run on every deployment). loading them directly from Jenkins or GITLAB pipeline is taking longer time due to bad throughput to k8s cluster. I am using Helm for k8s deployment. Any better approach or steps to get my adhoc job run faster.? tried to pass my service account or my account credentials to run script after deployment in an optional stage where I was advised not to do so.
This data load task from pod takes 10 mins but from Jenkins or GITLAB takes 70-90 mins.
limitations:
- Service-account was restricted bash run scripts from CLI post deployment
- Won't be able to use my personal credentials in pipeline as per best practices
For now I am running this manual step in shell script from my local when required as below. But need to add this part of pipeline. any help/suggestions.?
pkstoken -cluster=<cluster> -user=<me> ns=sade_test1
echo "doing dataload import for $1"
if [ $1 == sade-t1 ]; then
Namespace="sade_test1"
Podname="sade_test_p1"
kubectl -n $Namespace exec -it $Podname -- bash -c "cd /opt/tomcat/webapp/app-1/bin/ && echo import dataload_custom.xml"