[kubernetes+helm] Automatic configuration of pipeline during installation of jenkins from helm

Hi,

I’ve searched almost all internet to find a way, how to automatically configure pipeline, during initial setup of Jenkins from helm.
My idea is:

  1. Create configmap with configuration(jenkins plugins and so on), secrets which will be used by jenkins and also create pipeline from k8s configmap or create it somehow from yaml declaration inside helm/jenkins.yaml
  2. So far I have plugin management configured(inside jenkins-master-override.yaml file for helm configuration), secrets management configured(thanks to kubernetes credentials plugin), but I cannot automatically configure a pipeline.
  3. I have configuration of jenkins pipeline inside my SCM, but I would like to get a solution, how to configure this pipeline and credentials and git repository, somehow inside yaml - to be able to skip manual pipeline clicking and setting configuration - but so far I cannot find a way how to do this.

Do you know if there is a way how to achieve such configuration? Thanks in advance for any help here, maybe there is a way… :slight_smile:

short answer: Configuration as code plugin, with jobdsl

configuration-as-code-plugin/demos/jobs at master · jenkinsci/configuration-as-code-plugin · GitHub as simple examples.

jobdsl (above) to define the job, either fully defined in jobdsl, or a job pointing at scm (github/gitlab/etc) that has a Jenkinsfile inside of it defining the actual pipeline.