Last active
October 20, 2017 18:03
-
-
Save sub-mod/dddad917ebdf73beff280666c090a2ae to your computer and use it in GitHub Desktop.
oshinko-jspark-sc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "v1", | |
"kind": "Template", | |
"labels": { | |
"application": "oshinko-java-spark", | |
"createdBy": "template-oshinko-java-build-dc" | |
}, | |
"metadata": { | |
"annotations": { | |
"description": "Create a buildconfig, imagestream and deploymentconfig using source-to-image and java spark source hosted in git", | |
"openshift.io/display-name": "JavaSpark", | |
"template.openshift.io/long-description": "", | |
"template.openshift.io/provider-display-name": "Red Hat, Inc.", | |
"template.openshift.io/documentation-url": "http://radanalytics.io", | |
"template.openshift.io/support-url": "https://access.redhat.com" | |
}, | |
"name": "oshinko-java-spark-build-dc" | |
}, | |
"objects": [ | |
{ | |
"apiVersion": "v1", | |
"kind": "ServiceAccount", | |
"metadata": { | |
"name": "${APPLICATION_NAME}-sa", | |
"labels": { | |
"appName": "${APPLICATION_NAME}" | |
} | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "RoleBinding", | |
"metadata": { | |
"name": "${APPLICATION_NAME}-oshinko-edit", | |
"labels": { | |
"appName": "${APPLICATION_NAME}" | |
} | |
}, | |
"roleRef": { | |
"name": "edit" | |
}, | |
"subjects": [{ | |
"kind": "ServiceAccount", | |
"name": "${APPLICATION_NAME}-sa" | |
}] | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "ImageStream", | |
"metadata": { | |
"labels": { | |
"app": "${APPLICATION_NAME}" | |
}, | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"dockerImageRepository": "${APPLICATION_NAME}", | |
"tags": [{ | |
"name": "latest" | |
}] | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "BuildConfig", | |
"metadata": { | |
"labels": { | |
"app": "${APPLICATION_NAME}" | |
}, | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"output": { | |
"to": { | |
"kind": "ImageStreamTag", | |
"name": "${APPLICATION_NAME}:latest" | |
} | |
}, | |
"source": { | |
"git": { | |
"ref": "${GIT_REF}", | |
"uri": "${GIT_URI}" | |
}, | |
"type": "Git" | |
}, | |
"strategy": { | |
"sourceStrategy": { | |
"env": [{ | |
"name": "APP_FILE", | |
"value": "${APP_FILE}" | |
}], | |
"forcePull": true, | |
"from": { | |
"kind": "DockerImage", | |
"name": "radanalyticsio/radanalytics-java-spark:stable" | |
}, | |
"type": "Source" | |
} | |
}, | |
"triggers": [{ | |
"type": "ConfigChange" | |
}, | |
{ | |
"imageChange": {}, | |
"type": "ImageChange" | |
}, | |
{ | |
"github": { | |
"secret": "${APPLICATION_NAME}" | |
}, | |
"type": "GitHub" | |
}, | |
{ | |
"generic": { | |
"secret": "${APPLICATION_NAME}" | |
}, | |
"type": "Generic" | |
} | |
] | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "DeploymentConfig", | |
"metadata": { | |
"labels": { | |
"app": "${APPLICATION_NAME}" | |
}, | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"replicas": 1, | |
"selector": { | |
"deploymentconfig": "${APPLICATION_NAME}" | |
}, | |
"strategy": { | |
"type": "Rolling" | |
}, | |
"template": { | |
"metadata": { | |
"labels": { | |
"app": "${APPLICATION_NAME}", | |
"deploymentconfig": "${APPLICATION_NAME}" | |
} | |
}, | |
"spec": { | |
"containers": [{ | |
"env": [{ | |
"name": "OSHINKO_CLUSTER_NAME", | |
"value": "${OSHINKO_CLUSTER_NAME}" | |
}, | |
{ | |
"name": "APP_ARGS", | |
"value": "${APP_ARGS}" | |
}, | |
{ | |
"name": "SPARK_OPTIONS", | |
"value": "${SPARK_OPTIONS}" | |
}, | |
{ | |
"name": "APP_MAIN_CLASS", | |
"value": "${APP_MAIN_CLASS}" | |
}, | |
{ | |
"name": "OSHINKO_DEL_CLUSTER", | |
"value": "${OSHINKO_DEL_CLUSTER}" | |
}, | |
{ | |
"name": "APP_EXIT", | |
"value": "true" | |
}, | |
{ | |
"name": "OSHINKO_NAMED_CONFIG", | |
"value": "${OSHINKO_NAMED_CONFIG}" | |
}, | |
{ | |
"name": "OSHINKO_SPARK_DRIVER_CONFIG", | |
"value": "${OSHINKO_SPARK_DRIVER_CONFIG}" | |
}, | |
{ | |
"name": "POD_NAME", | |
"valueFrom": { | |
"fieldRef": { | |
"fieldPath": "metadata.name" | |
} | |
} | |
} | |
], | |
"image": "${APPLICATION_NAME}", | |
"imagePullPolicy": "Always", | |
"name": "${APPLICATION_NAME}", | |
"resources": {}, | |
"terminationMessagePath": "/dev/termination-log", | |
"volumeMounts": [{ | |
"mountPath": "/etc/podinfo", | |
"name": "podinfo", | |
"readOnly": false | |
}] | |
}], | |
"dnsPolicy": "ClusterFirst", | |
"restartPolicy": "Always", | |
"serviceAccount": "${APPLICATION_NAME}-sa", | |
"volumes": [{ | |
"downwardAPI": { | |
"items": [{ | |
"fieldRef": { | |
"fieldPath": "metadata.labels" | |
}, | |
"path": "labels" | |
}] | |
}, | |
"name": "podinfo" | |
}] | |
} | |
}, | |
"triggers": [{ | |
"type": "ConfigChange" | |
}, | |
{ | |
"imageChangeParams": { | |
"automatic": true, | |
"containerNames": [ | |
"${APPLICATION_NAME}" | |
], | |
"from": { | |
"kind": "ImageStreamTag", | |
"name": "${APPLICATION_NAME}:latest" | |
} | |
}, | |
"type": "ImageChange" | |
} | |
] | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "Service", | |
"metadata": { | |
"labels": { | |
"app": "${APPLICATION_NAME}" | |
}, | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"ports": [{ | |
"name": "8080-tcp", | |
"port": 8080, | |
"protocol": "TCP", | |
"targetPort": 8080 | |
}], | |
"selector": { | |
"deploymentconfig": "${APPLICATION_NAME}" | |
} | |
} | |
} | |
], | |
"parameters": [{ | |
"description": "The name to use for the BuildConfig, ImageStream and\nDeploymentConfig components", | |
"displayName": "Application Name", | |
"from": "java-[a-z0-9]{4}", | |
"generate": "expression", | |
"name": "APPLICATION_NAME" | |
}, | |
{ | |
"description": "The URL of the repository with your application source code", | |
"displayName": "Git Repository URL", | |
"name": "GIT_URI", | |
"required": true | |
}, | |
{ | |
"description": "Application main class for jar-based applications", | |
"name": "APP_MAIN_CLASS" | |
}, | |
{ | |
"description": "Command line arguments to pass to the application", | |
"displayName": "Application Arguments", | |
"name": "APP_ARGS" | |
}, | |
{ | |
"description": "List of additional options to pass to spark-submit (for exmaple\n--conf property=value or --package ...). --master and --class are\nset by the launcher and should not be set here.", | |
"displayName": "spark-submit Options", | |
"name": "SPARK_OPTIONS" | |
}, | |
{ | |
"description": "Optional branch, tag or commit", | |
"displayName": "Git Reference", | |
"name": "GIT_REF" | |
}, | |
{ | |
"description": "The name of the spark cluster to run against. The cluster will be\ncreated if it does not exist, and a random cluster name will be\nchosen if this value is left blank.", | |
"name": "OSHINKO_CLUSTER_NAME" | |
}, | |
{ | |
"description": "The name of a stored cluster configuration to use if a cluster is\ncreated, default is 'default'.", | |
"name": "OSHINKO_NAMED_CONFIG" | |
}, | |
{ | |
"description": "The name of a configmap to use for the spark configuration of the\ndriver. If this configmap is empty the default spark configuration\nwill be used.", | |
"name": "OSHINKO_SPARK_DRIVER_CONFIG" | |
}, | |
{ | |
"description": "If a cluster is created on-demand, delete the cluster when the\napplication finishes if this option is set to 'true'", | |
"name": "OSHINKO_DEL_CLUSTER", | |
"required": true, | |
"value": "true" | |
}, | |
{ | |
"description": "The name of the main JAR file. If this is not specified and there is\na single JAR produced by the build, that JAR will be chosen.", | |
"name": "APP_FILE" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment