homelab/archive/2022.07.bxl-k3s-pi/utils/ingress-nginx/custom-pages.yaml

72 lines
1.7 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: pages
namespace: ingress-nginx
data:
maintenance.html: |
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style><article>
<h1>We&rsquo;ll be back soon!</h1>
<div>
<p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. If you need to you can always <a href="mailto:<email>">contact us</a>, otherwise we&rsquo;ll be back online shortly!</p>
<p>&mdash; The Team</p>
</div>
</article>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: custom-page
namespace: ingress-nginx
labels:
app: custom-page
spec:
replicas: 1
selector:
matchLabels:
app: custom-page
template:
metadata:
labels:
app: custom-page
spec:
containers:
- name: custom-page
image: nginx:stable-alpine
ports:
- containerPort: 80
volumeMounts:
- name: pages
mountPath: /usr/share/nginx/html/index.html
subPath: maintenance.html
readOnly: true
volumes:
- name: pages
configMap:
name: pages
---
apiVersion: v1
kind: Service
metadata:
name: custom-page
namespace: ingress-nginx
spec:
selector:
app: custom-page
ports:
- protocol: TCP
port: 80
targetPort: 80