-
Notifications
You must be signed in to change notification settings - Fork 8
/
reverse-proxy.yaml
185 lines (185 loc) · 5.24 KB
/
reverse-proxy.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
175
176
177
178
179
180
181
182
183
184
185
kind: Template
apiVersion: v1
labels:
version: 1.3.0-1
group: infrastructure
metadata:
annotations:
description: This is a nginx based reverse proxy for Artifactory's docker repositories
tags: artifactory,reverseproxy,nginx,instant-app
version: 1.3.0-1
name: artifactory-rev-proxy
parameters:
- name: ARTIFACTORY_REVERSE_PROXY_HOSTNAME
displayName: FQDN of Artifactory reverse proxy
required: true
- name: S2I_NGINX_IMAGESTREAM
displayName: S2I NGIX ImageStream name
required: true
description: This is the Source-to-Image NGINX ImageStream to be used to create the reverse proxy for Artifactory.
value: s2i-nginx-acme
- name: SOURCE_REPOSITORY_URL
description: The URL of the repository with your application source code.
displayName: Git Repository URL
required: true
value: http://gitlab.com/goern/artifactory-on-openshift.git
- name: SOURCE_REPOSITORY_REF
displayName: Git Reference
description: Set this to a branch name, tag or other ref of your repository if you are not using the default branch.
- name: CONTEXT_DIR
displayName: Context Directory
description: Set this to the relative path to your project if it is not in the root of your repository.
value: container-image/reverse-proxy-nginx
- name: GITHUB_WEBHOOK_SECRET
displayName: GitHub Webhook Secret
description: A secret string used to configure the GitHub webhook.
from: '[a-zA-Z0-9]{40}'
generate: expression
- name: REV_PROXY_IMAGESTREAM
displayName: Reverse Proxy ImageStream name
required: true
description: This is the ImageStream name incl. Tag to be used to run the reverse proxy for Artifactory.
value: artifactory-rev-proxy
objects:
# tag::Service[]
- kind: Service
apiVersion: v1
metadata:
name: artifactory-rev-proxy # <1>
annotations:
description: NGINX based reverse proxy for Artifactory Docker repositories
service.alpha.openshift.io/dependencies: '[{"name":"artifactory","namespace":"","kind":"Service"}]'
service.alpha.openshift.io/serving-cert-secret-name: artifactory-nginx
spec:
ports:
-
name: web
port: 80
targetPort: 8080
selector:
name: artifactory-rev-proxy # <2>
# end::Service[]
# tag::DeploymentConfig[]
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: artifactory-rev-proxy
annotations:
description: "Defines how to deploy artifactory-rev-proxy"
spec:
strategy:
type: Rolling
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- artifactory-rev-proxy
from:
kind: ImageStreamTag
name: "${REV_PROXY_IMAGESTREAM}:latest" # <1>
- type: ConfigChange
replicas: 1
selector:
name: artifactory-rev-proxy
template:
metadata:
name: artifactory-rev-proxy
labels:
name: artifactory-rev-proxy
spec:
containers:
- name: artifactory-rev-proxy
image: ' '
ports:
- containerPort: 8080
resources:
limits:
cpu: 25m
memory: 16Mi
volumeMounts:
- name: generated-certificate-volume
mountPath: /opt/app-root/etc/
readOnly: true
volumes:
- name: generated-certificate-volume
secret:
secretName: artifactory-nginx
# end::DeploymentConfig[]
# tag::Route[]
- kind: Route
apiVersion: v1
metadata:
name: artifactory-rev-proxy
spec:
host: "${ARTIFACTORY_REVERSE_PROXY_HOSTNAME}" # <1>
to:
kind: Service
name: artifactory-rev-proxy # <2>
tls:
insecureEdgeTerminationPolicy: Allow
termination: edge
# end::Route[]
- kind: BuildConfig
apiVersion: v1
metadata:
name: s2i-nginx-acme
labels:
application: artifactory-rev-proxy
spec:
triggers:
- type: ConfigChange
- type: ImageChange
imageChange:
kind: ImageStreamTag
name: s2i-nginx:latest
source:
type: Git
git:
uri: https://gitlab.com/goern/s2i-nginx.git
strategy:
type: Docker
dockerStrategy:
output:
to:
kind: ImageStreamTag
name: 's2i-nginx-acme:latest'
# tag::BuildConfig[]
- kind: BuildConfig
apiVersion: v1
metadata:
name: artifactory-rev-proxy # <1>
labels:
application: artifactory-rev-proxy
spec:
triggers:
- type: ConfigChange
- type: ImageChange
source:
type: Git
git:
uri: "${SOURCE_REPOSITORY_URL}" # <2>
ref: "${SOURCE_REPOSITORY_REF}" # <3>
contextDir: "${CONTEXT_DIR}" # <4>
strategy:
type: Source
sourceStrategy:
from:
kind: ImageStreamTag
name: "${S2I_NGINX_IMAGESTREAM}:latest" # <5>
env:
-
name: GIT_SSL_NO_VERIFY
value: 'true'
output:
to:
kind: ImageStreamTag
name: "${REV_PROXY_IMAGESTREAM}:latest" # <6>
# end::BuildConfig[]
# tag::ImageStream[]
- kind: ImageStream
apiVersion: v1
metadata:
description: This is a NGINX based reverse proxy for Artifactory's docker repositories
name: "${REV_PROXY_IMAGESTREAM}" # <1>
# end::ImageStream[]