How to run a Jenkins build shell command as a root user, in a helm based deployment on Kubernetes?

4/2/2020

I'm using helm to deploy Jenkins in a k8s cluster. The result is a scalable Jenkins environment which spawns a new pod for every build job request. The execute shell command I'm trying to run requires sudo, which fails for lack of permissions. Is there a way to grant root level permissions to this script?

The sudo command I'm trying to run in that shell script is:

sudo apt-get install -y --no-install-recommends python3-distutils

And I need this because my other command fails without it:

python3 get-pip.py --user
-- Tal L
jenkins
kubernetes
kubernetes-helm

0 Answers