Created
February 25, 2017 01:09
-
-
Save thesteve0/731f4c6c572c9fbb31dd8f04a1917a0f to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"kind": "List", | |
"apiVersion": "v1", | |
"metadata": {}, | |
"items": [ | |
{ | |
"apiVersion": "v1", | |
"kind": "ServiceAccount", | |
"metadata": { | |
"name": "oshinko" | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "RoleBinding", | |
"metadata": { | |
"name": "oshinko-edit" | |
}, | |
"roleRef": { | |
"name": "edit" | |
}, | |
"subjects": [ | |
{ | |
"kind": "ServiceAccount", | |
"name": "oshinko" | |
} | |
] | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "Template", | |
"labels": { | |
"application": "oshinko-pyspark", | |
"createdBy": "template-oshinko-pyspark-build-dc" | |
}, | |
"metadata": { | |
"annotations": { | |
"description": "Create a buildconfig, imagestream and deploymentconfig using S2I and pyspark source hosted in git" | |
}, | |
"name": "oshinko-pyspark-build-dc" | |
}, | |
"objects": [ | |
{ | |
"apiVersion": "v1", | |
"kind": "ImageStream", | |
"metadata": { | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"dockerImageRepository": "${APPLICATION_NAME}", | |
"tags": [ | |
{ | |
"name": "latest" | |
} | |
] | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "BuildConfig", | |
"metadata": { | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"output": { | |
"to": { | |
"kind": "ImageStreamTag", | |
"name": "${APPLICATION_NAME}:latest" | |
} | |
}, | |
"source": { | |
"git": { | |
"ref": "${GIT_REF}", | |
"uri": "${GIT_URI}" | |
}, | |
"type": "Git" | |
}, | |
"strategy": { | |
"sourceStrategy": { | |
"type": "Source", | |
"env": [ | |
{ | |
"name": "APP_FILE", | |
"value": "${APP_FILE}" | |
} | |
], | |
"forcePull": true, | |
"from": { | |
"kind": "DockerImage", | |
"name": "radanalyticsio/radanalytics-pyspark" | |
} | |
} | |
}, | |
"triggers": [ | |
{ | |
"type": "ConfigChange" | |
}, | |
{ | |
"type": "ImageChange", | |
"imageChange": {} | |
}, | |
{ | |
"type": "GitHub", | |
"github": { | |
"secret": "${APPLICATION_NAME}" | |
} | |
}, | |
{ | |
"type": "Generic", | |
"generic": { | |
"secret": "${APPLICATION_NAME}" | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "DeploymentConfig", | |
"metadata": { | |
"labels": { | |
"deploymentConfig": "${APPLICATION_NAME}" | |
}, | |
"name": "${APPLICATION_NAME}" | |
}, | |
"spec": { | |
"replicas": 1, | |
"selector": { | |
"deploymentConfig": "${APPLICATION_NAME}" | |
}, | |
"strategy": { | |
"type": "Rolling" | |
}, | |
"template": { | |
"metadata": { | |
"labels": { | |
"deploymentConfig": "${APPLICATION_NAME}" | |
} | |
}, | |
"spec": { | |
"containers": [ | |
{ | |
"name": "${APPLICATION_NAME}", | |
"image": "${APPLICATION_NAME}", | |
"imagePullPolicy": "Always", | |
"resources": {}, | |
"terminationMessagePath": "/dev/termination-log", | |
"env": [ | |
{ | |
"name": "OSHINKO_CLUSTER_NAME", | |
"value": "${OSHINKO_CLUSTER_NAME}" | |
}, | |
{ | |
"name": "APP_ARGS", | |
"value": "${APP_ARGS}" | |
}, | |
{ | |
"name": "SPARK_OPTIONS", | |
"value": "${SPARK_OPTIONS}" | |
}, | |
{ | |
"name": "OSHINKO_DEL_CLUSTER", | |
"value": "${OSHINKO_DEL_CLUSTER}" | |
}, | |
{ | |
"name": "APP_EXIT", | |
"value": "${APP_EXIT}" | |
}, | |
{ | |
"name": "OSHINKO_NAMED_CONFIG", | |
"value": "${OSHINKO_NAMED_CONFIG}" | |
}, | |
{ | |
"name": "OSHINKO_SPARK_DRIVER_CONFIG", | |
"value": "${OSHINKO_SPARK_DRIVER_CONFIG}" | |
} | |
] | |
} | |
], | |
"dnsPolicy": "ClusterFirst", | |
"restartPolicy": "Always", | |
"serviceAccount": "oshinko" | |
} | |
}, | |
"triggers": [ | |
{ | |
"type": "ConfigChange" | |
}, | |
{ | |
"type": "ImageChange", | |
"imageChangeParams": { | |
"automatic": true, | |
"containerNames": [ | |
"${APPLICATION_NAME}" | |
], | |
"from": { | |
"kind": "ImageStreamTag", | |
"name": "${APPLICATION_NAME}:latest" | |
} | |
} | |
} | |
] | |
} | |
} | |
], | |
"parameters": [ | |
{ | |
"description": "The name to use for the buildconfig, imagestream and deployment components", | |
"from": "pyspark-[a-z0-9]{4}", | |
"generate": "expression", | |
"name": "APPLICATION_NAME", | |
"required": true | |
}, | |
{ | |
"description": "The name of the spark cluster to run against. The cluster will be created if it does not exist, and a random cluster name will be chosen if this value is left blank.", | |
"name": "OSHINKO_CLUSTER_NAME" | |
}, | |
{ | |
"description": "The name of a stored cluster configuration to use if a cluster is created, default is 'default'.", | |
"name": "OSHINKO_NAMED_CONFIG" | |
}, | |
{ | |
"description": "The name of a configmap to use for the spark configuration of the driver. If this configmap is empty the default spark configuration will be used.", | |
"name": "OSHINKO_SPARK_DRIVER_CONFIG" | |
}, | |
{ | |
"description": "If a cluster is created on-demand, delete the cluster when the application finishes if this option is set to 'true'", | |
"name": "OSHINKO_DEL_CLUSTER", | |
"required": true, | |
"value": "true" | |
}, | |
{ | |
"description": "The name of the main py file to run. If this is not specified and there is a single py file at top level of the git respository, that file will be chosen.", | |
"name": "APP_FILE" | |
}, | |
{ | |
"description": "Command line arguments to pass to the spark application", | |
"name": "APP_ARGS" | |
}, | |
{ | |
"description": "List of additional spark options to pass to spark-submit (for exmaple --conf property=value --conf property=value). Note, --master and --class are set by the launcher and should not be set here", | |
"name": "SPARK_OPTIONS" | |
}, | |
{ | |
"description": "Git source URI for application", | |
"name": "GIT_URI" | |
}, | |
{ | |
"description": "Git branch/tag reference", | |
"name": "GIT_REF", | |
"value": "master" | |
}, | |
{ | |
"description": "Setting this value to 'false' prevents the application from being re-deployed if/when it completes", | |
"name": "APP_EXIT", | |
"required": true, | |
"value": "false" | |
} | |
] | |
}, | |
{ | |
"apiVersion": "v1", | |
"kind": "Template", | |
"template": "oshinko-webui", | |
"metadata": { | |
"name": "oshinko-webui" | |
}, | |
"objects": [ | |
{ | |
"kind": "Service", | |
"apiVersion": "v1", | |
"metadata": { | |
"name": "${OSHINKO_WEB_NAME}", | |
"labels": { | |
"name": "${OSHINKO_WEB_NAME}" | |
} | |
}, | |
"spec": { | |
"ports": [ | |
{ | |
"name": "o-web-port", | |
"protocol": "TCP", | |
"port": 8080, | |
"targetPort": 8080 | |
} | |
], | |
"selector": { | |
"name": "${OSHINKO_WEB_NAME}" | |
} | |
} | |
}, | |
{ | |
"kind": "DeploymentConfig", | |
"apiVersion": "v1", | |
"metadata": { | |
"name": "${OSHINKO_DEPLOYMENT_NAME}" | |
}, | |
"spec": { | |
"strategy": { | |
"type": "Rolling" | |
}, | |
"triggers": [ | |
{ | |
"type": "ConfigChange" | |
} | |
], | |
"replicas": 1, | |
"selector": { | |
"name": "${OSHINKO_WEB_NAME}" | |
}, | |
"template": { | |
"metadata": { | |
"labels": { | |
"name": "${OSHINKO_WEB_NAME}" | |
} | |
}, | |
"spec": { | |
"containers": [ | |
{ | |
"name": "${OSHINKO_WEB_NAME}", | |
"image": "${OSHINKO_WEB_IMAGE}", | |
"ports": [ | |
{ | |
"name": "o-web-port", | |
"containerPort": 8080, | |
"protocol": "TCP" | |
} | |
], | |
"env": [ | |
{ | |
"name": "OSHINKO_SPARK_IMAGE", | |
"value": "${OSHINKO_CLUSTER_IMAGE}" | |
}, | |
{ | |
"name": "OSHINKO_REFRESH_INTERVAL", | |
"value": "${OSHINKO_REFRESH_INTERVAL}" | |
} | |
], | |
"readinessProbe": { | |
"failureThreshold": 3, | |
"httpGet": { | |
"path": "/", | |
"port": 8080, | |
"scheme": "HTTP" | |
}, | |
"periodSeconds": 10, | |
"successThreshold": 1, | |
"timeoutSeconds": 1 | |
}, | |
"livenessProbe": { | |
"failureThreshold": 3, | |
"httpGet": { | |
"path": "/", | |
"port": 8080, | |
"scheme": "HTTP" | |
}, | |
"periodSeconds": 10, | |
"successThreshold": 1, | |
"timeoutSeconds": 1 | |
} | |
} | |
], | |
"serviceAccount": "oshinko" | |
} | |
} | |
} | |
}, | |
{ | |
"kind": "Route", | |
"apiVersion": "v1", | |
"metadata": { | |
"name": "${OSHINKO_WEB_NAME}" | |
}, | |
"spec": { | |
"host": "${OSHINKO_WEB_ROUTE_HOSTNAME}", | |
"to": { | |
"kind": "Service", | |
"name": "${OSHINKO_WEB_NAME}" | |
} | |
} | |
} | |
], | |
"parameters": [ | |
{ | |
"name": "OSHINKO_CLUSTER_IMAGE", | |
"description": "Full name of the spark image to use when creating clusters", | |
"required": true, | |
"value": "radanalyticsio/openshift-spark" | |
}, | |
{ | |
"name": "OSHINKO_WEB_NAME", | |
"description": "Name of the oshinko web service", | |
"value": "oshinko-web" | |
}, | |
{ | |
"name": "OSHINKO_WEB_IMAGE", | |
"description": "Full name of the oshinko web image", | |
"required": true, | |
"value": "radanalyticsio/oshinko-webui" | |
}, | |
{ | |
"name": "OSHINKO_WEB_ROUTE_HOSTNAME", | |
"description": "The hostname used to create the external route for the webui" | |
}, | |
{ | |
"name": "OSHINKO_DEPLOYMENT_NAME", | |
"description": "Name of the oshinko deployment", | |
"value": "oshinko" | |
}, | |
{ | |
"name": "OSHINKO_REFRESH_INTERVAL", | |
"value": "5", | |
"description": "Refresh interval for updating cluster list in seconds" | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment