|
| 1 | +# This is a fork of the `jenkins-persistent` OpenShift template because we need |
| 2 | +# to be able to pass in more information to the Jenkins pod, such as env vars, |
| 3 | +# secrets, configmaps, etc... |
| 4 | + |
| 5 | +apiVersion: v1 |
| 6 | +kind: Template |
| 7 | +labels: |
| 8 | + app: fedora-coreos |
| 9 | + template: fedora-coreos-jenkins-template |
| 10 | +metadata: |
| 11 | + annotations: |
| 12 | + description: |- |
| 13 | + Jenkins service for the Fedora CoreOS pipeline. |
| 14 | + iconClass: icon-jenkins |
| 15 | + openshift.io/display-name: Fedora CoreOS Jenkins |
| 16 | + openshift.io/documentation-url: https://github.com/coreos/fedora-coreos-pipeline |
| 17 | + openshift.io/support-url: https://github.com/coreos/fedora-coreos-pipeline |
| 18 | + openshift.io/provider-display-name: Fedora CoreOS |
| 19 | + tags: fcos,jenkins,fedora |
| 20 | + name: fedora-coreos-jenkins |
| 21 | +objects: |
| 22 | +- apiVersion: v1 |
| 23 | + kind: Route |
| 24 | + metadata: |
| 25 | + annotations: |
| 26 | + template.openshift.io/expose-uri: http://{.spec.host}{.spec.path} |
| 27 | + name: ${JENKINS_SERVICE_NAME} |
| 28 | + spec: |
| 29 | + tls: |
| 30 | + insecureEdgeTerminationPolicy: Redirect |
| 31 | + termination: edge |
| 32 | + to: |
| 33 | + kind: Service |
| 34 | + name: ${JENKINS_SERVICE_NAME} |
| 35 | +- apiVersion: v1 |
| 36 | + kind: PersistentVolumeClaim |
| 37 | + metadata: |
| 38 | + name: ${JENKINS_SERVICE_NAME} |
| 39 | + spec: |
| 40 | + accessModes: |
| 41 | + - ReadWriteOnce |
| 42 | + resources: |
| 43 | + requests: |
| 44 | + storage: ${VOLUME_CAPACITY} |
| 45 | +- apiVersion: v1 |
| 46 | + kind: DeploymentConfig |
| 47 | + metadata: |
| 48 | + annotations: |
| 49 | + template.alpha.openshift.io/wait-for-ready: "true" |
| 50 | + name: ${JENKINS_SERVICE_NAME} |
| 51 | + spec: |
| 52 | + replicas: 1 |
| 53 | + selector: |
| 54 | + name: ${JENKINS_SERVICE_NAME} |
| 55 | + strategy: |
| 56 | + type: Recreate |
| 57 | + template: |
| 58 | + metadata: |
| 59 | + labels: |
| 60 | + name: ${JENKINS_SERVICE_NAME} |
| 61 | + spec: |
| 62 | + containers: |
| 63 | + - capabilities: {} |
| 64 | + env: |
| 65 | + - name: OPENSHIFT_ENABLE_OAUTH |
| 66 | + value: ${ENABLE_OAUTH} |
| 67 | + - name: OPENSHIFT_ENABLE_REDIRECT_PROMPT |
| 68 | + value: "true" |
| 69 | + - name: OPENSHIFT_JENKINS_JVM_ARCH |
| 70 | + value: ${JVM_ARCH} |
| 71 | + - name: KUBERNETES_MASTER |
| 72 | + value: https://kubernetes.default:443 |
| 73 | + - name: KUBERNETES_TRUST_CERTIFICATES |
| 74 | + value: "true" |
| 75 | + - name: JNLP_SERVICE_NAME |
| 76 | + value: ${JNLP_SERVICE_NAME} |
| 77 | + image: ' ' |
| 78 | + imagePullPolicy: IfNotPresent |
| 79 | + livenessProbe: |
| 80 | + failureThreshold: 30 |
| 81 | + httpGet: |
| 82 | + path: /login |
| 83 | + port: 8080 |
| 84 | + initialDelaySeconds: 420 |
| 85 | + timeoutSeconds: 3 |
| 86 | + name: jenkins |
| 87 | + readinessProbe: |
| 88 | + httpGet: |
| 89 | + path: /login |
| 90 | + port: 8080 |
| 91 | + initialDelaySeconds: 3 |
| 92 | + timeoutSeconds: 3 |
| 93 | + resources: |
| 94 | + limits: |
| 95 | + memory: ${MEMORY_LIMIT} |
| 96 | + securityContext: |
| 97 | + capabilities: {} |
| 98 | + privileged: false |
| 99 | + terminationMessagePath: /dev/termination-log |
| 100 | + volumeMounts: |
| 101 | + - mountPath: /var/lib/jenkins |
| 102 | + name: ${JENKINS_SERVICE_NAME}-data |
| 103 | + dnsPolicy: ClusterFirst |
| 104 | + restartPolicy: Always |
| 105 | + serviceAccountName: ${JENKINS_SERVICE_NAME} |
| 106 | + volumes: |
| 107 | + - name: ${JENKINS_SERVICE_NAME}-data |
| 108 | + persistentVolumeClaim: |
| 109 | + claimName: ${JENKINS_SERVICE_NAME} |
| 110 | + triggers: |
| 111 | + - imageChangeParams: |
| 112 | + automatic: true |
| 113 | + containerNames: |
| 114 | + - jenkins |
| 115 | + from: |
| 116 | + kind: ImageStreamTag |
| 117 | + name: ${JENKINS_IMAGE_STREAM_TAG} |
| 118 | + namespace: ${NAMESPACE} |
| 119 | + lastTriggeredImage: "" |
| 120 | + type: ImageChange |
| 121 | + - type: ConfigChange |
| 122 | +- apiVersion: v1 |
| 123 | + kind: ServiceAccount |
| 124 | + metadata: |
| 125 | + annotations: |
| 126 | + serviceaccounts.openshift.io/oauth-redirectreference.jenkins: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"${JENKINS_SERVICE_NAME}"}}' |
| 127 | + name: ${JENKINS_SERVICE_NAME} |
| 128 | +- apiVersion: v1 |
| 129 | + groupNames: null |
| 130 | + kind: RoleBinding |
| 131 | + metadata: |
| 132 | + name: ${JENKINS_SERVICE_NAME}_edit |
| 133 | + roleRef: |
| 134 | + name: edit |
| 135 | + subjects: |
| 136 | + - kind: ServiceAccount |
| 137 | + name: ${JENKINS_SERVICE_NAME} |
| 138 | +- apiVersion: v1 |
| 139 | + kind: Service |
| 140 | + metadata: |
| 141 | + name: ${JNLP_SERVICE_NAME} |
| 142 | + spec: |
| 143 | + ports: |
| 144 | + - name: agent |
| 145 | + nodePort: 0 |
| 146 | + port: 50000 |
| 147 | + protocol: TCP |
| 148 | + targetPort: 50000 |
| 149 | + selector: |
| 150 | + name: ${JENKINS_SERVICE_NAME} |
| 151 | + sessionAffinity: None |
| 152 | + type: ClusterIP |
| 153 | +- apiVersion: v1 |
| 154 | + kind: Service |
| 155 | + metadata: |
| 156 | + annotations: |
| 157 | + service.alpha.openshift.io/dependencies: '[{"name": "${JNLP_SERVICE_NAME}", |
| 158 | + "namespace": "", "kind": "Service"}]' |
| 159 | + service.openshift.io/infrastructure: "true" |
| 160 | + name: ${JENKINS_SERVICE_NAME} |
| 161 | + spec: |
| 162 | + ports: |
| 163 | + - name: web |
| 164 | + nodePort: 0 |
| 165 | + port: 80 |
| 166 | + protocol: TCP |
| 167 | + targetPort: 8080 |
| 168 | + selector: |
| 169 | + name: ${JENKINS_SERVICE_NAME} |
| 170 | + sessionAffinity: None |
| 171 | + type: ClusterIP |
| 172 | +parameters: |
| 173 | +- description: The name of the OpenShift Service exposed for the Jenkins container. |
| 174 | + displayName: Jenkins Service Name |
| 175 | + name: JENKINS_SERVICE_NAME |
| 176 | + value: jenkins |
| 177 | +- description: The name of the service used for master/slave communication. |
| 178 | + displayName: Jenkins JNLP Service Name |
| 179 | + name: JNLP_SERVICE_NAME |
| 180 | + value: jenkins-jnlp |
| 181 | +- description: Whether to enable OAuth OpenShift integration. If false, the static |
| 182 | + account 'admin' will be initialized with the password 'password'. |
| 183 | + displayName: Enable OAuth in Jenkins |
| 184 | + name: ENABLE_OAUTH |
| 185 | + value: "true" |
| 186 | +- description: Whether Jenkins runs with a 32 bit (i386) or 64 bit (x86_64) JVM. |
| 187 | + displayName: Jenkins JVM Architecture |
| 188 | + name: JVM_ARCH |
| 189 | + value: i386 |
| 190 | +- description: Maximum amount of memory the container can use. |
| 191 | + displayName: Memory Limit |
| 192 | + # DELTA: changed from 512Mi |
| 193 | + name: MEMORY_LIMIT |
| 194 | + value: 2Gi |
| 195 | +- description: Volume space available for data, e.g. 512Mi, 2Gi. |
| 196 | + displayName: Volume Capacity |
| 197 | + name: VOLUME_CAPACITY |
| 198 | + required: true |
| 199 | + # DELTA: changed from 1Gi |
| 200 | + value: 2Gi |
| 201 | +- description: The OpenShift Namespace where the Jenkins ImageStream resides. |
| 202 | + displayName: Jenkins ImageStream Namespace |
| 203 | + name: NAMESPACE |
| 204 | + value: openshift |
| 205 | +- description: Name of the ImageStreamTag to be used for the Jenkins image. |
| 206 | + displayName: Jenkins ImageStreamTag |
| 207 | + name: JENKINS_IMAGE_STREAM_TAG |
| 208 | + # DELTA: changed from jenkins:latest |
| 209 | + # https://github.com/coreos/fedora-coreos-pipeline/pull/70 |
| 210 | + value: jenkins:2 |
0 commit comments