2016-12-05 22:19:05 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Template
|
|
|
|
objects:
|
2016-12-08 22:53:28 +00:00
|
|
|
- apiVersion: v1
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
metadata:
|
|
|
|
name: ${APP}-data
|
|
|
|
labels:
|
|
|
|
app: ${APP}
|
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
resources:
|
|
|
|
requests:
|
2016-12-09 00:13:22 +00:00
|
|
|
storage: ${STORAGE_SIZE}
|
2016-12-05 22:19:05 +00:00
|
|
|
- apiVersion: v1
|
|
|
|
kind: DeploymentConfig
|
|
|
|
metadata:
|
2016-12-08 22:32:58 +00:00
|
|
|
name: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
labels:
|
2016-12-05 22:29:38 +00:00
|
|
|
app: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
spec:
|
2016-12-07 22:51:04 +00:00
|
|
|
replicas: ${REPLICAS}
|
2016-12-05 22:19:05 +00:00
|
|
|
selector:
|
2016-12-05 22:29:38 +00:00
|
|
|
app: ${APP}
|
|
|
|
deploymentconfig: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2016-12-05 22:29:38 +00:00
|
|
|
app: ${APP}
|
|
|
|
deploymentconfig: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
spec:
|
|
|
|
containers:
|
2016-12-05 22:29:38 +00:00
|
|
|
- image: ${PROJECT_BASE}-${BUILD_ENV}/${APP}:${ENV}
|
2016-12-06 13:30:08 +00:00
|
|
|
imagePullPolicy: Always
|
2016-12-05 22:29:38 +00:00
|
|
|
name: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 8080
|
|
|
|
protocol: TCP
|
|
|
|
triggers:
|
|
|
|
- type: ImageChange
|
|
|
|
imageChangeParams:
|
2016-12-07 20:31:01 +00:00
|
|
|
automatic: false
|
2016-12-05 22:19:05 +00:00
|
|
|
containerNames:
|
2016-12-05 22:29:38 +00:00
|
|
|
- ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
from:
|
|
|
|
kind: ImageStreamTag
|
2016-12-06 13:00:31 +00:00
|
|
|
name: ${APP}:${ENV}
|
2016-12-05 22:29:38 +00:00
|
|
|
namespace: ${PROJECT_BASE}-${BUILD_ENV}
|
2016-12-05 22:19:05 +00:00
|
|
|
- apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2016-12-08 22:32:58 +00:00
|
|
|
name: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
labels:
|
2016-12-05 22:29:38 +00:00
|
|
|
app: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
spec:
|
|
|
|
ports:
|
|
|
|
- name: 8080-tcp
|
|
|
|
port: 8080
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: 8080
|
|
|
|
selector:
|
2016-12-05 22:29:38 +00:00
|
|
|
app: ${APP}
|
|
|
|
deploymentconfig: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
- apiVersion: v1
|
|
|
|
kind: Route
|
|
|
|
metadata:
|
2016-12-08 22:32:58 +00:00
|
|
|
name: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
labels:
|
2016-12-05 22:29:38 +00:00
|
|
|
app: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
spec:
|
|
|
|
port:
|
|
|
|
targetPort: 8080-tcp
|
|
|
|
to:
|
|
|
|
kind: Service
|
2016-12-05 22:29:38 +00:00
|
|
|
name: ${APP}
|
2016-12-05 22:19:05 +00:00
|
|
|
parameters:
|
2016-12-05 22:29:38 +00:00
|
|
|
- description: The project base name.
|
|
|
|
displayName: Project base name
|
|
|
|
name: PROJECT_BASE
|
|
|
|
value: rubex
|
|
|
|
- description: The application name.
|
|
|
|
displayName: Application name
|
|
|
|
name: APP
|
|
|
|
value: frontend
|
|
|
|
- description: The environment in which the image stream is built.
|
|
|
|
displayName: Build environment
|
|
|
|
name: BUILD_ENV
|
|
|
|
value: dev
|
|
|
|
- description: The environment into which the app is deployed.
|
|
|
|
displayName: Environment
|
|
|
|
name: ENV
|
2016-12-07 22:51:04 +00:00
|
|
|
- description: The number of replicas.
|
|
|
|
displayName: Replicas
|
|
|
|
name: REPLICAS
|
2016-12-07 23:30:54 +00:00
|
|
|
value: "1"
|
2016-12-09 00:13:22 +00:00
|
|
|
- description: The size of the storage to reclaim.
|
|
|
|
displayName: Storage size
|
|
|
|
name: STORAGE_SIZE
|
|
|
|
value: 5Gi
|