Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejendra Rana committed May 29, 2021
1 parent 22c01ac commit d77a604
Showing 1 changed file with 280 additions and 0 deletions.
280 changes: 280 additions & 0 deletions example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: quotes
annotations:
openshift.io/display-name: Quotes Application
description: The Quotes application provides an HTTP API that returns a random, funny quote.
iconClass: icon-php
tags: php,mysql
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
lookupPolicy:
local: false
- apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: quotesapi:latest
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: /
git:
uri: ${APP_GIT_URL}
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: php:7.2
namespace: openshift
type: Source
successfulBuildsHistoryLimit: 5
triggers:
- github:
secret: ${SECRET}
type: GitHub
- generic:
secret: ${SECRET}
type: Generic
- type: ConfigChange
- imageChange:
type: ImageChange
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: quotesapi
deploymentconfig: quotesapi
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
annotations:
labels:
app: quotesapi
deploymentconfig: quotesapi
spec:
containers:
- env:
- name: DATABASE_NAME
value: quotesdb
- name: DATABASE_PASSWORD
value: ${PASSWORD}
- name: DATABASE_SERVICE_NAME
value: quotesdb
- name: DATABASE_USER
value: quoteapp
imagePullPolicy: Always
name: quotesapi
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8443
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- quotesapi
from:
kind: ImageStreamTag
name: quotesapi:latest
type: ImageChange
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
annotations:
labels:
app: quotesdb
name: quotesdb
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: quotesdb
deploymentconfig: quotesdb
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
annotations:
labels:
app: quotesdb
deploymentconfig: quotesdb
spec:
containers:
- env:
- name: MYSQL_DATABASE
value: quotesdb
- name: MYSQL_PASSWORD
value: ${PASSWORD}
- name: MYSQL_USER
value: quoteapp
imagePullPolicy: IfNotPresent
name: quotesdb
ports:
- containerPort: 3306
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/lib/mysql/data
name: quotesdb-volume-1
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: quotesdb-volume-1
persistentVolumeClaim:
claimName: quotesdb-claim
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- quotesdb
from:
kind: ImageStreamTag
name: mysql:5.7
namespace: openshift
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: 8443-tcp
port: 8443
protocol: TCP
targetPort: 8443
selector:
app: quotesapi
deploymentconfig: quotesapi
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
annotations:
labels:
app: quotesdb
name: quotesdb
spec:
ports:
- name: 3306-tcp
port: 3306
protocol: TCP
targetPort: 3306
selector:
app: quotesdb
deploymentconfig: quotesdb
sessionAffinity: None
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
labels:
app: quotesapi
name: quotesapi
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: quotesapi
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
name: quotesdb-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 300Mi
storageClassName: gp2
volumeMode: Filesystem
parameters:
- name: APP_GIT_URL
displayName: Application Source Git URL
description: The Git URL of the application source code
required: true
value: https://github.com/tsrana/php-quotes
- name: PASSWORD
displayName: Database Password
description: Password to access the database
generate: expression
from: '[a-zA-Z0-9]{16}'
- name: SECRET
displayName: Webhook Secret
description: Secret for webhooks
generate: expression
from: '[a-zA-Z0-9]{40}'

0 comments on commit d77a604

Please sign in to comment.