-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathopenshift-api-swagger-template.yml
170 lines (170 loc) · 4.13 KB
/
openshift-api-swagger-template.yml
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
apiVersion: template.openshift.io/v1
kind: Template
metadata:
annotations:
description: OpenShift Swagger UI
iconClass: icon-load-balancer
tags: api,swagger
name: openshift-api-swagger
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
labels:
application: ${APP_NAME}
name: ${APP_NAME}
- apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
application: ${APP_NAME}
name: ${APP_NAME}
spec:
output:
to:
kind: ImageStreamTag
name: ${APP_NAME}:latest
runPolicy: Serial
source:
contextDir: swagger-dist
git:
uri: ${SOURCE_REPOSITORY_URL}
ref: ${SOURCE_REPOSITORY_REF}
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: httpd:2.4
namespace: ${IMAGE_STREAM_NAMESPACE}
type: Source
triggers:
- type: ConfigChange
- imageChange: {}
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
labels:
app: ${APP_NAME}
name: ${APP_NAME}
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: ${APP_NAME}
name: ${APP_NAME}
spec:
host: ${HOSTNAME_HTTP}
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
port:
targetPort: 8080
to:
kind: Service
name: ${APP_NAME}
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
labels:
app: ${APP_NAME}
name: ${APP_NAME}
spec:
replicas: 1
selector:
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
strategy:
activeDeadlineSeconds: 21600
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: ${APP_NAME}
deploymentconfig: ${APP_NAME}
spec:
containers:
- image: ''
imagePullPolicy: Always
name: ${APP_NAME}
ports:
- containerPort: 8080
protocol: TCP
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 3
timeoutSeconds: 3
resources:
limits:
memory: ${MEMORY_LIMIT}
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- ${APP_NAME}
from:
kind: ImageStreamTag
name: ${APP_NAME}:latest
type: ImageChange
parameters:
- description: Application Name
displayName: Application Name
name: APP_NAME
required: true
value: openshift-api-swagger
- description: The URL of the repository with the application source code.
displayName: Git Repository URL
name: SOURCE_REPOSITORY_URL
required: true
value: https://github.com/sabre1041/openshift-api-swagger.git
- description: Git branch/tag reference.
displayName: Git Reference
name: SOURCE_REPOSITORY_REF
value: master
- description: 'Custom hostname for http service route. Leave blank for default hostname,
e.g.: <application-name>-<project>.<default-domain-suffix>'
displayName: Custom http Route Hostname
name: HOSTNAME_HTTP
required: false
- description: Maximum amount of memory the container can use.
displayName: Memory Limit
name: MEMORY_LIMIT
required: true
value: 512Mi
- description: The Namespace where the Base ImageStream resides.
displayName: Namespace
name: IMAGE_STREAM_NAMESPACE
required: true
value: openshift