GlodoUK / helm-charts

7 stars 2 forks source link

odoo: consider implementing a maintenance page within the chart #30

Open theangryangel opened 2 years ago

theangryangel commented 2 years ago

It would be useful to optionally implement a maintenance page within the chart, so that if all workers are unavailable rather than getting the default ingress error page, that a maintenance page is displayed instead.

A good example would be something like this.

We should probably consider our own maintenance docker image.

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: maintenance-ingressroute
spec:
  entryPoints:
  - websecure
  routes:
  - kind: Rule
    priority: 5
    match: HOSTMATCHESHERE
    middlewares: []
    services:
    - name: maintenance
      port: 8080
  tls:
    secretName: CERTHERE

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: maintenance
  labels:
    app: maintenance
spec:
  selector:
    matchLabels:
      maintenance: maintenance
  replicas: 1
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        maintenance: maintenance
    spec:
      containers:
        - name: nginx
          image: wickerlabs/maintenance
          env:
            - name: TEAM_NAME
              value: "COMPANYNAME"
            - name: TITLE
              value: "We're upgrading"
            - name: MAIL_ADDRESS
              value: "EMAILHERE"
            - name: LINK_COLOR
              value: "#DB375C"
            - name: THEME
              value: "Light"
            - name: PORT
              value: "8080"
            - name: RESPONSE_CODE
              value: "503 Service Unavailable"
            - name: CONTACT_LINK
              value: "contact us via email"
          ports:
            - name: http
              protocol: TCP
              containerPort: 8080

---

apiVersion: v1
kind: Service
metadata:
  name: maintenance
spec:
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    maintenance: maintenance