You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

295 lines
8.1 KiB

{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "jenkins-pipeline-persistent",
"creationTimestamp": null,
"annotations": {
"description": "Jenkins service, with persistent storage.\nYou must have persistent volumes available in your cluster to use this template.",
"iconClass": "icon-jenkins",
"tags": "instant-app,jenkins"
}
},
"message": "A Jenkins service has been created in your project. The username/password are admin/${JENKINS_PASSWORD}. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.",
"objects": [
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"creationTimestamp": null
},
"spec": {
"host" : "edivorce-jenkins.pathfinder.gov.bc.ca",
"to": {
"kind": "Service",
"name": "${JENKINS_SERVICE_NAME}"
},
"tls": {
"termination": "edge",
"insecureEdgeTerminationPolicy": "Redirect"
}
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}"
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "${VOLUME_CAPACITY}"
}
}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"creationTimestamp": null
},
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"jenkins"
],
"from": {
"kind": "ImageStreamTag",
"name": "${JENKINS_IMAGE_STREAM_TAG}",
"namespace": "${NAMESPACE}"
},
"lastTriggeredImage": ""
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${JENKINS_SERVICE_NAME}"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"name": "${JENKINS_SERVICE_NAME}"
}
},
"spec": {
"serviceAccountName": "${JENKINS_SERVICE_NAME}",
"containers": [
{
"name": "jenkins",
"image": " ",
"readinessProbe": {
"timeoutSeconds": 3,
"initialDelaySeconds": 3,
"httpGet": {
"path": "/login",
"port": 8080
}
},
"livenessProbe": {
"timeoutSeconds": 3,
"initialDelaySeconds": 120,
"httpGet": {
"path": "/login",
"port": 8080
}
},
"env": [
{
"name": "JENKINS_PASSWORD",
"value": "${JENKINS_PASSWORD}"
},
{
"name": "KUBERNETES_MASTER",
"value": "https://kubernetes.default:443"
},
{
"name": "KUBERNETES_TRUST_CERTIFICATES",
"value": "true"
},
{
"name": "JNLP_SERVICE_NAME",
"value": "${JNLP_SERVICE_NAME}"
}
],
"resources": {
"limits": {
"memory": "${MEMORY_LIMIT}"
}
},
"volumeMounts": [
{
"name": "${JENKINS_SERVICE_NAME}-data",
"mountPath": "/var/lib/jenkins"
}
],
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "IfNotPresent",
"capabilities": {},
"securityContext": {
"capabilities": {},
"privileged": false
}
}
],
"volumes": [
{
"name": "${JENKINS_SERVICE_NAME}-data",
"persistentVolumeClaim": {
"claimName": "${JENKINS_SERVICE_NAME}"
}
}
],
"restartPolicy": "Always",
"dnsPolicy": "ClusterFirst"
}
}
}
},
{
"kind": "ServiceAccount",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}"
}
},
{
"kind": "RoleBinding",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}_edit"
},
"groupNames": null,
"subjects": [
{
"kind": "ServiceAccount",
"name": "${JENKINS_SERVICE_NAME}"
}
],
"roleRef": {
"name": "edit"
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${JNLP_SERVICE_NAME}"
},
"spec": {
"ports": [
{
"name": "agent",
"protocol": "TCP",
"port": 50000,
"targetPort": 50000,
"nodePort": 0
}
],
"selector": {
"name": "${JENKINS_SERVICE_NAME}"
},
"portalIP": "",
"type": "ClusterIP",
"sessionAffinity": "None"
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"annotations": {
"service.alpha.openshift.io/dependencies": "[{\"name\": \"${JNLP_SERVICE_NAME}\", \"namespace\": \"\", \"kind\": \"Service\"}]",
"service.openshift.io/infrastructure": "true"
},
"creationTimestamp": null
},
"spec": {
"ports": [
{
"name": "web",
"protocol": "TCP",
"port": 80,
"targetPort": 8080,
"nodePort": 0
}
],
"selector": {
"name": "${JENKINS_SERVICE_NAME}"
},
"portalIP": "",
"type": "ClusterIP",
"sessionAffinity": "None"
}
}
],
"parameters": [
{
"name": "JENKINS_SERVICE_NAME",
"displayName": "Jenkins Service Name",
"description": "The name of the OpenShift Service exposed for the Jenkins container.",
"value": "jenkins"
},
{
"name": "JNLP_SERVICE_NAME",
"displayName": "Jenkins JNLP Service Name",
"description": "The name of the service used for master/slave communication.",
"value": "jenkins-jnlp"
},
{
"name": "JENKINS_PASSWORD",
"displayName": "Jenkins Password",
"description": "Password for the Jenkins 'admin' user.",
"generate": "expression",
"from": "[a-zA-Z0-9]{16}",
"required": true
},
{
"name": "MEMORY_LIMIT",
"displayName": "Memory Limit",
"description": "Maximum amount of memory the container can use.",
"value": "512Mi"
},
{
"name": "VOLUME_CAPACITY",
"displayName": "Volume Capacity",
"description": "Volume space available for data, e.g. 512Mi, 2Gi.",
"value": "1Gi",
"required": true
},
{
"name": "NAMESPACE",
"displayName": "Jenkins ImageStream Namespace",
"description": "The OpenShift Namespace where the Jenkins ImageStream resides.",
"value": "openshift"
},
{
"name": "JENKINS_IMAGE_STREAM_TAG",
"displayName": "Jenkins ImageStreamTag",
"description": "Name of the ImageStreamTag to be used for the Jenkins image.",
"value": "jenkins:latest"
}
],
"labels": {
"template": "jenkins-persistent-template"
}
}