Skip to content

Commit 11bbd0d

Browse files
author
Anandkumar Patel
committed
update template and gamma configs
1 parent b6007f7 commit 11bbd0d

2 files changed

Lines changed: 69 additions & 29 deletions

File tree

ansible/k8/delta/ingress-proxy/configMaps/ingress-proxy-sites-enabled-config

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ data:
6262
'' close;
6363
}
6464

65-
upstream api {
65+
upstream api_base {
6666
server api:80 max_fails=0 fail_timeout=1s;
6767
}
6868

@@ -73,7 +73,7 @@ data:
7373
access_log /var/log/nginx/api.access.log;
7474

7575
location / {
76-
proxy_pass http://api;
76+
proxy_pass http://api_base;
7777
proxy_http_version 1.1;
7878
proxy_set_header upgrade $http_upgrade;
7979
proxy_set_header connection $connection_upgrade;
@@ -85,6 +85,7 @@ data:
8585
proxy_set_header x-forwarded-protocol $scheme;
8686
proxy_set_header x-forwarded-proto $scheme;
8787
}
88+
8889
}
8990

9091
server {
@@ -112,27 +113,27 @@ data:
112113
resolver_timeout 5s;
113114

114115
location / {
115-
proxy_pass http://api;
116+
proxy_pass http://api_base;
116117
proxy_http_version 1.1;
117118
proxy_set_header upgrade $http_upgrade;
118119
proxy_set_header connection $connection_upgrade;
119120

120-
121121
proxy_set_header Host $http_host;
122122
proxy_set_header x-forwarded-host $http_host;
123123
proxy_set_header x-real-ip $remote_addr;
124124
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
125125
proxy_set_header x-forwarded-protocol $scheme;
126126
proxy_set_header x-forwarded-proto $scheme;
127127
}
128+
128129
}
129130
drake.conf: |
130131
map $http_upgrade $connection_upgrade {
131132
default upgrade;
132133
'' close;
133134
}
134135

135-
upstream drake {
136+
upstream drake_base {
136137
server drake:80 max_fails=0 fail_timeout=1s;
137138
}
138139

@@ -143,7 +144,7 @@ data:
143144
access_log /var/log/nginx/drake.access.log;
144145

145146
location / {
146-
proxy_pass http://drake;
147+
proxy_pass http://drake_base;
147148
proxy_http_version 1.1;
148149
proxy_set_header upgrade $http_upgrade;
149150
proxy_set_header connection $connection_upgrade;
@@ -155,6 +156,7 @@ data:
155156
proxy_set_header x-forwarded-protocol $scheme;
156157
proxy_set_header x-forwarded-proto $scheme;
157158
}
159+
158160
}
159161

160162
server {
@@ -182,27 +184,27 @@ data:
182184
resolver_timeout 5s;
183185

184186
location / {
185-
proxy_pass http://drake;
187+
proxy_pass http://drake_base;
186188
proxy_http_version 1.1;
187189
proxy_set_header upgrade $http_upgrade;
188190
proxy_set_header connection $connection_upgrade;
189191

190-
191192
proxy_set_header Host $http_host;
192193
proxy_set_header x-forwarded-host $http_host;
193194
proxy_set_header x-real-ip $remote_addr;
194195
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
195196
proxy_set_header x-forwarded-protocol $scheme;
196197
proxy_set_header x-forwarded-proto $scheme;
197198
}
199+
198200
}
199201
optimus.conf: |
200202
map $http_upgrade $connection_upgrade {
201203
default upgrade;
202204
'' close;
203205
}
204206

205-
upstream optimus {
207+
upstream optimus_base {
206208
server optimus:80 max_fails=0 fail_timeout=1s;
207209
}
208210

@@ -213,7 +215,7 @@ data:
213215
access_log /var/log/nginx/optimus.access.log;
214216

215217
location / {
216-
proxy_pass http://optimus;
218+
proxy_pass http://optimus_base;
217219
proxy_http_version 1.1;
218220
proxy_set_header upgrade $http_upgrade;
219221
proxy_set_header connection $connection_upgrade;
@@ -225,6 +227,7 @@ data:
225227
proxy_set_header x-forwarded-protocol $scheme;
226228
proxy_set_header x-forwarded-proto $scheme;
227229
}
230+
228231
}
229232

