openshift/templates/api-dc-template.yaml
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: ${CONTAINER_NAME}-template
labels:
template: ${CONTAINER_NAME}-template
objects:
- kind: DeploymentConfig
apiVersion: apps.openshift.io/v1
metadata:
annotations:
app.openshift.io/route-disabled: "false"
openshift.io/generated-by: OpenShiftWebConsole
name: ${CONTAINER_NAME}
namespace: ${OPENSHIFT_NAMESPACE}
labels:
app: ${CONTAINER_NAME}
app.kubernetes.io/component: ${CONTAINER_NAME}
app.kubernetes.io/instance: ${CONTAINER_NAME}
app.kubernetes.io/name: ${CONTAINER_NAME}
app.kubernetes.io/part-of: ${APPLICATION_NAME}
app.openshift.io/runtime: nodejs
app.openshift.io/runtime-namespace: ${OPENSHIFT_NAMESPACE}
spec:
strategy:
type: Rolling
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 600
maxUnavailable: 25%
maxSurge: 25%
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ConfigChange
replicas: 1
revisionHistoryLimit: 10
test: false
selector:
app: ${CONTAINER_NAME}
deploymentconfig: ${CONTAINER_NAME}
template:
metadata:
creationTimestamp: null
labels:
app: ${CONTAINER_NAME}
deploymentconfig: ${CONTAINER_NAME}
annotations:
openshift.io/generated-by: OpenShiftWebConsole
spec:
containers:
- name: ${CONTAINER_NAME}
image: >-
${ARTIFACTORY_URL}/${IMAGE_REPOSITORY}/${CONTAINER_NAME}:latest
ports:
- containerPort: 3004
protocol: TCP
resources:
limits:
cpu: 150m
memory: 250Mi
requests:
cpu: 100m
memory: 150Mi
env:
- name: API_PORT
valueFrom:
secretKeyRef:
name: spr-secret
key: API_PORT
- name: BACKEND_URL
valueFrom:
secretKeyRef:
name: spr-secret
key: BACKEND_URL
- name: CONTAINERIZED
valueFrom:
secretKeyRef:
name: spr-secret
key: CONTAINERIZED
- name: FRONTEND_URL
valueFrom:
secretKeyRef:
name: spr-secret
key: FRONTEND_URL
- name: MONGO_DATABASE
valueFrom:
secretKeyRef:
name: spr-secret
key: MONGO_DATABASE
- name: MONGO_PASSWORD
valueFrom:
secretKeyRef:
name: spr-secret
key: MONGO_PASSWORD
- name: MONGO_PORT
valueFrom:
secretKeyRef:
name: spr-secret
key: MONGO_PORT
- name: MONGO_SERVICE
valueFrom:
secretKeyRef:
name: spr-secret
key: MONGO_SERVICE
- name: MONGO_USERNAME
valueFrom:
secretKeyRef:
name: spr-secret
key: MONGO_USERNAME
- name: SSO_AUTH_SERVER_URL
valueFrom:
secretKeyRef:
name: spr-secret
key: SSO_AUTH_SERVER_URL
- name: SSO_CLIENT_ID
valueFrom:
secretKeyRef:
name: spr-secret
key: SSO_CLIENT_ID
- name: SSO_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: spr-secret
key: SSO_CLIENT_SECRET
- name: GC_NOTIFY_API_KEY
valueFrom:
secretKeyRef:
name: spr-secret
key: GC_NOTIFY_API_KEY
- name: GC_NOTIFY_ADMIN_EMAIL
valueFrom:
secretKeyRef:
name: spr-secret
key: GC_NOTIFY_ADMIN_EMAIL
- name: CSS_API_TOKEN_URL
valueFrom:
secretKeyRef:
name: spr-secret
key: CSS_API_TOKEN_URL
- name: CSS_API_CLIENT_ID
valueFrom:
secretKeyRef:
name: spr-secret
key: CSS_API_CLIENT_ID
- name: CSS_API_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: spr-secret
key: CSS_API_CLIENT_SECRET
- name: CSS_API_BASE_URL
valueFrom:
secretKeyRef:
name: spr-secret
key: CSS_API_BASE_URL
- name: JIRA_ACCOUNT_EMAIL
valueFrom:
secretKeyRef:
name: spr-secret
key: JIRA_ACCOUNT_EMAIL
- name: JIRA_TOKEN
valueFrom:
secretKeyRef:
name: spr-secret
key: JIRA_TOKEN
- name: TESTING
valueFrom:
secretKeyRef:
name: spr-secret
key: TESTING
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
imagePullSecrets:
- name: artifactory-pull
schedulerName: default-scheduler
parameters:
- description: Container Name
displayName: Container Name
name: CONTAINER_NAME
required: true
- description: OpenShift Namespace
displayName: OpenShift Namespace
name: OPENSHIFT_NAMESPACE
required: true
- description: Application Name
displayName: Application Name
name: APPLICATION_NAME
required: true
- description: Image Repository
displayName: Image Repository
name: IMAGE_REPOSITORY
required: true
- description: Artifactory URL
displayName: Artifactory URL
name: ARTIFACTORY_URL
required: true