---
|
kind: Template
|
apiVersion: v1
|
metadata:
|
name: todolist-fe-deploy
|
annotations:
|
openshift.io/display-name: Static react js App Deploy Template
|
description: A template to deploy your an App with a HTTP endpoint
|
iconClass: icon-cube
|
tags: http
|
objects:
|
- apiVersion: v1
|
kind: ImageStream
|
metadata:
|
labels:
|
build: "${NAME}"
|
name: "${NAME}"
|
spec: {}
|
- apiVersion: v1
|
kind: DeploymentConfig
|
metadata:
|
name: "${NAME}"
|
labels:
|
app: "${NAME}"
|
spec:
|
replicas: 1
|
selector:
|
name: "${NAME}"
|
strategy:
|
activeDeadlineSeconds: 21600
|
resources: {}
|
rollingParams:
|
intervalSeconds: 1
|
maxSurge: 25%
|
maxUnavailable: 25%
|
timeoutSeconds: 600
|
updatePeriodSeconds: 1
|
type: Rolling
|
template:
|
metadata:
|
creationTimestamp:
|
labels:
|
name: "${NAME}"
|
spec:
|
containers:
|
- image: "docker-registry.default.svc:5000/${NAMESPACE}/${NAME}:${APP_TAG}"
|
imagePullPolicy: Always
|
name: "${NAME}"
|
ports:
|
- containerPort: 8080
|
protocol: TCP
|
resources: {}
|
terminationMessagePath: "/dev/termination-log"
|
readinessProbe:
|
httpGet:
|
path: /
|
port: 8080
|
initialDelaySeconds: 10
|
timeoutSeconds: 1
|
dnsPolicy: ClusterFirst
|
restartPolicy: Always
|
securityContext: {}
|
terminationGracePeriodSeconds: 30
|
test: false
|
triggers: []
|
- apiVersion: v1
|
kind: Service
|
metadata:
|
labels:
|
name: "${NAME}"
|
name: "${NAME}"
|
spec:
|
ports:
|
- name: 8080-tcp
|
port: 8080
|
protocol: TCP
|
targetPort: 8080
|
selector:
|
name: "${NAME}"
|
sessionAffinity: None
|
type: ClusterIP
|
- apiVersion: v1
|
kind: Route
|
metadata:
|
labels:
|
name: "${NAME}"
|
name: "${NAME}"
|
spec:
|
port:
|
targetPort: 8080-tcp
|
to:
|
kind: Service
|
name: "${NAME}"
|
weight: 100
|
wildcardPolicy: None
|
- apiVersion: v1
|
kind: RoleBinding
|
metadata:
|
name: edit
|
roleRef:
|
name: edit
|
subjects:
|
- kind: ServiceAccount
|
name: jenkins
|
namespace: "${PIPELINES_NAMESPACE}"
|
userNames:
|
- system:serviceaccount:${PIPELINES_NAMESPACE}:${DEPLOYER_USER}
|
parameters:
|
- name: NAME
|
displayName: Name
|
description: The name assigned to all objects and the related imagestream.
|
required: true
|
- name: APP_TAG
|
displayName: App Tag
|
description: The tag of the image to use eg latest.
|
required: true
|
- name: NAMESPACE
|
displayName: Docker image namespace
|
description: The namespace of the image to use eg js-apps.
|
required: true
|
- name: DEPLOYER_USER
|
displayName: Deployer User
|
description: The name to the serviceaccount user for deploying apps eg jenkins
|
required: true
|
- name: PIPELINES_NAMESPACE
|
displayName: Project/Namespace for Jenkins Pipelines
|
description: The project/namespace where the Jenkins executing pipelines is deployed.
|
required: true
|
labels:
|
template: todolist-fe-deploy-template
|