230233
server {
@@ -252,27 +255,27 @@ data:
252255
resolver_timeout 5s;
253256

254257
location / {
255-
proxy_pass http://optimus;
258+
proxy_pass http://optimus_base;
256259
proxy_http_version 1.1;
257260
proxy_set_header upgrade $http_upgrade;
258261
proxy_set_header connection $connection_upgrade;
259262

260-
261263
proxy_set_header Host $http_host;
262264
proxy_set_header x-forwarded-host $http_host;
263265
proxy_set_header x-real-ip $remote_addr;
264266
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
265267
proxy_set_header x-forwarded-protocol $scheme;
266268
proxy_set_header x-forwarded-proto $scheme;
267269
}
270+
268271
}
269272
apisock.conf: |
270273
map $http_upgrade $connection_upgrade {
271274
default upgrade;
272275
'' close;
273276
}
274277

275-
upstream apisock {
278+
upstream apisock_base {
276279
server apisock:80 max_fails=0 fail_timeout=1s;
277280
}
278281

@@ -283,7 +286,7 @@ data:
283286
access_log /var/log/nginx/apisock.access.log;
284287

285288
location / {
286-
proxy_pass http://apisock;
289+
proxy_pass http://apisock_base;
287290
proxy_http_version 1.1;
288291
proxy_set_header upgrade $http_upgrade;
289292
proxy_set_header connection $connection_upgrade;
@@ -295,6 +298,7 @@ data:
295298
proxy_set_header x-forwarded-protocol $scheme;
296299
proxy_set_header x-forwarded-proto $scheme;
297300
}
301+
298302
}
299303

300304
server {
@@ -322,38 +326,56 @@ data:
322326
resolver_timeout 5s;
323327

324328
location / {
325-
proxy_pass http://apisock;
329+
proxy_pass http://apisock_base;
326330
proxy_http_version 1.1;
327331
proxy_set_header upgrade $http_upgrade;
328332
proxy_set_header connection $connection_upgrade;
329333

330-
331334
proxy_set_header Host $http_host;
332335
proxy_set_header x-forwarded-host $http_host;
333336
proxy_set_header x-real-ip $remote_addr;
334337
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
335338
proxy_set_header x-forwarded-protocol $scheme;
336339
proxy_set_header x-forwarded-proto $scheme;
337340
}
341+
338342
}
339343
eru.conf: |
340344
map $http_upgrade $connection_upgrade {
341345
default upgrade;
342346
'' close;
343347
}
344348

