-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance_template.ryml
More file actions
63 lines (56 loc) · 2.04 KB
/
instance_template.ryml
File metadata and controls
63 lines (56 loc) · 2.04 KB
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
<%
has_custom_tls = @website_location.dig("gcloud_ssl_cert_url") &&
@website_location.dig("gcloud_ssl_key_url")
has_default_tls = true
%>
<% if has_custom_tls %>
tls:
certificates:
- certFile: /certs/<%= @website_location.dig("website_id") %>.cert
keyFile: /certs/<%= @website_location.dig("website_id") %>.key
<% end %>
http:
routers:
<% if has_custom_tls or has_default_tls %>
website-location-<%= @website_location["id"] %>-https:
rule: "Host(<%= @website_location["hosts"].map { |h| "`#{h}`" }.join(", ") %>)"
service: "service-website-location-<%= @website_location["id"] %>"
tls: {}
middlewares:
- injectedHeaders<%= @website_location["id"] %>
- rateLimitSite<%= @website_location["id"] %>
<% end %>
website-location-<%= @website_location["id"] %>-http:
rule: "Host(<%= @website_location["hosts"].map { |h| "`#{h}`" }.join(", ") %>)"
entryPoints:
- web
service: "service-website-location-<%= @website_location["id"] %>"
middlewares:
- injectedHeaders<%= @website_location["id"] %>
- rateLimitSite<%= @website_location["id"] %>
<% if [true, "true"].include?(@website_location["redir_http_to_https"]) %>
- https
<% end %>
middlewares:
injectedHeaders<%= @website_location["id"] %>:
headers:
customResponseHeaders:
Access-Control-Allow-Origin: "*"
Access-Control-Allow-Methods: "*"
rateLimitSite<%= @website_location["id"] %>:
rateLimit:
average: 2000
burst: 50
period: 60m
services:
service-website-location-<%= @website_location["id"] %>:
loadBalancer:
<% if @website_location["traffic_limit_reached"] %>
passHostHeader: false
servers:
- url: "https://openodetest-us-central-1-kube.openode.dev/"
<% else %>
passHostHeader: <%= @website_location["execution_layer"] == "kubernetes" ? "true" : "false" %>
servers:
- url: "<%= @website_location["backend_url"] %>"
<% end %>