forked from tech-tejendra/spring-boot-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathdocker-template.yaml
156 lines (156 loc) · 3.53 KB
/
docker-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
apiVersion: v1
kind: Template
metadata:
name: docker-template
objects:
- kind: ImageStream
apiVersion: v1
metadata:
annotations:
description: Keeps track of changes in the application image
name: ${APP_NAME}
- kind: BuildConfig
apiVersion: v1
metadata:
name: ${APP_NAME}
namespace: ${PROJECT_NAME}
labels:
app: ${APP_NAME}
spec:
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: '${APP_NAME}:latest'
successfulBuildsHistoryLimit: 5
failedBuildsHistoryLimit: 5
strategy:
type: Docker
dockerStrategy:
dockerfilePath: Dockerfile
postCommit: {}
source:
type: Git
git:
uri: ${APP_GIT_URL}
ref: ${BRANCH_NAME}
contextDir: /
triggers:
- type: Generic
generic:
secretReference:
name: ${APP_NAME}-generic-webhook-secret
- type: GitHub
github:
secretReference:
name: ${APP_NAME}-github-webhook-secret
- type: ConfigChange
runPolicy: Serial
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: ${APP_NAME}
namespace: ${PROJECT_NAME}
labels:
app: ${APP_NAME}
spec:
strategy:
type: Rolling
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 600
maxUnavailable: 25%
maxSurge: 25%
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${APP_NAME}
from:
kind: ImageStreamTag
namespace: ${PROJECT_NAME}
name: '${APP_NAME}:latest'
- type: ConfigChange
replicas: 1
revisionHistoryLimit: 10
test: false
selector:
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
template:
metadata:
labels:
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
spec:
volumes:
- name: claim1
persistentVolumeClaim:
claimName: claim1
containers:
- name: ${APP_NAME}
resources: {}
volumeMounts:
- name: claim1
mountPath: /var/local/SP
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
- kind: Service
apiVersion: v1
metadata:
annotations:
name: ${APP_NAME}
namespace: ${PROJECT_NAME}
labels:
app: ${APP_NAME}
spec:
ports:
- name: 8080-tcp
protocol: TCP
port: 8080
targetPort: 8080
selector:
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
type: ClusterIP
sessionAffinity: None
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: ${APP_NAME}
namespace: ${PROJECT_NAME}
labels:
app: ${APP_NAME}
annotations:
spec:
to:
kind: Service
name: ${APP_NAME}
weight: 100
port:
targetPort: 8080-tcp
wildcardPolicy: None
parameters:
- name: APP_NAME
displayName: Application Name
required: true
- name: PROJECT_NAME
displayName: Project Name
required: true
- name: APP_GIT_URL
displayName: Application Source Git URL
required: true
- name: BRANCH_NAME
displayName: Branch Name
required: true
value: master