345-
upstream eru {
349+
upstream eru_base {
346350
server eru:5501 max_fails=0 fail_timeout=1s;
347351
}
348352

353+
upstream eru_graphql {
354+
server eru:5502 max_fails=0 fail_timeout=1s;
355+
}
356+
349357
server {
350358
listen 80;
351359
client_max_body_size 5g;
352360
server_name eru.runnable.io;
353361
access_log /var/log/nginx/eru.access.log;
354362

355363
location / {
356-
proxy_pass http://eru;
364+
proxy_pass http://eru_base;
365+
proxy_http_version 1.1;
366+
proxy_set_header upgrade $http_upgrade;
367+
proxy_set_header connection $connection_upgrade;
368+
369+
proxy_set_header Host $http_host;
370+
proxy_set_header x-forwarded-host $http_host;
371+
proxy_set_header x-real-ip $remote_addr;
372+
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
373+
proxy_set_header x-forwarded-protocol $scheme;
374+
proxy_set_header x-forwarded-proto $scheme;
375+
}
376+
377+
location /graphql {
378+
proxy_pass http://eru_graphql;
357379
proxy_http_version 1.1;
358380
proxy_set_header upgrade $http_upgrade;
359381
proxy_set_header connection $connection_upgrade;
@@ -365,6 +387,7 @@ data:
365387
proxy_set_header x-forwarded-protocol $scheme;
366388
proxy_set_header x-forwarded-proto $scheme;
367389
}
390+
368391
}
369392

370393
server {
@@ -392,11 +415,24 @@ data:
392415
resolver_timeout 5s;
393416

394417
location / {
395-
proxy_pass http://eru;
418+
proxy_pass http://eru_base;
396419
proxy_http_version 1.1;
397420
proxy_set_header upgrade $http_upgrade;
398421
proxy_set_header connection $connection_upgrade;
399422

423+
proxy_set_header Host $http_host;
424+
proxy_set_header x-forwarded-host $http_host;
425+
proxy_set_header x-real-ip $remote_addr;
426+
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
427+
proxy_set_header x-forwarded-protocol $scheme;
428+
proxy_set_header x-forwarded-proto $scheme;
429+
}
430+
431+
location /graphql {
432+
proxy_pass http://eru_graphql;
433+
proxy_http_version 1.1;
434+
proxy_set_header upgrade $http_upgrade;
435+
proxy_set_header connection $connection_upgrade;
400436

401437
proxy_set_header Host $http_host;
402438
proxy_set_header x-forwarded-host $http_host;
@@ -405,14 +441,15 @@ data:
405441
proxy_set_header x-forwarded-protocol $scheme;
406442
proxy_set_header x-forwarded-proto $scheme;
407443
}
444+
408445
}
409446
egret.conf: |
410447
map $http_upgrade $connection_upgrade {
411448
default upgrade;
412449
'' close;
413450
}
414451

415-
upstream egret {
452+
upstream egret_base {
416453
server egret:5432 max_fails=0 fail_timeout=1s;
417454
}
418455

@@ -423,7 +460,7 @@ data:
423460
access_log /var/log/nginx/egret.access.log;
424461

425462
location / {
426-
proxy_pass http://egret;
463+
proxy_pass http://egret_base;
427464
proxy_http_version 1.1;
428465
proxy_set_header upgrade $http_upgrade;
429466
proxy_set_header connection $connection_upgrade;
@@ -435,6 +472,7 @@ data:
435472
proxy_set_header x-forwarded-protocol $scheme;
436473
proxy_set_header x-forwarded-proto $scheme;
437474
}
475+
438476
}
439477

440478
server {
@@ -462,17 +500,17 @@ data:
462500
resolver_timeout 5s;
463501

464502
location / {
465-
proxy_pass http://egret;
503+
proxy_pass http://egret_base;
466504
proxy_http_version 1.1;
467505
proxy_set_header upgrade $http_upgrade;
468506
proxy_set_header connection $connection_upgrade;
469507

470-
471508
proxy_set_header Host $http_host;
472509
proxy_set_header x-forwarded-host $http_host;
473510
proxy_set_header x-real-ip $remote_addr;
474511
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
475512
proxy_set_header x-forwarded-protocol $scheme;
476513
proxy_set_header x-forwarded-proto $scheme;
477514
}
515+
478516
}

ansible/roles/runnable-domain-proxy/templates/sites-enabled.tmpl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ data:
6363
'' close;
6464
}
6565

66-
{% for upstream in service.upstreams %}
66+
{% for upstream in service.upstreams %}
6767
upstream {{ service.name }}_{{ upstream.name }} {
6868
server {{ service.name }}:{{ upstream.port }} max_fails=0 fail_timeout=1s;
6969
}
70-
{% endfor %}
7170

71+
{% endfor %}
7272
server {
7373
listen 80;
7474
client_max_body_size 5g;
7575
server_name {{ service.name }}.{{ domain }};
7676
access_log /var/log/nginx/{{ service.name }}.access.log;
7777

78-
{% for upstream in service.upstreams %}
78+
{% for upstream in service.upstreams %}
7979
location {{ upstream.route }} {
8080
proxy_pass http://{{ service.name }}_{{ upstream.name }};
8181
proxy_http_version 1.1;
@@ -89,7 +89,8 @@ data:
8989
proxy_set_header x-forwarded-protocol $scheme;
9090
proxy_set_header x-forwarded-proto $scheme;
9191
}
92-
{% endfor %}
92+
93+
{% endfor %}
9394
}
9495

9596
server {
@@ -116,7 +117,7 @@ data:
116117
resolver kube-dns.kube-system.svc.cluster.local valid=5s;
117118
resolver_timeout 5s;
118119

119-
{% for upstream in service.upstreams %}
120+
{% for upstream in service.upstreams %}
120121
location {{ upstream.route }} {
121122
proxy_pass http://{{ service.name }}_{{ upstream.name }};
122123
proxy_http_version 1.1;
@@ -130,6 +131,7 @@ data:
130131
proxy_set_header x-forwarded-protocol $scheme;
131132
proxy_set_header x-forwarded-proto $scheme;
132133
}
133-
{% endfor %}
134+
135+
{% endfor %}
134136
}
135137
{% endfor %}

0 commit comments

Comments
 (0)