ruby-ex/deployment/manifests/app.yaml

105 lines
2.2 KiB
YAML

apiVersion: v1
kind: Template
objects:
#- apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: ${APP}-data
# labels:
# app: ${APP}
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: ${STORAGE_SIZE}
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: ${APP}
labels:
app: ${APP}
spec:
replicas: ${REPLICAS}
selector:
app: ${APP}
deploymentconfig: ${APP}
template:
metadata:
labels:
app: ${APP}
deploymentconfig: ${APP}
spec:
containers:
- image: ${PROJECT_BASE}-${BUILD_ENV}/${APP}:${ENV}
imagePullPolicy: Always
name: ${APP}
ports:
- containerPort: ${HTTP_PORT}
protocol: TCP
triggers:
- type: ImageChange
imageChangeParams:
automatic: false
containerNames:
- ${APP}
from:
kind: ImageStreamTag
name: ${APP}:${ENV}
namespace: ${PROJECT_BASE}-${BUILD_ENV}
- apiVersion: v1
kind: Service
metadata:
name: ${APP}
labels:
app: ${APP}
spec:
ports:
- name: http
port: ${HTTP_PORT}
protocol: TCP
targetPort: ${HTTP_PORT}
selector:
app: ${APP}
deploymentconfig: ${APP}
- apiVersion: v1
kind: Route
metadata:
name: ${APP}
labels:
app: ${APP}
spec:
port:
targetPort: http
to:
kind: Service
name: ${APP}
parameters:
- 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
- description: The number of replicas.
displayName: Replicas
name: REPLICAS
value: "1"
- description: The HTTP port.
displayName: HTTP port
name: HTTP_PORT
value: 8080
- description: The size of the storage to reclaim.
displayName: Storage size
name: STORAGE_SIZE
value: 5Gi