nant.apps.jenkins.4.0.81.source-code.kubernetes-jenkins-deployment.yml Maven / Gradle / Ivy
Go to download
[Jenkins](http://jenkins-ci.org/) extendable open source continuous integration server using OpenShift Jenkins image
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
annotations:
configmap.fabric8.io/update-on-change: "jenkins"
fabric8.io/target-platform: "kubernetes"
spec:
replicas: 1
template:
spec:
initContainers:
- name: "content-repository-init"
image: "centos:7"
command: ['sh', '-c', 'for i in {1..100}; do sleep 1; if curl -L -m 4 content-repository; then exit 0; else echo waiting for content-repository ...; fi; done; exit 1']
containers:
- image: "fabric8/jenkins-openshift:${jenkins-openshift.version}"
imagePullPolicy: "IfNotPresent"
name: "jenkins"
readinessProbe:
timeoutSeconds: 10
initialDelaySeconds: 10
httpGet:
path: "/login"
port: 8080
livenessProbe:
timeoutSeconds: 10
initialDelaySeconds: 420
failureThreshold: 30
httpGet:
path: "/login"
port: 8080
ports:
- containerPort: 50000
name: "slave"
- containerPort: 8080
name: "http"
env:
- name: PROJECT_NAMESPACE
value: "${PROJECT_NAMESPACE}"
- name: "KUBERNETES_NAMESPACE"
valueFrom:
fieldRef:
fieldPath: "metadata.namespace"
- name: KUBERNETES_TRUST_CERTIFICATES
value: "true"
- name: KUBERNETES_MASTER
value: "https://kubernetes.default:443"
- name: MAX_METASPACE_SIZE
value: 200m
- name: KEYCLOAK_URL
valueFrom:
configMapKeyRef:
name: jenkins
key: keycloak.url
- name: KEYCLOAK_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: jenkins
key: client.secret
- name: JENKINS_OPTS
value: "-Dgroovy.use.classvalue=true"
- name: JAVA_HOME
value: "/etc/alternatives/java_sdk"
- name: MAVEN_OPTS
value: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
- name: RECOMMENDER_API_TOKEN
valueFrom:
secretKeyRef:
name: jenkins-recommender-api-token
key: token
resources:
limits:
memory: 1Gi
cpu: 0.5
requests:
cpu: "0"
volumeMounts:
- mountPath: /var/lib/jenkins
name: jenkins-home
readOnly: false
- name: jenkins-config
mountPath: /opt/openshift/configuration/
serviceAccountName: "jenkins"
volumes:
- name: jenkins-home
persistentVolumeClaim:
claimName: jenkins-home
- name: jenkins-config
configMap:
name: jenkins