2016-12-05 22:19:05 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Template
|
|
|
|
objects:
|
2016-12-15 17:32:06 +00:00
|
|
|
#- apiVersion: v1
|
|
|
|
# kind: PersistentVolumeClaim
|
|
|
|
# metadata:
|
|
|
|
# name: ${APP}-data
|
|
|
|
# labels:
|
|
|
|
# app: ${APP}
|
|
|
|
# spec:
|
|
|
|
# accessModes:
|
|
|
|
# - ReadWriteOnce
|
|
|
|
# resources:
|
|
|
|
# requests:
|
|
|
|
# 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:
|
2016-12-16 12:35:41 +00:00
|
|
|
- containerPort: ${HTTP_PORT}
|
2016-12-05 22:19:05 +00:00
|
|
|
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:
|
2016-12-16 12:35:41 +00:00
|
|
|
- name: http
|
|
|
|
port: ${HTTP_PORT}
|
2016-12-05 22:19:05 +00:00
|
|
|
protocol: TCP
|
2016-12-16 12:35:41 +00:00
|
|
|
targetPort: ${HTTP_PORT}
|
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
|
|
|
- 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:
|
2016-12-16 12:35:41 +00:00
|
|
|
targetPort: http
|
2016-12-05 22:19:05 +00:00
|
|
|
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-16 12:35:41 +00:00
|
|
|
- description: The HTTP port.
|
|
|
|
displayName: HTTP port
|
|
|
|
name: HTTP_PORT
|
2016-12-16 12:37:09 +00:00
|
|
|
value: "8080"
|
2016-12-09 00:13:22 +00:00
|
|
|
- description: The size of the storage to reclaim.
|
|
|
|
displayName: Storage size
|
|
|
|
name: STORAGE_SIZE
|
|
|
|
value: 5Gi
|