-
Notifications
You must be signed in to change notification settings - Fork 4
/
nodejs-artifactory-example.yaml
174 lines (174 loc) · 4.47 KB
/
nodejs-artifactory-example.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
kind: Template
apiVersion: v1
labels:
version: 1.0.0
metadata:
annotations:
openshift.io/display-name: Node.js ACME Example
description: This is an example of NodeJS using Artifactory as a NPM mirror/cache
tags: artifactory,nodejs
version: 1.0.0
iconClass: icon-nodejs
template.openshift.io/long-description: >-
This template defines resources needed to develop a NodeJS application,
including a build configuration and application deployment configuration.
Builds will use an Artifactory repository for NPM, this has been preconfigured
by the Ops team, so that Devs dont have to care.
template.openshift.io/documentation-url: 'https://github.com/RHsyseng/artifactory-on-openshift'
name: nodejs-artifactory-example
parameters:
- name: NAME
displayName: Name
description: The name assigned to all of the frontend objects defined in this template.
required: true
value: nodejs-artifactory-example
- name: MEMORY_LIMIT
displayName: Memory Limit
description: Maximum amount of memory the container can use.
required: true
value: 512Mi
- name: APPLICATION_DOMAIN
displayName: Application Hostname
description: >-
The exposed hostname that will route to the Node.js service, if left blank
a value will be defaulted.
value: ''
objects:
# tag::Service[]
- kind: Service
apiVersion: v1
metadata:
name: '${NAME}'
annotations:
description: Exposes and load balances the application pods
spec:
ports:
- name: web
port: 8080
targetPort: 8080
selector:
name: '${NAME}'
# end::Service[]
# tag::Route[]
- kind: Route
apiVersion: v1
metadata:
name: '${NAME}'
spec:
host: '${APPLICATION_DOMAIN}'
to:
kind: Service
name: '${NAME}'
# end::Route[]
# tag::DeploymentConfig[]
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: '${NAME}'
spec:
strategy:
type: Rolling
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- nodejs-example
from:
kind: ImageStreamTag
name: '${NAME}:latest'
- type: ConfigChange
replicas: 1
selector:
name: '${NAME}'
template:
metadata:
name: '${NAME}'
labels:
name: '${NAME}'
spec:
containers:
- name: nodejs-example
image: ' '
ports:
- containerPort: 8080
readinessProbe:
timeoutSeconds: 3
initialDelaySeconds: 3
httpGet:
path: /
port: 8080
livenessProbe:
timeoutSeconds: 3
initialDelaySeconds: 30
httpGet:
path: /
port: 8080
resources:
limits:
memory: '${MEMORY_LIMIT}'
env: []
# end::DeploymentConfig[]
# tag::BuildConfigApplication[]
- kind: BuildConfig
apiVersion: v1
metadata:
name: '${NAME}' # <1>
spec:
triggers:
- type: ConfigChange
- type: ImageChange
imageChange:
kind: ImageStreamTag
name: nodejs-acme:4-11.13 # <2>
source:
type: Git
git:
uri: https://github.com/openshift/nodejs-ex # <3>
strategy:
type: Source
sourceStrategy:
from:
kind: ImageStreamTag
name: "nodejs-acme:4-11.13" # <4>
output:
to:
kind: ImageStreamTag
name: '${NAME}:latest' # <5>
# end::BuildConfigApplication[]
# tag::BuildConfigS2I[]
- kind: BuildConfig
apiVersion: v1
metadata:
name: nodejs-acme # <1>
spec:
triggers:
- type: ConfigChange
- type: ImageChange
source:
type: Git
git:
uri: "https://github.com/goern/artifactory-on-openshift" # <2>
contextDir: "container-image/s2i-node-acme" # <3>
strategy:
type: Docker
dockerStrategy:
output:
to:
kind: ImageStreamTag
name: "nodejs-acme:4-11.13" # <4>
# end::BuildConfigS2I[]
# tag::ImageStreamS2I[]
- kind: ImageStream
apiVersion: v1
metadata:
description: Build and run NodeJS applications, ACME Corp's s2i-node using Artifactory
name: "nodejs-acme" # <1>
# end::ImageStreamS2I[]
# tag::ImageStreamApplication[]
- kind: ImageStream
apiVersion: v1
metadata:
description: ImageStream for our application
name: "nodejs-artifactory-example" # <1>
# end::ImageStreamApplication[]