- Deploy Jenkins -
-Deploy production ready Jenkins Operator manifest -
-diff --git a/deploy/olm-catalog/jenkins-operator/0.2.2/jenkins-operator.v0.2.2.clusterserviceversion.yaml b/deploy/olm-catalog/jenkins-operator/0.2.2/jenkins-operator.v0.2.2.clusterserviceversion.yaml
index 6cfc6845..90a5b3a9 100644
--- a/deploy/olm-catalog/jenkins-operator/0.2.2/jenkins-operator.v0.2.2.clusterserviceversion.yaml
+++ b/deploy/olm-catalog/jenkins-operator/0.2.2/jenkins-operator.v0.2.2.clusterserviceversion.yaml
@@ -235,7 +235,7 @@ spec:
serviceAccountName: jenkins-operator
strategy: deployment
installModes:
- - supported: false
+ - supported: true
type: OwnNamespace
- supported: true
type: SingleNamespace
diff --git a/docs/docs/getting-started/v0.1.x/developer-guide/index.html b/docs/docs/developer-guide/index.html
similarity index 100%
rename from docs/docs/getting-started/v0.1.x/developer-guide/index.html
rename to docs/docs/developer-guide/index.html
diff --git a/docs/docs/developer-guide/index.xml b/docs/docs/developer-guide/index.xml
new file mode 100644
index 00000000..cabc8bcd
--- /dev/null
+++ b/docs/docs/developer-guide/index.xml
@@ -0,0 +1,83 @@
+
Azure AKS managed Kubernetes service adds to every pod the following environment variables:
-- name: KUBERNETES_PORT_443_TCP_ADDR
- value:
-- name: KUBERNETES_PORT
- value: tcp://
-- name: KUBERNETES_PORT_443_TCP
- value: tcp://
-- name: KUBERNETES_SERVICE_HOST
- value:The operator is aware of it and omits these environment variables when checking if a Jenkins pod environment has been changed. It prevents the -restart of a Jenkins pod over and over again.
- - - -Jenkins operator uses job-dsl and kubernetes-credentials-provider plugins for configuring jobs -and deploy keys.
- -First you have to prepare pipelines and job definition in your GitHub repository using the following structure:
- -cicd/
-├── jobs
-│ └── build.jenkins
-└── pipelines
- └── build.jenkins
-
-
-cicd/jobs/build.jenkins is a job definition:
#!/usr/bin/env groovy
-
-pipelineJob('build-jenkins-operator') {
- displayName('Build jenkins-operator')
-
- definition {
- cpsScm {
- scm {
- git {
- remote {
- url('https://github.com/jenkinsci/kubernetes-operator.git')
- credentials('jenkins-operator')
- }
- branches('*/master')
- }
- }
- scriptPath('cicd/pipelines/build.jenkins')
- }
- }
-}
-
-
-cicd/pipelines/build.jenkins is an actual Jenkins pipeline:
#!/usr/bin/env groovy
-
-def label = "build-jenkins-operator-${UUID.randomUUID().toString()}"
-def home = "/home/jenkins"
-def workspace = "${home}/workspace/build-jenkins-operator"
-def workdir = "${workspace}/src/github.com/jenkinsci/kubernetes-operator/"
-
-podTemplate(label: label,
- containers: [
- containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:alpine'),
- containerTemplate(name: 'go', image: 'golang:1-alpine', command: 'cat', ttyEnabled: true),
- ],
- envVars: [
- envVar(key: 'GOPATH', value: workspace),
- ],
- ) {
-
- node(label) {
- dir(workdir) {
- stage('Init') {
- timeout(time: 3, unit: 'MINUTES') {
- checkout scm
- }
- container('go') {
- sh 'apk --no-cache --update add make git gcc libc-dev'
- }
- }
-
- stage('Dep') {
- container('go') {
- sh 'make dep'
- }
- }
-
- stage('Test') {
- container('go') {
- sh 'make test'
- }
- }
-
- stage('Build') {
- container('go') {
- sh 'make build'
- }
- }
- }
- }
-}
-
-
-Jenkins Seed Jobs are configured using Jenkins.spec.seedJobs section from your custom resource manifest:
apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- seedJobs:
- - id: jenkins-operator
- targets: "cicd/jobs/*.jenkins"
- description: "Jenkins Operator repository"
- repositoryBranch: master
- repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
-
-
-Jenkins Operator will automatically discover and configure all the seed jobs.
- -You can verify if deploy keys were successfully configured in the Jenkins Credentials tab.
- -
You can verify if your pipelines were successfully configured in the Jenkins Seed Job console output.
- -
If your GitHub repository is private you have to configure SSH or username/password authentication.
- -There are two methods of SSH private key generation:
-$ openssl genrsa -out <filename> 2048or
-$ ssh-keygen -t rsa -b 2048
-$ ssh-keygen -p -f <filename> -m pemThen copy content from generated file.
- -If you want to upload your public key to your Git server you need to extract it.
- -If key was generated by openssl then you need to type this to extract public key:
$ openssl rsa -in <filename> -pubout > <filename>.pubIf key was generated by ssh-keygen the public key content is located in
Configure a seed job like this:
- -apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- seedJobs:
- - id: jenkins-operator-ssh
- credentialType: basicSSHUserPrivateKey
- credentialID: k8s-ssh
- targets: "cicd/jobs/*.jenkins"
- description: "Jenkins Operator repository"
- repositoryBranch: master
- repositoryUrl: git@github.com:jenkinsci/kubernetes-operator.git
-
-
-and create a Kubernetes Secret (name of secret should be the same from credentialID field):
apiVersion: v1
-kind: Secret
-metadata:
- name: k8s-ssh
-stringData:
- privateKey: |
- -----BEGIN RSA PRIVATE KEY-----
- MIIJKAIBAAKCAgEAxxDpleJjMCN5nusfW/AtBAZhx8UVVlhhhIKXvQ+dFODQIdzO
- oDXybs1zVHWOj31zqbbJnsfsVZ9Uf3p9k6xpJ3WFY9b85WasqTDN1xmSd6swD4N8
- ...
- username: github_user_name
-
-
-Configure the seed job like:
- -apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- seedJobs:
- - id: jenkins-operator-user-pass
- credentialType: usernamePassword
- credentialID: k8s-user-pass
- targets: "cicd/jobs/*.jenkins"
- description: "Jenkins Operator repository"
- repositoryBranch: master
- repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
-
-
-and create a Kubernetes Secret (name of secret should be the same from credentialID field):
apiVersion: v1
-kind: Secret
-metadata:
- name: k8s-user-pass
-stringData:
- username: github_user_name
- password: password_or_token
-
-
-To use forwarding proxy with an operator to download plugins you need to add the following environment variable to Jenkins Custom Resource (CR), e.g.:
-spec:
- master:
- containers:
- - name: jenkins-master
- env:
- - name: CURL_OPTIONS
- value: -L -x <proxy_url>In CURL_OPTIONS var you can set additional arguments to curl command.
To pull a Docker Image from private repository you can use imagePullSecrets.
Please follow the instructions on creating a secret with a docker config.
- -To use Docker Hub additional steps are required.
- -Edit the previously created secret:
-kubectl -n <namespace> edit secret <name>The .dockerconfigjson key’s value needs to be replaced with a modified version.
After modifications, it needs to be encoded as a Base64 value before setting the .dockerconfigjson key.
Example config file to modify and use:
- -{
- "auths":{
- "https://index.docker.io/v1/":{
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "auth.docker.io":{
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "registry.docker.io":{
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "docker.io":{
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "https://registry-1.docker.io/v2/": {
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "registry-1.docker.io/v2/": {
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "registry-1.docker.io": {
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- },
- "https://registry-1.docker.io": {
- "username":"user",
- "password":"password",
- "email":"yourdockeremail@gmail.com",
- "auth":"base64 of string user:password"
- }
- }
-}
-
-
-
-
- Backup and restore is done by a container sidecar.
- -Save to the file named pvc.yaml:
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
- name: <pvc_name>
- namespace: <namespace>
-spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: 500GiRun the following command:
-$ kubectl -n <namespace> create -f pvc.yamlapiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: <cr_name>
- namespace: <namespace>
-spec:
- master:
- securityContext:
- runAsUser: 1000
- fsGroup: 1000
- containers:
- - name: jenkins-master
- image: jenkins/jenkins:lts
- - name: backup # container responsible for the backup and restore
- env:
- - name: BACKUP_DIR
- value: /backup
- - name: JENKINS_HOME
- value: /jenkins-home
- - name: BACKUP_COUNT
- value: "3" # keep only the 2 most recent backups
- image: virtuslab/jenkins-operator-backup-pvc:v0.0.7 # look at backup/pvc directory
- imagePullPolicy: IfNotPresent
- volumeMounts:
- - mountPath: /jenkins-home # Jenkins home volume
- name: jenkins-home
- - mountPath: /backup # backup volume
- name: backup
- volumes:
- - name: backup # PVC volume where backups will be stored
- persistentVolumeClaim:
- claimName: <pvc_name>
- backup:
- containerName: backup # container name is responsible for backup
- action:
- exec:
- command:
- - /home/user/bin/backup.sh # this command is invoked on "backup" container to make backup, for example /home/user/bin/backup.sh <backup_number>, <backup_number> is passed by operator
- interval: 30 # how often make backup in seconds
- makeBackupBeforePodDeletion: true # make a backup before pod deletion
- restore:
- containerName: backup # container name is responsible for restore backup
- action:
- exec:
- command:
- - /home/user/bin/restore.sh # this command is invoked on "backup" container to make restore backup, for example /home/user/bin/restore.sh <backup_number>, <backup_number> is passed by operator
- #recoveryOnce: <backup_number> # if want to restore specific backup configure this field and then Jenkins will be restarted and desired backup will be restoredWith enough effort one can create a custom backup and restore provider -for the Jenkins Operator.
- -Two commands (e.g. scripts) are required:
- -backup.sh that takes one argument, a backup numberbackup.sh that takes one argument, a backup numberBoth scripts need to return an exit code of 0 on success and 1 or greater for failure.
One of those scripts (or the entry point of the container) needs to be responsible -for backup cleanup or rotation if required, or an external system.
- -The mechanism relies on basic Kubernetes and UNIX functionalities.
- -The backup (and restore) container runs as a sidecar in the same -Kubernetes pod as the Jenkins master.
- -Name of the backup and restore containers can be set as necessary using
-spec.backup.containerName and spec.restore.containerName.
-In most cases it will be the same container, but we allow for less common use cases.
The operator will call a backup or restore commands inside a sidecar container when necessary:
- -spec.backup.action.exec.command)
-will be called every N seconds configurable in: spec.backup.interval
-and on pod shutdown (if enabled in spec.backup.makeBackupBeforePodDeletion)
-with an integer representing the current backup number as first and only argumentspec.restore.action.exec.command)
-will be called at Jenkins startup
-with an integer representing the backup number to restore as first and only argument
-(can be overridden using spec.restore.recoveryOnce)This example shows abbreviated version of a simple AWS S3 backup implementation
-using: aws-cli, bash and kube2iam.
In addition to your normal Jenkins CustomResource some additional settings
-for backup and restore are required, e.g.:
kind: Jenkins
-apiVersion: jenkins.io/v1alpha1
-metadata:
- name: example
- namespace: jenkins
-spec:
- master:
- masterAnnotations:
- iam.amazonaws.com/role: "my-example-backup-role" # tell kube2iam where the AWS IAM role is
- containers:
- - name: jenkins-master
- ...
- - name: backup # container responsible for backup and restore
- image: quay.io/virtuslab/aws-cli:1.16.263-2
- workingDir: /home/user/bin/
- command: # our container entry point
- - sleep
- - infinity
- env:
- - name: BACKUP_BUCKET
- value: my-example-bucket # the S3 bucket name to use
- - name: BACKUP_PATH
- value: my-backup-path # the S3 bucket path prefix to use
- - name: JENKINS_HOME
- value: /jenkins-home # the path to mount jenkins home dir in the backup container
- volumeMounts:
- - mountPath: /jenkins-home # Jenkins home volume
- name: jenkins-home
- - mountPath: /home/user/bin/backup.sh
- name: backup-scripts
- subPath: backup.sh
- readOnly: true
- - mountPath: /home/user/bin/restore.sh
- name: backup-scripts
- subPath: restore.sh
- readOnly: true
- volumes:
- - name: backup-scripts
- configMap:
- defaultMode: 0754
- name: jenkins-operator-backup-s3
- securityContext: # make sure both containers use the same UID and GUID
- runAsUser: 1000
- fsGroup: 1000
- ...
- backup:
- containerName: backup # container name responsible for backup
- interval: 3600 # how often make a backup in seconds
- makeBackupBeforePodDeletion: true # trigger backup just before deleting the pod
- action:
- exec:
- command:
- # this command is invoked on "backup" container to create a backup,
- # <backup_number> is passed by operator,
- # for example /home/user/bin/backup.sh <backup_number>
- - /home/user/bin/backup.sh
- restore:
- containerName: backup # container name is responsible for restore backup
- action:
- exec:
- command:
- # this command is invoked on "backup" container to restore a backup,
- # <backup_number> is passed by operator
- # for example /home/user/bin/restore.sh <backup_number>
- - /home/user/bin/restore.sh
-# recoveryOnce: <backup_number> # if want to restore specific backup configure this field and then Jenkins will be restarted and desired backup will be restoredThe actual backup and restore scripts will be provided in a ConfigMap:
kind: ConfigMap
-apiVersion: v1
-metadata:
- name: jenkins-operator-backup-s3
- namespace: jenkins
- labels:
- app: jenkins-operator
-data:
- backup.sh: |-
- #!/bin/bash -xeu
- [[ ! $# -eq 1 ]] && echo "Usage: $0 backup_number" && exit 1;
- [[ -z "${BACKUP_BUCKET}" ]] && echo "Required 'BACKUP_BUCKET' env not set" && exit 1;
- [[ -z "${BACKUP_PATH}" ]] && echo "Required 'BACKUP_PATH' env not set" && exit 1;
- [[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1;
-
- backup_number=$1
- echo "Running backup #${backup_number}"
-
- BACKUP_TMP_DIR=$(mktemp -d)
- tar -C ${JENKINS_HOME} -czf "${BACKUP_TMP_DIR}/${backup_number}.tar.gz" --exclude jobs/*/workspace* -c jobs && \
-
- aws s3 cp ${BACKUP_TMP_DIR}/${backup_number}.tar.gz s3://${BACKUP_BUCKET}/${BACKUP_PATH}/${backup_number}.tar.gz
- echo Done
-
- restore.sh: |-
- #!/bin/bash -xeu
- [[ ! $# -eq 1 ]] && echo "Usage: $0 backup_number" && exit 1
- [[ -z "${BACKUP_BUCKET}" ]] && echo "Required 'BACKUP_BUCKET' env not set" && exit 1;
- [[ -z "${BACKUP_PATH}" ]] && echo "Required 'BACKUP_PATH' env not set" && exit 1;
- [[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1;
-
- backup_number=$1
- echo "Running restore #${backup_number}"
-
- BACKUP_TMP_DIR=$(mktemp -d)
- aws s3 cp s3://${BACKUP_BUCKET}/${BACKUP_PATH}/${backup_number}.tar.gz ${BACKUP_TMP_DIR}/${backup_number}.tar.gz
-
- tar -C ${JENKINS_HOME} -zxf "${BACKUP_TMP_DIR}/${backup_number}.tar.gz"
- echo DoneIn our example we will use S3 bucket lifecycle policy to keep -the number of backups under control, e.g. Cloud Formation fragment:
- Type: AWS::S3::Bucket
- Properties:
- BucketName: my-example-bucket
- ...
- LifecycleConfiguration:
- Rules:
- - Id: BackupCleanup
- Status: Enabled
- Prefix: my-backup-path
- ExpirationInDays: 7
- NoncurrentVersionExpirationInDays: 14
- AbortIncompleteMultipartUpload:
- DaysAfterInitiation: 3Jenkins can be customized using groovy scripts or the configuration as code plugin.
-By using a ConfigMap you can create your own Jenkins customized configuration.
-Then you must reference the ConfigMap in the Jenkins pod customization file in spec.groovyScripts or spec.configurationAsCode
For example create a ConfigMap with name jenkins-operator-user-configuration. Then, modify the Jenkins manifest to look like this:
apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- configurationAsCode:
- configurations:
- - name: jenkins-operator-user-configuration
- groovyScripts:
- configurations:
- - name: jenkins-operator-user-configurationHere is an example of jenkins-operator-user-configuration:
apiVersion: v1
-kind: ConfigMap
-metadata:
- name: jenkins-operator-user-configuration
-data:
- 1-configure-theme.groovy: |
- import jenkins.*
- import jenkins.model.*
- import hudson.*
- import hudson.model.*
- import org.jenkinsci.plugins.simpletheme.ThemeElement
- import org.jenkinsci.plugins.simpletheme.CssTextThemeElement
- import org.jenkinsci.plugins.simpletheme.CssUrlThemeElement
-
- Jenkins jenkins = Jenkins.getInstance()
-
- def decorator = Jenkins.instance.getDescriptorByType(org.codefirst.SimpleThemeDecorator.class)
-
- List<ThemeElement> configElements = new ArrayList<>();
- configElements.add(new CssTextThemeElement("DEFAULT"));
- configElements.add(new CssUrlThemeElement("https://cdn.rawgit.com/afonsof/jenkins-material-theme/gh-pages/dist/material-light-green.css"));
- decorator.setElements(configElements);
- decorator.save();
-
- jenkins.save()
- 1-system-message.yaml: |
- jenkins:
- systemMessage: "Configuration as Code integration works!!!"*.groovy is Groovy script configuration*.yaml is configuration as codeIf you want to correct your configuration you can edit it while the Jenkins Operator is running. -Jenkins will reconcile and apply the new configuration.
- -If you configured spec.groovyScripts.secret.name, then this secret is available to use from map Groovy scripts.
-The secrets are loaded to secrets map.
Create a secret with for example the name jenkins-conf-secrets.
kind: Secret
-apiVersion: v1
-type: Opaque
-metadata:
- name: jenkins-conf-secrets
- namespace: default
-data:
- SYSTEM_MESSAGE: SGVsbG8gd29ybGQ=Then modify the Jenkins pod manifest by changing spec.groovyScripts.secret.name to jenkins-conf-secrets.
apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- configurationAsCode:
- configurations:
- - name: jenkins-operator-user-configuration
- secret:
- name: jenkins-conf-secrets
- groovyScripts:
- configurations:
- - name: jenkins-operator-user-configuration
- secret:
- name: jenkins-conf-secretsNow you can test that the secret is mounted by applying this ConfigMap for Groovy script:
apiVersion: v1
-kind: ConfigMap
-metadata:
- name: jenkins-operator-user-configuration
-data:
- 1-system-message.groovy: |
- import jenkins.*
- import jenkins.model.*
- import hudson.*
- import hudson.model.*
- Jenkins jenkins = Jenkins.getInstance()
-
- jenkins.setSystemMessage(secrets["SYSTEM_MESSAGE"])
- jenkins.save()Or by applying this configuration as code:
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: jenkins-operator-user-configuration
-data:
- 1-system-message.yaml: |
- jenkins:
- systemMessage: ${SYSTEM_MESSAGE}After this, you should see the Hello world system message from the Jenkins homepage.
Edit Custom Resource under spec.master.plugins:
apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- master:
- plugins:
- - name: simple-theme-plugin
- version: 0.5.1
-
-
-Under spec.master.basePlugins you can find plugins for a valid Jenkins Operator:
apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- master:
- basePlugins:
- - name: kubernetes
- version: 1.18.3
- - name: workflow-job
- version: "2.34"
- - name: workflow-aggregator
- version: "2.6"
- - name: git
- version: 3.12.0
- - name: job-dsl
- version: "1.76"
- - name: configuration-as-code
- version: "1.29"
- - name: configuration-as-code-support
- version: "1.19"
- - name: kubernetes-credentials-provider
- version: 0.12.1You can change their versions.
- -The Jenkins Operator will then automatically install plugins after the Jenkins master pod restarts.
- - - -Once Jenkins Operator is up and running let’s deploy actual Jenkins instance.
-Create manifest e.g. jenkins_instance.yaml with following data and save it on drive.
apiVersion: jenkins.io/v1alpha2
-kind: Jenkins
-metadata:
- name: example
-spec:
- master:
- containers:
- - name: jenkins-master
- image: jenkins/jenkins:lts
- imagePullPolicy: Always
- livenessProbe:
- failureThreshold: 12
- httpGet:
- path: /login
- port: http
- scheme: HTTP
- initialDelaySeconds: 80
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 5
- readinessProbe:
- failureThreshold: 3
- httpGet:
- path: /login
- port: http
- scheme: HTTP
- initialDelaySeconds: 30
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 1
- resources:
- limits:
- cpu: 1500m
- memory: 3Gi
- requests:
- cpu: "1"
- memory: 500Mi
- seedJobs:
- - id: jenkins-operator
- targets: "cicd/jobs/*.jenkins"
- description: "Jenkins Operator repository"
- repositoryBranch: master
- repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.gitDeploy a Jenkins to Kubernetes:
-kubectl create -f jenkins_instance.yamlWatch the Jenkins instance being created:
-kubectl get pods -wGet the Jenkins credentials:
-kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.user}' | base64 -d
-kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.password}' | base64 -dConnect to the Jenkins instance (minikube):
-minikube service jenkins-operator-http-<cr_name> --urlConnect to the Jenkins instance (actual Kubernetes cluster):
-kubectl port-forward jenkins-<cr_name> 8080:8080Then open browser with address http://localhost:8080.
-
This document explains how to setup your development environment.
- -mkdir -p $GOPATH/src/github.com/jenkinsci
-cd $GOPATH/src/github.com/jenkinsci/
-git clone git@github.com:jenkinsci/kubernetes-operator.git
-cd kubernetes-operator
-make go-dependenciesBuild and run Jenkins Operator locally:
-make build minikube-run OPERATOR_EXTRA_ARGS='--jenkins-api-hostname=$(eval minikube ip) --jenkins-api-use-nodeport=true'Once minikube and Jenkins Operator are up and running, apply Jenkins custom resource:
-kubectl apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
-kubectl get jenkins -o yaml
-kubectl get poYou can also run the controller locally and make it listen to a remote Kubernetes server.
-make run NAMESPACE=default KUBECTL_CONTEXT=remote-k8s OPERATOR_EXTRA_ARGS='--kubeconfig ~/.kube/config'Once minikube and Jenkins Operator are up and running, apply Jenkins custom resource:
-kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
-kubectl --context remote-k8s --namespace default get jenkins -o yaml
-kubectl --context remote-k8s --namespace default get poRun unit tests:
-make testRun e2e tests with minikube:
-make minikube-start
-eval $(minikube docker-env)
-make build e2e config=config.minikube.env CONTAINER_RUNTIME=podmanconfig.minikube.env is the E2E test profile which provides all connection info to operator to run on minikube.
Run the specific e2e test:
-make build e2e E2E_TEST_SELECTOR='^TestConfiguration$' config=config.minikube.env CONTAINER_RUNTIME=podmanIf you want to run E2E tests on CRC (Code Ready Containers by OpenShift), you should use config.crc.env profile instead of config.minikube.env.
-If you have some trouble with podman (for example building) then check how to use docker instead of podman.
At first, you need to start minikube:
-$ make minikube-start
-$ eval $(minikube docker-env) Build a Docker image inside the provided Linux container by:
-$ make indockerBuild Jenkins Operator inside a container using:
-$ make buildThen exit the container and run:
- -make e2e config=config.minikube.env
-
-
-or using crc as cluster software:
make e2e config=config.crc.env
-
-
-If you have trouble with building image using the podman, you can set additional flag IMAGE_PULL_MODE to pull image from the organization.
At first, you need to edit config.base.env and change the DOCKER_ORGANIZATION to your Docker Hub account/organization.
-After this change the IMAGE_PULL_MODE to remote. It will setup the Makefile goal to pull Docker image from registry.
-Then you need to pull image from your repository:
$ make container-runtime-build container-runtime-snapshot-pushWhen image will be uploaded to repository, you can now write this command to run E2E tests:
-$ make e2e E2E_TEST_SELECTOR='^TestConfiguration$' config=config.crc.envTo be able to work with the docker daemon on minikube machine run the following command before building an image:
eval $(minikube docker-env)pkg/apis/jenkinsio/*/jenkins_types.go has changedRun:
-make deepcopy-genminikube service jenkins-operator-http-<cr_name> --url
-kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.user}' | base64 -d
-kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.password}' | base64 -dexport GOPATH=/home/go # example value
-export GOROOT=/usr/lib/go-1.12 # example value
-export PATH=$GOPATH/bin:$PATHgo get golang.org/x/tools/cmd/goimports
-cd $GOPATH/src/golang.org/x/tools/cmd/goimports
-go build
-go install
-
-
-go get -u golang.org/x/lint/golint
-cd $GOPATH/src/golang.org/x/lint/golint
-go build
-go install
-
-
-go get github.com/mrtazz/checkmake
-cd $GOPATH/src/github.com/mrtazz/checkmake
-go build
-go install
-
-
-mkdir -p $GOPATH/src/github.com/dominikh/
-cd $GOPATH/src/github.com/dominikh/
-git clone https://github.com/dominikh/go-tools.git
-cd $GOPATH/src/github.com/dominikh/go-tools/staticcheck
-go build
-go install
-
-
-
-
- This document describes a getting started guide for Jenkins Operator v0.3.x and an additional configuration.
Prepare your Kubernetes cluster and set up your kubectl access.
Once you have running Kubernetes cluster you can focus on installing Jenkins Operator according to the Installation guide.
- -Deploy production ready Jenkins Operator manifest -
-How to configure Jenkins with Operator -
-How to customize Jenkins -
-Additional configuration for Azure Kubernetes Service -
-Prevent loss of job history -
-Custom backup and restore provider -
-How to deal with Jenkins Operator problems -
-API Schema definitions for Jenkins CRD -
-Jenkins Operator for developers -
-This document contains API scheme for jenkins-operator Custom Resource Definition manifest
Packages:
--
Package v1alpha2 contains the API Schema definitions for the jenkins.io v1alpha2 API group
- -Resource Types: --
Jenkins is the Schema for the jenkins API
- -| Field | -Description | -||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-apiVersion
-string |
-
-
-jenkins.io/v1alpha2
-
- |
-||||||||||||||||
-kind
-string
- |
-Jenkins |
-||||||||||||||||
-metadata
-
-
-Kubernetes meta/v1.ObjectMeta
-
-
- |
-
-Refer to the Kubernetes API documentation for the fields of the
-metadata field.
- |
-||||||||||||||||
-spec
-
-
-JenkinsSpec
-
-
- |
-
- Spec defines the desired state of the Jenkins -- -
|
-||||||||||||||||
-status
-
-
-JenkinsStatus
-
-
- |
-
- Status defines the observed state of Jenkins - |
-
-(Appears on: -JenkinsStatus) -
--
AppliedGroovyScript is the applied groovy script in Jenkins by the operator
- -| Field | -Description | -
|---|---|
-configurationType
-
-string
-
- |
-
- ConfigurationType is the name of the configuration type(base-groovy, user-groovy, user-casc) - |
-
-source
-
-string
-
- |
-
- Source is the name of source where is located groovy script - |
-
-name
-
-string
-
- |
-
- Name is the name of the groovy script - |
-
-Hash
-
-string
-
- |
-
- Hash is the hash of the groovy script and secrets which it uses - |
-
-(Appears on: -JenkinsSpec) -
--
Backup defines the configuration of a Jenkins backup
- -| Field | -Description | -
|---|---|
-containerName
-
-string
-
- |
-
- ContainerName is the container name responsible for backup operation - |
-
-action
-
-
-Handler
-
-
- |
-
- Action defines the action which performs the backup in the backup container sidecar - |
-
-interval
-
-uint64
-
- |
-
- Interval tells you how often the backup is made in seconds -Defaults to 30. - |
-
-makeBackupBeforePodDeletion
-
-bool
-
- |
-
- MakeBackupBeforePodDeletion tells the operator to make a backup before Jenkins master pod deletion - |
-
-(Appears on: -Customization) -
--
ConfigMapRef is the reference to Kubernetes ConfigMap
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-- | -
-(Appears on: -JenkinsSpec) -
--
ConfigurationAsCode defines configuration of Jenkins customization via the Configuration as Code Jenkins plugin
- -| Field | -Description | -
|---|---|
-Customization
-
-
-Customization
-
-
- |
-- | -
-(Appears on: -JenkinsMaster) -
--
Container defines the Kubernetes container attributes
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-
- Name of the container specified as a DNS_LABEL. -Each container in a pod must have a unique name (DNS_LABEL). - |
-
-image
-
-string
-
- |
-
- Docker image name. -More info: https://kubernetes.io/docs/concepts/containers/images - |
-
-imagePullPolicy
-
-
-Kubernetes core/v1.PullPolicy
-
-
- |
-
- Image pull policy. -One of Always, Never, IfNotPresent. -Defaults to Always. - |
-
-resources
-
-
-Kubernetes core/v1.ResourceRequirements
-
-
- |
-
- Compute Resources required by this container. -More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - |
-
-command
-
-[]string
-
- |
-
-(Optional)
- Entrypoint array. Not executed within a shell. -The docker image’s ENTRYPOINT is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable -cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax -can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, -regardless of whether the variable exists or not. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - |
-
-args
-
-[]string
-
- |
-
-(Optional)
- Arguments to the entrypoint. -The docker image’s CMD is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable -cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax -can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, -regardless of whether the variable exists or not. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - |
-
-workingDir
-
-string
-
- |
-
-(Optional)
- Container’s working directory. -If not specified, the container runtime’s default will be used, which -might be configured in the container image. - |
-
-ports
-
-
-[]Kubernetes core/v1.ContainerPort
-
-
- |
-
-(Optional)
- List of ports to expose from the container. Exposing a port here gives -the system additional information about the network connections a -container uses, but is primarily informational. Not specifying a port here -DOES NOT prevent that port from being exposed. Any port which is -listening on the default “0.0.0.0” address inside a container will be -accessible from the network. - |
-
-envFrom
-
-
-[]Kubernetes core/v1.EnvFromSource
-
-
- |
-
-(Optional)
- List of sources to populate environment variables in the container. -The keys defined within a source must be a C_IDENTIFIER. All invalid keys -will be reported as an event when the container is starting. When a key exists in multiple -sources, the value associated with the last source will take precedence. -Values defined by an Env with a duplicate key will take precedence. - |
-
-env
-
-
-[]Kubernetes core/v1.EnvVar
-
-
- |
-
-(Optional)
- List of environment variables to set in the container. - |
-
-volumeMounts
-
-
-[]Kubernetes core/v1.VolumeMount
-
-
- |
-
-(Optional)
- Pod volumes to mount into the container’s filesystem. - |
-
-livenessProbe
-
-
-Kubernetes core/v1.Probe
-
-
- |
-
-(Optional)
- Periodic probe of container liveness. -Container will be restarted if the probe fails. - |
-
-readinessProbe
-
-
-Kubernetes core/v1.Probe
-
-
- |
-
-(Optional)
- Periodic probe of container service readiness. -Container will be removed from service endpoints if the probe fails. - |
-
-lifecycle
-
-
-Kubernetes core/v1.Lifecycle
-
-
- |
-
-(Optional)
- Actions that the management system should take in response to container lifecycle events. - |
-
-securityContext
-
-
-Kubernetes core/v1.SecurityContext
-
-
- |
-
-(Optional)
- Security options the pod should run with. -More info: https://kubernetes.io/docs/concepts/policy/security-context/ -More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - |
-
-(Appears on: -ConfigurationAsCode, -GroovyScripts) -
--
Customization defines configuration of Jenkins customization
- -| Field | -Description | -
|---|---|
-secret
-
-
-SecretRef
-
-
- |
-- | -
-configurations
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.ConfigMapRef
-
-
- |
-- | -
-(Appears on: -JenkinsSpec) -
--
GroovyScripts defines configuration of Jenkins customization via groovy scripts
- -| Field | -Description | -
|---|---|
-Customization
-
-
-Customization
-
-
- |
-- | -
-(Appears on: -Backup, -Restore) -
--
Handler defines a specific action that should be taken
- -| Field | -Description | -
|---|---|
-exec
-
-
-Kubernetes core/v1.ExecAction
-
-
- |
-
- Exec specifies the action to take. - |
-
string alias)-(Appears on: -SeedJob) -
--
JenkinsCredentialType defines the type of Jenkins credential used in the seed job mechanism
- --(Appears on: -JenkinsSpec) -
--
JenkinsMaster defines the Jenkins master pod attributes and plugins, -every single change requires a Jenkins master pod restart
- -| Field | -Description | -
|---|---|
-masterAnnotations
-
-map[string]string
-
- |
-
-(Optional)
- Annotations is an unstructured key value map stored with a resource that may be -set by external tools to store and retrieve arbitrary metadata. They are not -queryable and should be preserved when modifying objects. -More info: http://kubernetes.io/docs/user-guide/annotations - |
-
-nodeSelector
-
-map[string]string
-
- |
-
-(Optional)
- NodeSelector is a selector which must be true for the pod to fit on a node. -Selector which must match a node’s labels for the pod to be scheduled on that node. -More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - |
-
-securityContext
-
-
-Kubernetes core/v1.PodSecurityContext
-
-
- |
-
-(Optional)
- SecurityContext that applies to all the containers of the Jenkins -Master. As per kubernetes specification, it can be overridden -for each container individually. -Defaults to: -runAsUser: 1000 -fsGroup: 1000 - |
-
-containers
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Container
-
-
- |
-
- List of containers belonging to the pod. -Containers cannot currently be added or removed. -There must be at least one container in a Pod. -Defaults to: -- image: jenkins/jenkins:lts -imagePullPolicy: Always -livenessProbe: -failureThreshold: 12 -httpGet: -path: /login -port: http -scheme: HTTP -initialDelaySeconds: 80 -periodSeconds: 10 -successThreshold: 1 -timeoutSeconds: 5 -name: jenkins-master -readinessProbe: -failureThreshold: 3 -httpGet: -path: /login -port: http -scheme: HTTP -initialDelaySeconds: 30 -periodSeconds: 10 -successThreshold: 1 -timeoutSeconds: 1 -resources: -limits: -cpu: 1500m -memory: 3Gi -requests: -cpu: “1” -memory: 600Mi - |
-
-imagePullSecrets
-
-
-[]Kubernetes core/v1.LocalObjectReference
-
-
- |
-
-(Optional)
- ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. -If specified, these secrets will be passed to individual puller implementations for them to use. For example, -in the case of docker, only DockerConfig type secrets are honored. -More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - |
-
-volumes
-
-
-[]Kubernetes core/v1.Volume
-
-
- |
-
-(Optional)
- List of volumes that can be mounted by containers belonging to the pod. -More info: https://kubernetes.io/docs/concepts/storage/volumes - |
-
-basePlugins
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Plugin
-
-
- |
-
- BasePlugins contains plugins required by operator -Defaults to : -- name: kubernetes -version: 1.15.7 -- name: workflow-job -version: “2.32” -- name: workflow-aggregator -version: “2.6” -- name: git -version: 3.10.0 -- name: job-dsl -version: “1.74” -- name: configuration-as-code -version: “1.19” -- name: configuration-as-code-support -version: “1.19” -- name: kubernetes-credentials-provider -version: 0.12.1 - |
-
-plugins
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Plugin
-
-
- |
-
-(Optional)
- Plugins contains plugins required by user - |
-
-(Appears on: -Jenkins) -
--
JenkinsSpec defines the desired state of the Jenkins
- -| Field | -Description | -
|---|---|
-master
-
-
-JenkinsMaster
-
-
- |
-
- Master represents Jenkins master pod properties and Jenkins plugins. -Every single change here requires a pod restart. - |
-
-seedJobs
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.SeedJob
-
-
- |
-
-(Optional)
- SeedJobs defines list of Jenkins Seed Job configurations -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-seed-jobs-and-pipelines - |
-
-service
-
-
-Service
-
-
- |
-
-(Optional)
- Service is Kubernetes service of Jenkins master HTTP pod -Defaults to : -port: 8080 -type: ClusterIP - |
-
-slaveService
-
-
-Service
-
-
- |
-
-(Optional)
- Service is Kubernetes service of Jenkins slave pods -Defaults to : -port: 50000 -type: ClusterIP - |
-
-backup
-
-
-Backup
-
-
- |
-
-(Optional)
- Backup defines configuration of Jenkins backup -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-backup-and-restore - |
-
-restore
-
-
-Restore
-
-
- |
-
-(Optional)
- Backup defines configuration of Jenkins backup restore -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-backup-and-restore - |
-
-groovyScripts
-
-
-GroovyScripts
-
-
- |
-
-(Optional)
- GroovyScripts defines configuration of Jenkins customization via groovy scripts - |
-
-configurationAsCode
-
-
-ConfigurationAsCode
-
-
- |
-
-(Optional)
- ConfigurationAsCode defines configuration of Jenkins customization via Configuration as Code Jenkins plugin - |
-
-(Appears on: -Jenkins) -
--
JenkinsStatus defines the observed state of Jenkins
- -| Field | -Description | -
|---|---|
-operatorVersion
-
-string
-
- |
-
-(Optional)
- OperatorVersion is the operator version which manages this CR - |
-
-provisionStartTime
-
-
-Kubernetes meta/v1.Time
-
-
- |
-
-(Optional)
- ProvisionStartTime is a time when Jenkins master pod has been created - |
-
-baseConfigurationCompletedTime
-
-
-Kubernetes meta/v1.Time
-
-
- |
-
-(Optional)
- BaseConfigurationCompletedTime is a time when Jenkins base configuration phase has been completed - |
-
-userConfigurationCompletedTime
-
-
-Kubernetes meta/v1.Time
-
-
- |
-
-(Optional)
- UserConfigurationCompletedTime is a time when Jenkins user configuration phase has been completed - |
-
-restoredBackup
-
-uint64
-
- |
-
-(Optional)
- RestoredBackup is the restored backup number after Jenkins master pod restart - |
-
-lastBackup
-
-uint64
-
- |
-
-(Optional)
- LastBackup is the latest backup number - |
-
-pendingBackup
-
-uint64
-
- |
-
-(Optional)
- PendingBackup is the pending backup number - |
-
-backupDoneBeforePodDeletion
-
-bool
-
- |
-
-(Optional)
- BackupDoneBeforePodDeletion tells if backup before pod deletion has been made - |
-
-userAndPasswordHash
-
-string
-
- |
-
-(Optional)
- UserAndPasswordHash is a SHA256 hash made from the username and password - |
-
-createdSeedJobs
-
-[]string
-
- |
-
-(Optional)
- CreatedSeedJobs contains list of seed job ids already created in Jenkins - |
-
-appliedGroovyScripts
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.AppliedGroovyScript
-
-
- |
-
-(Optional)
- AppliedGroovyScripts is a list with all applied groovy scripts in Jenkins by the operator - |
-
-(Appears on: -Notification) -
--
Mailgun is handler for Mailgun email service notification channel
- -| Field | -Description | -
|---|---|
-domain
-
-string
-
- |
-- | -
-apiKeySecretKeySelector
-
-
-SecretKeySelector
-
-
- |
-- | -
-recipient
-
-string
-
- |
-- | -
-from
-
-string
-
- |
-- | -
-(Appears on: -Notification) -
--
MicrosoftTeams is handler for Microsoft MicrosoftTeams notification channel
- -| Field | -Description | -
|---|---|
-webHookURLSecretKeySelector
-
-
-SecretKeySelector
-
-
- |
-
- The web hook URL to MicrosoftTeams App - |
-
-
Notification is a service configuration used to send notifications about Jenkins status
- -| Field | -Description | -
|---|---|
-loggingLevel
-
-
-NotificationLogLevel
-
-
- |
-- | -
-verbose
-
-bool
-
- |
-- | -
-name
-
-string
-
- |
-- | -
-slack
-
-
-github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Slack
-
-
- |
-- | -
-teams
-
-
-github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.MicrosoftTeams
-
-
- |
-- | -
-mailgun
-
-
-github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Mailgun
-
-
- |
-- | -
string alias)-(Appears on: -Notification) -
--
NotificationLogLevel defines logging level of Notification
- --(Appears on: -JenkinsMaster) -
--
Plugin defines Jenkins plugin
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-
- Name is the name of Jenkins plugin - |
-
-version
-
-string
-
- |
-
- Version is the version of Jenkins plugin - |
-
-(Appears on: -JenkinsSpec) -
--
Restore defines configuration of Jenkins backup restore operation
- -| Field | -Description | -
|---|---|
-containerName
-
-string
-
- |
-
- ContainerName is the container name responsible for restore backup operation - |
-
-action
-
-
-Handler
-
-
- |
-
- Action defines action which performs restore backup in restore container sidecar - |
-
-recoveryOnce
-
-uint64
-
- |
-
-(Optional)
- RecoveryOnce if want to restore specific backup set this field and then Jenkins will be restarted and desired backup will be restored - |
-
-(Appears on: -Mailgun, -MicrosoftTeams, -Slack) -
--
SecretKeySelector selects a key of a Secret.
- -| Field | -Description | -
|---|---|
-secret
-
-
-Kubernetes core/v1.LocalObjectReference
-
-
- |
-
- The name of the secret in the pod’s namespace to select from. - |
-
-key
-
-string
-
- |
-
- The key of the secret to select from. Must be a valid secret key. - |
-
-(Appears on: -Customization) -
--
SecretRef is reference to Kubernetes secret
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-- | -
-(Appears on: -JenkinsSpec) -
--
SeedJob defines configuration for seed job -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-seed-jobs-and-pipelines
- -| Field | -Description | -
|---|---|
-id
-
-string
-
- |
-
- ID is the unique seed job name - |
-
-credentialID
-
-string
-
- |
-
- CredentialID is the Kubernetes secret name which stores repository access credentials - |
-
-description
-
-string
-
- |
-
-(Optional)
- Description is the description of the seed job - |
-
-targets
-
-string
-
- |
-
- Targets is the repository path where the seed job definitions are - |
-
-repositoryBranch
-
-string
-
- |
-
- RepositoryBranch is the repository branch where the seed job definitions are - |
-
-repositoryUrl
-
-string
-
- |
-
- RepositoryURL is the repository access URL. Can be SSH or HTTPS. - |
-
-credentialType
-
-
-JenkinsCredentialType
-
-
- |
-
-(Optional)
- JenkinsCredentialType is the https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/ credential type - |
-
-githubPushTrigger
-
-bool
-
- |
-
-(Optional)
- GitHubPushTrigger is used for GitHub web hooks - |
-
-buildPeriodically
-
-string
-
- |
-
-(Optional)
- BuildPeriodically is setting for scheduled trigger - |
-
-pollSCM
-
-string
-
- |
-
-(Optional)
- PollSCM is setting for polling changes in SCM - |
-
-ignoreMissingFiles
-
-bool
-
- |
-
-(Optional)
- IgnoreMissingFiles is setting for Job DSL API plugin to ignore files that miss - |
-
-additionalClasspath
-
-string
-
- |
-
-(Optional)
- AdditionalClasspath is setting for Job DSL API plugin to set Additional Classpath - |
-
-failOnMissingPlugin
-
-bool
-
- |
-
-(Optional)
- FailOnMissingPlugin is setting for Job DSL API plugin that fails job if required plugin is missing - |
-
-unstableOnDeprecation
-
-bool
-
- |
-
-(Optional)
- UnstableOnDeprecation is setting for Job DSL API plugin that sets build status as unstable if build using deprecated features - |
-
-(Appears on: -JenkinsSpec) -
--
Service defines Kubernetes service attributes
- -| Field | -Description | -
|---|---|
-annotations
-
-map[string]string
-
- |
-
-(Optional)
- Annotations is an unstructured key value map stored with a resource that may be -set by external tools to store and retrieve arbitrary metadata. They are not -queryable and should be preserved when modifying objects. -More info: http://kubernetes.io/docs/user-guide/annotations - |
-
-labels
-
-map[string]string
-
- |
-
- Route service traffic to pods with label keys and values matching this -selector. If empty or not present, the service is assumed to have an -external process managing its endpoints, which Kubernetes will not -modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. -Ignored if type is ExternalName. -More info: https://kubernetes.io/docs/concepts/services-networking/service/ - |
-
-type
-
-
-Kubernetes core/v1.ServiceType
-
-
- |
-
-(Optional)
- Type determines how the Service is exposed. Defaults to ClusterIP. Valid -options are ExternalName, ClusterIP, NodePort, and LoadBalancer. -“ExternalName” maps to the specified externalName. -“ClusterIP” allocates a cluster-internal IP address for load-balancing to -endpoints. Endpoints are determined by the selector or if that is not -specified, by manual construction of an Endpoints object. If clusterIP is -“None”, no virtual IP is allocated and the endpoints are published as a -set of endpoints rather than a stable IP. -“NodePort” builds on ClusterIP and allocates a port on every node which -routes to the clusterIP. -“LoadBalancer” builds on NodePort and creates an -external load-balancer (if supported in the current cloud) which routes -to the clusterIP. -More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services—service-types - |
-
-port
-
-int32
-
- |
-
- The port that is exposed by this service. -More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - |
-
-nodePort
-
-int32
-
- |
-
-(Optional)
- The port on each node on which this service is exposed when type=NodePort or LoadBalancer. -Usually assigned by the system. If specified, it will be allocated to the service -if unused, or else creation of the service will fail. -Default is to auto-allocate a port if the ServiceType of this Service requires one. -More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - |
-
-loadBalancerSourceRanges
-
-[]string
-
- |
-
-(Optional)
- If specified and supported by the platform, this will restrict traffic through the cloud-provider -the load-balancer will be restricted to the specified client IPs. This field will be ignored if the -cloud-provider does not support the feature.” -More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ - |
-
-loadBalancerIP
-
-string
-
- |
-
-(Optional)
- Only applies to Service Type: LoadBalancer -LoadBalancer will get created with the IP specified in this field. -This feature depends on whether the underlying cloud-provider supports specifying -the loadBalancerIP when a load balancer is created. -This field will be ignored if the cloud-provider does not support the feature. - |
-
-(Appears on: -Notification) -
--
Slack is handler for Slack notification channel
- -| Field | -Description | -
|---|---|
-webHookURLSecretKeySelector
-
-
-SecretKeySelector
-
-
- |
-
- The web hook URL to Slack App - |
-
-Generated with gen-crd-api-reference-docs
-on git commit f4c4235.
-
This document explains how to setup your development environment.
- -mkdir -p $GOPATH/src/github.com/jenkinsci
-cd $GOPATH/src/github.com/jenkinsci/
-git clone git@github.com:jenkinsci/kubernetes-operator.git
-cd kubernetes-operator
-make go-dependenciesBuild and run Jenkins Operator locally:
-make build minikube-run EXTRA_ARGS='--minikube --local'Once minikube and Jenkins Operator are up and running, apply Jenkins custom resource:
-kubectl apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
-kubectl get jenkins -o yaml
-kubectl get poYou can also run the controller locally and make it listen to a remote Kubernetes server.
-make run NAMESPACE=default KUBECTL_CONTEXT=remote-k8s EXTRA_ARGS='--kubeconfig ~/.kube/config'Once minikube and Jenkins Operator are up and running, apply Jenkins custom resource:
-kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
-kubectl --context remote-k8s --namespace default get jenkins -o yaml
-kubectl --context remote-k8s --namespace default get poRun unit tests:
-make testRun e2e tests with minikube:
-make minikube-start
-eval $(minikube docker-env)
-make build e2eRun the specific e2e test:
-make build e2e E2E_TEST_SELECTOR='^TestConfiguration$'At first, you need to start minikube:
-$ make minikube-start
-$ eval $(minikube docker-env) Build a Docker image inside the provided Linux container by:
-$ make indockerBuild Jenkins Operator inside a container using:
-$ make buildThen exit the container and run:
- -make e2e
-
-
-To be able to work with the docker daemon on minikube machine run the following command before building an image:
eval $(minikube docker-env)pkg/apis/jenkinsio/*/jenkins_types.go has changedRun:
-make deepcopy-genminikube service jenkins-operator-http-<cr_name> --url
-kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.user}' | base64 -d
-kubectl get secret jenkins-operator-credentials-<cr_name> -o 'jsonpath={.data.password}' | base64 -dexport GOPATH=/home/go # example value
-export GOROOT=/usr/lib/go-1.12 # example value
-export PATH=$GOPATH/bin:$PATHgo get golang.org/x/tools/cmd/goimports
-cd $GOPATH/src/golang.org/x/tools/cmd/goimports
-go build
-go install
-
-
-go get -u golang.org/x/lint/golint
-cd $GOPATH/src/golang.org/x/lint/golint
-go build
-go install
-
-
-go get github.com/mrtazz/checkmake
-cd $GOPATH/src/github.com/mrtazz/checkmake
-go build
-go install
-
-
-mkdir -p $GOPATH/src/github.com/dominikh/
-cd $GOPATH/src/github.com/dominikh/
-git clone https://github.com/dominikh/go-tools.git
-cd $GOPATH/src/github.com/dominikh/go-tools/staticcheck
-go build
-go install
-
-
-
-
- Packages:
--
Package v1alpha2 contains the API Schema definitions for the jenkins.io v1alpha2 API group
- -Resource Types: --
Jenkins is the Schema for the jenkins API
- -| Field | -Description | -||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-apiVersion
-string |
-
-
-jenkins.io/v1alpha2
-
- |
-||||||||||||||||
-kind
-string
- |
-Jenkins |
-||||||||||||||||
-metadata
-
-
-Kubernetes meta/v1.ObjectMeta
-
-
- |
-
-Refer to the Kubernetes API documentation for the fields of the
-metadata field.
- |
-||||||||||||||||
-spec
-
-
-JenkinsSpec
-
-
- |
-
- Spec defines the desired state of the Jenkins -- -
|
-||||||||||||||||
-status
-
-
-JenkinsStatus
-
-
- |
-
- Status defines the observed state of Jenkins - |
-
-(Appears on: -JenkinsStatus) -
--
AppliedGroovyScript is the applied groovy script in Jenkins by the operator
- -| Field | -Description | -
|---|---|
-configurationType
-
-string
-
- |
-
- ConfigurationType is the name of the configuration type(base-groovy, user-groovy, user-casc) - |
-
-source
-
-string
-
- |
-
- Source is the name of source where is located groovy script - |
-
-name
-
-string
-
- |
-
- Name is the name of the groovy script - |
-
-Hash
-
-string
-
- |
-
- Hash is the hash of the groovy script and secrets which it uses - |
-
-(Appears on: -JenkinsSpec) -
--
Backup defines the configuration of a Jenkins backup
- -| Field | -Description | -
|---|---|
-containerName
-
-string
-
- |
-
- ContainerName is the container name responsible for backup operation - |
-
-action
-
-
-Handler
-
-
- |
-
- Action defines the action which performs the backup in the backup container sidecar - |
-
-interval
-
-uint64
-
- |
-
- Interval tells you how often the backup is made in seconds -Defaults to 30. - |
-
-makeBackupBeforePodDeletion
-
-bool
-
- |
-
- MakeBackupBeforePodDeletion tells the operator to make a backup before Jenkins master pod deletion - |
-
-(Appears on: -Customization) -
--
ConfigMapRef is the reference to Kubernetes ConfigMap
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-- | -
-(Appears on: -JenkinsSpec) -
--
ConfigurationAsCode defines configuration of Jenkins customization via the Configuration as Code Jenkins plugin
- -| Field | -Description | -
|---|---|
-Customization
-
-
-Customization
-
-
- |
-- | -
-(Appears on: -JenkinsMaster) -
--
Container defines the Kubernetes container attributes
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-
- Name of the container specified as a DNS_LABEL. -Each container in a pod must have a unique name (DNS_LABEL). - |
-
-image
-
-string
-
- |
-
- Docker image name. -More info: https://kubernetes.io/docs/concepts/containers/images - |
-
-imagePullPolicy
-
-
-Kubernetes core/v1.PullPolicy
-
-
- |
-
- Image pull policy. -One of Always, Never, IfNotPresent. -Defaults to Always. - |
-
-resources
-
-
-Kubernetes core/v1.ResourceRequirements
-
-
- |
-
- Compute Resources required by this container. -More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - |
-
-command
-
-[]string
-
- |
-
-(Optional)
- Entrypoint array. Not executed within a shell. -The docker image’s ENTRYPOINT is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable -cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax -can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, -regardless of whether the variable exists or not. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - |
-
-args
-
-[]string
-
- |
-
-(Optional)
- Arguments to the entrypoint. -The docker image’s CMD is used if this is not provided. -Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable -cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax -can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, -regardless of whether the variable exists or not. -More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - |
-
-workingDir
-
-string
-
- |
-
-(Optional)
- Container’s working directory. -If not specified, the container runtime’s default will be used, which -might be configured in the container image. - |
-
-ports
-
-
-[]Kubernetes core/v1.ContainerPort
-
-
- |
-
-(Optional)
- List of ports to expose from the container. Exposing a port here gives -the system additional information about the network connections a -container uses, but is primarily informational. Not specifying a port here -DOES NOT prevent that port from being exposed. Any port which is -listening on the default “0.0.0.0” address inside a container will be -accessible from the network. - |
-
-envFrom
-
-
-[]Kubernetes core/v1.EnvFromSource
-
-
- |
-
-(Optional)
- List of sources to populate environment variables in the container. -The keys defined within a source must be a C_IDENTIFIER. All invalid keys -will be reported as an event when the container is starting. When a key exists in multiple -sources, the value associated with the last source will take precedence. -Values defined by an Env with a duplicate key will take precedence. - |
-
-env
-
-
-[]Kubernetes core/v1.EnvVar
-
-
- |
-
-(Optional)
- List of environment variables to set in the container. - |
-
-volumeMounts
-
-
-[]Kubernetes core/v1.VolumeMount
-
-
- |
-
-(Optional)
- Pod volumes to mount into the container’s filesystem. - |
-
-livenessProbe
-
-
-Kubernetes core/v1.Probe
-
-
- |
-
-(Optional)
- Periodic probe of container liveness. -Container will be restarted if the probe fails. - |
-
-readinessProbe
-
-
-Kubernetes core/v1.Probe
-
-
- |
-
-(Optional)
- Periodic probe of container service readiness. -Container will be removed from service endpoints if the probe fails. - |
-
-lifecycle
-
-
-Kubernetes core/v1.Lifecycle
-
-
- |
-
-(Optional)
- Actions that the management system should take in response to container lifecycle events. - |
-
-securityContext
-
-
-Kubernetes core/v1.SecurityContext
-
-
- |
-
-(Optional)
- Security options the pod should run with. -More info: https://kubernetes.io/docs/concepts/policy/security-context/ -More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - |
-
-(Appears on: -ConfigurationAsCode, -GroovyScripts) -
--
Customization defines configuration of Jenkins customization
- -| Field | -Description | -
|---|---|
-secret
-
-
-SecretRef
-
-
- |
-- | -
-configurations
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.ConfigMapRef
-
-
- |
-- | -
-(Appears on: -JenkinsSpec) -
--
GroovyScripts defines configuration of Jenkins customization via groovy scripts
- -| Field | -Description | -
|---|---|
-Customization
-
-
-Customization
-
-
- |
-- | -
-(Appears on: -Backup, -Restore) -
--
Handler defines a specific action that should be taken
- -| Field | -Description | -
|---|---|
-exec
-
-
-Kubernetes core/v1.ExecAction
-
-
- |
-
- Exec specifies the action to take. - |
-
string alias)-(Appears on: -SeedJob) -
--
JenkinsCredentialType defines the type of Jenkins credential used in the seed job mechanism
- --(Appears on: -JenkinsSpec) -
--
JenkinsMaster defines the Jenkins master pod attributes and plugins, -every single change requires a Jenkins master pod restart
- -| Field | -Description | -
|---|---|
-masterAnnotations
-
-map[string]string
-
- |
-
-(Optional)
- Annotations is an unstructured key value map stored with a resource that may be -set by external tools to store and retrieve arbitrary metadata. They are not -queryable and should be preserved when modifying objects. -More info: http://kubernetes.io/docs/user-guide/annotations - |
-
-nodeSelector
-
-map[string]string
-
- |
-
-(Optional)
- NodeSelector is a selector which must be true for the pod to fit on a node. -Selector which must match a node’s labels for the pod to be scheduled on that node. -More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - |
-
-securityContext
-
-
-Kubernetes core/v1.PodSecurityContext
-
-
- |
-
-(Optional)
- SecurityContext that applies to all the containers of the Jenkins -Master. As per kubernetes specification, it can be overridden -for each container individually. -Defaults to: -runAsUser: 1000 -fsGroup: 1000 - |
-
-containers
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Container
-
-
- |
-
- List of containers belonging to the pod. -Containers cannot currently be added or removed. -There must be at least one container in a Pod. -Defaults to: -- image: jenkins/jenkins:lts -imagePullPolicy: Always -livenessProbe: -failureThreshold: 12 -httpGet: -path: /login -port: http -scheme: HTTP -initialDelaySeconds: 80 -periodSeconds: 10 -successThreshold: 1 -timeoutSeconds: 5 -name: jenkins-master -readinessProbe: -failureThreshold: 3 -httpGet: -path: /login -port: http -scheme: HTTP -initialDelaySeconds: 30 -periodSeconds: 10 -successThreshold: 1 -timeoutSeconds: 1 -resources: -limits: -cpu: 1500m -memory: 3Gi -requests: -cpu: “1” -memory: 600Mi - |
-
-imagePullSecrets
-
-
-[]Kubernetes core/v1.LocalObjectReference
-
-
- |
-
-(Optional)
- ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. -If specified, these secrets will be passed to individual puller implementations for them to use. For example, -in the case of docker, only DockerConfig type secrets are honored. -More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - |
-
-volumes
-
-
-[]Kubernetes core/v1.Volume
-
-
- |
-
-(Optional)
- List of volumes that can be mounted by containers belonging to the pod. -More info: https://kubernetes.io/docs/concepts/storage/volumes - |
-
-basePlugins
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Plugin
-
-
- |
-
- BasePlugins contains plugins required by operator -Defaults to : -- name: kubernetes -version: 1.15.7 -- name: workflow-job -version: “2.32” -- name: workflow-aggregator -version: “2.6” -- name: git -version: 3.10.0 -- name: job-dsl -version: “1.74” -- name: configuration-as-code -version: “1.19” -- name: configuration-as-code-support -version: “1.19” -- name: kubernetes-credentials-provider -version: 0.12.1 - |
-
-plugins
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Plugin
-
-
- |
-
-(Optional)
- Plugins contains plugins required by user - |
-
-(Appears on: -Jenkins) -
--
JenkinsSpec defines the desired state of the Jenkins
- -| Field | -Description | -
|---|---|
-master
-
-
-JenkinsMaster
-
-
- |
-
- Master represents Jenkins master pod properties and Jenkins plugins. -Every single change here requires a pod restart. - |
-
-seedJobs
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.SeedJob
-
-
- |
-
-(Optional)
- SeedJobs defines list of Jenkins Seed Job configurations -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-seed-jobs-and-pipelines - |
-
-service
-
-
-Service
-
-
- |
-
-(Optional)
- Service is Kubernetes service of Jenkins master HTTP pod -Defaults to : -port: 8080 -type: ClusterIP - |
-
-slaveService
-
-
-Service
-
-
- |
-
-(Optional)
- Service is Kubernetes service of Jenkins slave pods -Defaults to : -port: 50000 -type: ClusterIP - |
-
-backup
-
-
-Backup
-
-
- |
-
-(Optional)
- Backup defines configuration of Jenkins backup -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-backup-and-restore - |
-
-restore
-
-
-Restore
-
-
- |
-
-(Optional)
- Backup defines configuration of Jenkins backup restore -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-backup-and-restore - |
-
-groovyScripts
-
-
-GroovyScripts
-
-
- |
-
-(Optional)
- GroovyScripts defines configuration of Jenkins customization via groovy scripts - |
-
-configurationAsCode
-
-
-ConfigurationAsCode
-
-
- |
-
-(Optional)
- ConfigurationAsCode defines configuration of Jenkins customization via Configuration as Code Jenkins plugin - |
-
-(Appears on: -Jenkins) -
--
JenkinsStatus defines the observed state of Jenkins
- -| Field | -Description | -
|---|---|
-operatorVersion
-
-string
-
- |
-
-(Optional)
- OperatorVersion is the operator version which manages this CR - |
-
-provisionStartTime
-
-
-Kubernetes meta/v1.Time
-
-
- |
-
-(Optional)
- ProvisionStartTime is a time when Jenkins master pod has been created - |
-
-baseConfigurationCompletedTime
-
-
-Kubernetes meta/v1.Time
-
-
- |
-
-(Optional)
- BaseConfigurationCompletedTime is a time when Jenkins base configuration phase has been completed - |
-
-userConfigurationCompletedTime
-
-
-Kubernetes meta/v1.Time
-
-
- |
-
-(Optional)
- UserConfigurationCompletedTime is a time when Jenkins user configuration phase has been completed - |
-
-restoredBackup
-
-uint64
-
- |
-
-(Optional)
- RestoredBackup is the restored backup number after Jenkins master pod restart - |
-
-lastBackup
-
-uint64
-
- |
-
-(Optional)
- LastBackup is the latest backup number - |
-
-pendingBackup
-
-uint64
-
- |
-
-(Optional)
- PendingBackup is the pending backup number - |
-
-backupDoneBeforePodDeletion
-
-bool
-
- |
-
-(Optional)
- BackupDoneBeforePodDeletion tells if backup before pod deletion has been made - |
-
-userAndPasswordHash
-
-string
-
- |
-
-(Optional)
- UserAndPasswordHash is a SHA256 hash made from the username and password - |
-
-createdSeedJobs
-
-[]string
-
- |
-
-(Optional)
- CreatedSeedJobs contains list of seed job ids already created in Jenkins - |
-
-appliedGroovyScripts
-
-
-[][]github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.AppliedGroovyScript
-
-
- |
-
-(Optional)
- AppliedGroovyScripts is a list with all applied groovy scripts in Jenkins by the operator - |
-
-(Appears on: -Notification) -
--
Mailgun is handler for Mailgun email service notification channel
- -| Field | -Description | -
|---|---|
-domain
-
-string
-
- |
-- | -
-apiKeySecretKeySelector
-
-
-SecretKeySelector
-
-
- |
-- | -
-recipient
-
-string
-
- |
-- | -
-from
-
-string
-
- |
-- | -
-(Appears on: -Notification) -
--
MicrosoftTeams is handler for Microsoft MicrosoftTeams notification channel
- -| Field | -Description | -
|---|---|
-webHookURLSecretKeySelector
-
-
-SecretKeySelector
-
-
- |
-
- The web hook URL to MicrosoftTeams App - |
-
-
Notification is a service configuration used to send notifications about Jenkins status
- -| Field | -Description | -
|---|---|
-loggingLevel
-
-
-NotificationLogLevel
-
-
- |
-- | -
-verbose
-
-bool
-
- |
-- | -
-name
-
-string
-
- |
-- | -
-slack
-
-
-github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Slack
-
-
- |
-- | -
-teams
-
-
-github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.MicrosoftTeams
-
-
- |
-- | -
-mailgun
-
-
-github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Mailgun
-
-
- |
-- | -
string alias)-(Appears on: -Notification) -
--
NotificationLogLevel defines logging level of Notification
- --(Appears on: -JenkinsMaster) -
--
Plugin defines Jenkins plugin
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-
- Name is the name of Jenkins plugin - |
-
-version
-
-string
-
- |
-
- Version is the version of Jenkins plugin - |
-
-(Appears on: -JenkinsSpec) -
--
Restore defines configuration of Jenkins backup restore operation
- -| Field | -Description | -
|---|---|
-containerName
-
-string
-
- |
-
- ContainerName is the container name responsible for restore backup operation - |
-
-action
-
-
-Handler
-
-
- |
-
- Action defines action which performs restore backup in restore container sidecar - |
-
-recoveryOnce
-
-uint64
-
- |
-
-(Optional)
- RecoveryOnce if want to restore specific backup set this field and then Jenkins will be restarted and desired backup will be restored - |
-
-(Appears on: -Mailgun, -MicrosoftTeams, -Slack) -
--
SecretKeySelector selects a key of a Secret.
- -| Field | -Description | -
|---|---|
-secret
-
-
-Kubernetes core/v1.LocalObjectReference
-
-
- |
-
- The name of the secret in the pod’s namespace to select from. - |
-
-key
-
-string
-
- |
-
- The key of the secret to select from. Must be a valid secret key. - |
-
-(Appears on: -Customization) -
--
SecretRef is reference to Kubernetes secret
- -| Field | -Description | -
|---|---|
-name
-
-string
-
- |
-- | -
-(Appears on: -JenkinsSpec) -
--
SeedJob defines configuration for seed job -More info: https://github.com/jenkinsci/kubernetes-operator/blob/master/docs/getting-started.md#configure-seed-jobs-and-pipelines
- -| Field | -Description | -
|---|---|
-id
-
-string
-
- |
-
- ID is the unique seed job name - |
-
-credentialID
-
-string
-
- |
-
- CredentialID is the Kubernetes secret name which stores repository access credentials - |
-
-description
-
-string
-
- |
-
-(Optional)
- Description is the description of the seed job - |
-
-targets
-
-string
-
- |
-
- Targets is the repository path where the seed job definitions are - |
-
-repositoryBranch
-
-string
-
- |
-
- RepositoryBranch is the repository branch where the seed job definitions are - |
-
-repositoryUrl
-
-string
-
- |
-
- RepositoryURL is the repository access URL. Can be SSH or HTTPS. - |
-
-credentialType
-
-
-JenkinsCredentialType
-
-
- |
-
-(Optional)
- JenkinsCredentialType is the https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/ credential type - |
-
-githubPushTrigger
-
-bool
-
- |
-
-(Optional)
- GitHubPushTrigger is used for GitHub web hooks - |
-
-buildPeriodically
-
-string
-
- |
-
-(Optional)
- BuildPeriodically is setting for scheduled trigger - |
-
-pollSCM
-
-string
-
- |
-
-(Optional)
- PollSCM is setting for polling changes in SCM - |
-
-ignoreMissingFiles
-
-bool
-
- |
-
-(Optional)
- IgnoreMissingFiles is setting for Job DSL API plugin to ignore files that miss - |
-
-additionalClasspath
-
-string
-
- |
-
-(Optional)
- AdditionalClasspath is setting for Job DSL API plugin to set Additional Classpath - |
-
-failOnMissingPlugin
-
-bool
-
- |
-
-(Optional)
- FailOnMissingPlugin is setting for Job DSL API plugin that fails job if required plugin is missing - |
-
-unstableOnDeprecation
-
-bool
-
- |
-
-(Optional)
- UnstableOnDeprecation is setting for Job DSL API plugin that sets build status as unstable if build using deprecated features - |
-
-(Appears on: -JenkinsSpec) -
--
Service defines Kubernetes service attributes
- -| Field | -Description | -
|---|---|
-annotations
-
-map[string]string
-
- |
-
-(Optional)
- Annotations is an unstructured key value map stored with a resource that may be -set by external tools to store and retrieve arbitrary metadata. They are not -queryable and should be preserved when modifying objects. -More info: http://kubernetes.io/docs/user-guide/annotations - |
-
-labels
-
-map[string]string
-
- |
-
- Route service traffic to pods with label keys and values matching this -selector. If empty or not present, the service is assumed to have an -external process managing its endpoints, which Kubernetes will not -modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. -Ignored if type is ExternalName. -More info: https://kubernetes.io/docs/concepts/services-networking/service/ - |
-
-type
-
-
-Kubernetes core/v1.ServiceType
-
-
- |
-
-(Optional)
- Type determines how the Service is exposed. Defaults to ClusterIP. Valid -options are ExternalName, ClusterIP, NodePort, and LoadBalancer. -“ExternalName” maps to the specified externalName. -“ClusterIP” allocates a cluster-internal IP address for load-balancing to -endpoints. Endpoints are determined by the selector or if that is not -specified, by manual construction of an Endpoints object. If clusterIP is -“None”, no virtual IP is allocated and the endpoints are published as a -set of endpoints rather than a stable IP. -“NodePort” builds on ClusterIP and allocates a port on every node which -routes to the clusterIP. -“LoadBalancer” builds on NodePort and creates an -external load-balancer (if supported in the current cloud) which routes -to the clusterIP. -More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services—service-types - |
-
-port
-
-int32
-
- |
-
- The port that is exposed by this service. -More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - |
-
-nodePort
-
-int32
-
- |
-
-(Optional)
- The port on each node on which this service is exposed when type=NodePort or LoadBalancer. -Usually assigned by the system. If specified, it will be allocated to the service -if unused, or else creation of the service will fail. -Default is to auto-allocate a port if the ServiceType of this Service requires one. -More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - |
-
-loadBalancerSourceRanges
-
-[]string
-
- |
-
-(Optional)
- If specified and supported by the platform, this will restrict traffic through the cloud-provider -the load-balancer will be restricted to the specified client IPs. This field will be ignored if the -cloud-provider does not support the feature.” -More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ - |
-
-loadBalancerIP
-
-string
-
- |
-
-(Optional)
- Only applies to Service Type: LoadBalancer -LoadBalancer will get created with the IP specified in this field. -This feature depends on whether the underlying cloud-provider supports specifying -the loadBalancerIP when a load balancer is created. -This field will be ignored if the cloud-provider does not support the feature. - |
-
-(Appears on: -Notification) -
--
Slack is handler for Slack notification channel
- -| Field | -Description | -
|---|---|
-webHookURLSecretKeySelector
-
-
-SecretKeySelector
-
-
- |
-
- The web hook URL to Slack App - |
-
-Generated with gen-crd-api-reference-docs
-on git commit f4c4235.
-