Skip to content
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.

Latest commit

 

History

History
68 lines (61 loc) · 1.78 KB

File metadata and controls

68 lines (61 loc) · 1.78 KB

Configure Kubernetes plugin

Jenkins can be installed in Kubernetes and preconfigured to run jobs (and other options) in the Kubernetes cluster, using yaml stored in a ConfigMap. See config.yml for the ConfigMap definition.

Example installation on Kubernetes:

kubectl apply -f service-account.yml
kubectl apply -f config.yml
kubectl apply -f jenkins.yml

Sample configuration

jenkins:
  location:
    url: http://jenkins/
  clouds:
    - kubernetes:
        name: kubernetes
        containerCapStr: 100

Advanced sample configuration

jenkins:
  location:
    url: http://jenkins/
  clouds:
    - kubernetes:
        name: "advanced-k8s-config"
        serverUrl: "https://avanced-k8s-config:443"
        skipTlsVerify: true
        namespace: "default"
        credentialsId: "advanced-k8s-credentials"
        jenkinsUrl: "http://jenkins/"
        connectTimeout: 0
        readTimeout: 0
        containerCapStr: 100
        maxRequestsPerHostStr: 64
        retentionTimeout: 5
        templates:
          - name: "k8s-slave"
            namespace: "default"
            label: "linux-x86_64"
            nodeUsageMode: EXCLUSIVE
            containers:
              - name: "jnlp"
                image: "jenkinsci/jnlp-slave:latest"
                alwaysPullImage: true
                workingDir: "/home/jenkins"
                ttyEnabled: true
                resourceRequestCpu: "500m"
                resourceLimitCpu: "1000m"
                resourceRequestMemory: "1Gi"
                resourceLimitMemory: "2Gi"
            volumes:
              - emptyDirVolume:
                  inMemory: false
                  mountPath: "/tmp"
            idleMinutes: "1"
            activeDeadlineSeconds: "120"
            slaveConnectTimeout: "1000"