Skip to content

Instantly share code, notes, and snippets.

@mattf
Last active October 6, 2016 10:35
Show Gist options
  • Save mattf/a90cb8182fd48333fa76b8a610bde5bb to your computer and use it in GitHub Desktop.
Save mattf/a90cb8182fd48333fa76b8a610bde5bb to your computer and use it in GitHub Desktop.
kind: Template
apiVersion: v1
template: oshinko
metadata:
name: oshinko
objects:
- kind: Service
apiVersion: v1
metadata:
name: oshinko-rest
labels:
name: oshinko-rest
spec:
ports:
- name: o-rest-port
protocol: TCP
port: 8081
targetPort: 8081
selector:
name: oshinko-rest
- kind: Service
apiVersion: v1
metadata:
name: oshinko-webui
annotations:
service.alpha.openshift.io/dependencies: '[{"name":"oshinko-rest","namespace":"","kind":"Service"}]'
labels:
name: oshinko-webui
restname: oshinko-rest
spec:
ports:
- name: o-webui-port
protocol: TCP
port: 8080
targetPort: 8080
selector:
name: oshinko-rest
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: oshinko
spec:
strategy:
type: Rolling
triggers:
- type: ConfigChange
replicas: 1
selector:
name: oshinko-rest
template:
metadata:
labels:
name: oshinko-rest
spec:
containers:
- name: oshinko-rest
image: ${SERVER_IMAGE}
env:
- name: OSHINKO_SERVER_PORT
value: "8081"
- name: OSHINKO_REST_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OSHINKO_CLUSTER_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OSHINKO_CLUSTER_IMAGE
value: ${SPARK_IMAGE}
- name: OSHINKO_WEB_NAME
value: oshinko-webui
ports:
- name: o-rest-port
containerPort: 8081
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8081
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8081
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
- name: oshinko-webui
image: ${WEBUI_IMAGE}
env:
- name: OPENSHIFT_OSHINKO_REST
value: 127.0.0.1
- name: OPENSHIFT_OSHINKO_REST_PORT
value: "8081"
ports:
- name: o-webui-port
containerPort: 8080
protocol: TCP
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-webui
spec:
host: ${WEB_ROUTE_HOSTNAME}
to:
kind: Service
name: oshinko-webui
parameters:
- name: WEB_ROUTE_HOSTNAME
description: The hostname used to create the external route for the webui
- name: SERVER_IMAGE
description: Full name of the oshinko server image
required: true
value: radanalyticsio/oshinko-rest
- name: WEBUI_IMAGE
description: Full name of the oshino web image
required: true
value: radanalyticsio/oshinko-webui
- name: SPARK_IMAGE
description: Full name of the spark image to use when creating clusters
required: true
value: radanalyticsio/openshift-spark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment