-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-maintenance.yaml
185 lines (181 loc) · 6.71 KB
/
nginx-maintenance.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
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-maintenance
labels:
app.podman.io/name: nginx-maintenance
data:
startTimeEn: 10:00pm EST December 6, 2024
startTimeFr: 22 h 00 HNE le 6 décembre 2024
endTimeEn: 10:00pm December 8, 2024
endTimeFr: 22 h 00 le 8 décembre 2024
config.conf: |
server {
listen 80;
server_name localhost;
location / {
error_page 503 /503.html;
return 503;
}
location = /503.html {
root /usr/share/nginx/html;
internal;
}
}
503.html: |
<!--
Maintenance page copied (and slightly modified) from: https://www.canada.ca/errors/503.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Service Unavailable - Canada.ca</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="width=device-width,initial-scale=1" name="viewport" />
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
integrity="sha256-mUZM63G8m73Mcidfrv5E+Y61y7a12O5mW4ezU3bxqW4="
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://www.canada.ca/etc/designs/canada/wet-boew/css/theme.min.css"
crossorigin="anonymous"
/>
<link
rel="icon" type="image/x-icon"
href="https://www.canada.ca/etc/designs/canada/wet-boew/assets/favicon.ico"
crossorigin="anonymous"
/>
</head>
<body>
<header>
<div id="wb-bnr" class="container">
<div class="row">
<div class="brand col-xs-8 col-sm-9 col-md-6">
<img
src="https://www.canada.ca/etc/designs/canada/wet-boew/assets/sig-blk-en.svg"
alt="Government of Canada / Gouvernement du Canada"
crossorigin="anonymous"
/>
</div>
</div>
</div>
</header>
<main property="mainContentOfPage" resource="#wb-main" class="container">
<h1 id="wb-cont" class="wb-inv">Service Unavailable</h1>
<div class="row mrgn-tp-lg mrgn-bttm-lg">
<div class="col-md-12">
<div class="row">
<section>
<div class="col-md-6">
<div class="mwstext section">
<div class="row">
<div class="col-xs-3 col-sm-2 col-md-2 text-center mrgn-tp-md">
<span class="glyphicon glyphicon-warning-sign glyphicon-error"></span>
</div>
<div class="col-xs-9 col-sm-10 col-md-10">
<h2 class="mrgn-tp-md">This service is currently not available</h2>
<p class="pagetag"><b>Error 503</b></p>
</div>
</div>
<div class="row mrgn-bttm-lg">
<div class="col-md-12">
<p>The CDCP online application system will be closed for maintenance between {{startTimeEn}}, through {{endTimeEn}}.</p>
</div>
</div>
</div>
</div>
</section>
<section lang="fr">
<div class="col-md-6">
<div class="mwstext section">
<div class="row">
<div class="col-xs-3 col-sm-2 col-md-2 text-center mrgn-tp-md">
<span class="glyphicon glyphicon-warning-sign glyphicon-error"></span>
</div>
<div class="col-xs-9 col-sm-10 col-md-10">
<h2 class="mrgn-tp-md">Le service est actuellement indisponible</h2>
<p class="pagetag"><b>Erreur 503</b></p>
</div>
</div>
<div class="row mrgn-bttm-lg">
<div class="col-md-12">
<p>Le système de demande en ligne du RCSD sera fermé pour maintenance de {{startTimeFr}} à {{endTimeFr}}.</p>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</main>
<footer role="contentinfo" id="wb-info">
<div class="brand">
<div class="container">
<div class="row">
<div class="col-xs-6 visible-sm visible-xs tofpg">
<a href="#wb-cont">
<span lang="en">Top of page</span> / <span lang="fr">Haut de la page</span>
<span class="glyphicon glyphicon-chevron-up"></span>
</a>
</div>
<div class="col-xs-6 col-md-12 text-right">
<img
src="https://www.canada.ca/etc/designs/canada/wet-boew/assets/wmms-blk.svg"
alt="Symbol of the Government of Canada / Symbole du gouvernement du Canada"
crossorigin="anonymous"
/>
</div>
</div>
</div>
</div>
</footer>
</body>
</html>
---
apiVersion: v1
kind: Pod
metadata:
name: nginx-maintenance
labels:
app.podman.io/name: nginx-maintenance
spec:
containers:
- name: nginx
image: docker.io/library/nginx:1.27.3-bookworm
ports:
- containerPort: 80
hostPort: 8080
volumeMounts:
- name: nginx-maintenance
mountPath: /etc/nginx/conf.d/default.conf
subPath: config.conf
- name: processed-html
mountPath: /usr/share/nginx/html/503.html
subPath: 503.html
initContainers:
- name: preprocess-html
image: docker.io/library/alpine:3.20.3
command: ["/bin/sh", "-c"]
args:
- |
cp /tmp/original/503.html /tmp/processed/503.html
sed --in-place "s|{{startTimeEn}}|$(cat /tmp/original/startTimeEn)|g" /tmp/processed/503.html
sed --in-place "s|{{startTimeFr}}|$(cat /tmp/original/startTimeFr)|g" /tmp/processed/503.html
sed --in-place "s|{{endTimeEn}}|$(cat /tmp/original/endTimeEn)|g" /tmp/processed/503.html
sed --in-place "s|{{endTimeFr}}|$(cat /tmp/original/endTimeFr)|g" /tmp/processed/503.html
volumeMounts:
- name: nginx-maintenance
mountPath: /tmp/original
- name: processed-html
mountPath: /tmp/processed
volumes:
- name: nginx-maintenance
configMap:
name: nginx-maintenance
- name: processed-html
emptyDir: {}