Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed May 2, 2024
1 parent a5959f4 commit 3f8176f
Show file tree
Hide file tree
Showing 53 changed files with 564 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ bin/konduit.sh
ministerial-report-applications*.txt

.cftoken

maintenance_page/manifests/maintenance/deployment_maintenance.yml
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,17 @@ bin/terrafile: ## Install terrafile to manage terraform modules

maintenance-image-push:
$(if ${GITHUB_TOKEN},, $(error Provide a valid Github token with write:packages permissions as GITHUB_TOKEN variable))
$(if ${MAINTENANCE_IMAGE_TAG},, $(eval MAINTENANCE_IMAGE_TAG=main))
docker build -t ghcr.io/dfe-digital/apply-teacher-training-maintenance:${MAINTENANCE_IMAGE_TAG} service_unavailable_page
$(if ${MAINTENANCE_IMAGE_TAG},, $(eval export MAINTENANCE_IMAGE_TAG=$(shell date +%s)))
docker build -t ghcr.io/dfe-digital/apply-teacher-training-maintenance:${MAINTENANCE_IMAGE_TAG} maintenance_page
echo ${GITHUB_TOKEN} | docker login ghcr.io -u USERNAME --password-stdin
docker push ghcr.io/dfe-digital/apply-teacher-training-maintenance:${MAINTENANCE_IMAGE_TAG}

maintenance-fail-over:
maintenance-fail-over: get-cluster-credentials
$(eval export CONFIG)
./service_unavailable_page/scripts/failover.sh
./maintenance_page/scripts/failover.sh

enable-maintenance: maintenance-image-push maintenance-fail-over
disable-maintenance:

disable-maintenance: get-cluster-credentials
$(eval export CONFIG)
./service_unavailable_page/scripts/failback.sh
./maintenance_page/scripts/failback.sh
4 changes: 4 additions & 0 deletions maintenance_page/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:1.25.4

COPY nginx.conf /etc/nginx/nginx.conf
COPY ./html/ /usr/share/nginx/html/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added maintenance_page/html/assets/images/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions maintenance_page/html/assets/images/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions maintenance_page/html/assets/images/govuk-icon-mask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions maintenance_page/html/assets/images/govuk-mask-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions maintenance_page/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en" class="govuk-template">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>This service is currently unavailable - Apply for teacher training - GOV.UK</title>
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="#0b0c0c">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="assets/images/favicon.ico" type="image/x-icon">
<link rel="mask-icon" href="assets/images/govuk-mask-icon.svg" color="#0b0c0c">
<link rel="apple-touch-icon" sizes="180x180" href="assets/images/govuk-apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="167x167" href="assets/images/govuk-apple-touch-icon-167x167.png">
<link rel="apple-touch-icon" sizes="152x152" href="assets/images/govuk-apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" href="assets/images/govuk-apple-touch-icon.png">
<meta property="og:image" content="assets/govuk-opengraph-image.png">
<link rel="stylesheet" media="all" href="stylesheets/govuk-frontend-3.13.1.min.css">
</head>
<body class="govuk-template__body">
<header class="govuk-header govuk-!-display-none-print app-header--production app-header--full-border app-header--wide-logo" role="banner" data-module="govuk-header">
<div class="govuk-header__container govuk-width-container">
<div class="govuk-header__logo">
<a class="govuk-header__link govuk-header__link--homepage" href="https://www.gov.uk/">
<span class="govuk-header__logotype">
<svg
focusable="false"
role="img"
class="govuk-header__logotype"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 148 30"
height="30"
width="148"
aria-label="GOV.UK"
>
<title>GOV.UK</title>
<path d="M22.6 10.4c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m-5.9 6.7c-.9.4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m10.8-3.7c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s0 2-1 2.4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.3-3.1-2.3-.9-1-1.5-2.1-2-3.4-.4-1.3-.7-2.7-.7-4.2s.2-2.9.7-4.2c.4-1.3 1.1-2.4 2-3.4.9-1 1.9-1.7 3.1-2.3 1.2-.5 2.6-.8 4.2-.8zm0 17.6c.9 0 1.7-.2 2.4-.5s1.3-.8 1.7-1.4c.5-.6.8-1.3 1.1-2.2.2-.8.4-1.7.4-2.7v-.1c0-1-.1-1.9-.4-2.7-.2-.8-.6-1.6-1.1-2.2-.5-.6-1.1-1.1-1.7-1.4-.7-.3-1.5-.5-2.4-.5s-1.7.2-2.4.5-1.3.8-1.7 1.4c-.5.6-.8 1.3-1.1 2.2-.2.8-.4 1.7-.4 2.7v.1c0 1 .1 1.9.4 2.7.2.8.6 1.6 1.1 2.2.5.6 1.1 1.1 1.7 1.4.6.3 1.4.5 2.4.5zM88.9 28 83 7h4.7l4 15.7h.1l4-15.7h4.7l-5.9 21h-5.7zm28.8-3.6c.6 0 1.2-.1 1.7-.3.5-.2 1-.4 1.4-.8.4-.4.7-.8.9-1.4.2-.6.3-1.2.3-2v-13h4.1v13.6c0 1.2-.2 2.2-.6 3.1s-1 1.7-1.8 2.4c-.7.7-1.6 1.2-2.7 1.5-1 .4-2.2.5-3.4.5-1.2 0-2.4-.2-3.4-.5-1-.4-1.9-.9-2.7-1.5-.8-.7-1.3-1.5-1.8-2.4-.4-.9-.6-2-.6-3.1V6.9h4.2v13c0 .8.1 1.4.3 2 .2.6.5 1 .9 1.4.4.4.8.6 1.4.8.6.2 1.1.3 1.8.3zm13-17.4h4.2v9.1l7.4-9.1h5.2l-7.2 8.4L148 28h-4.9l-5.5-9.4-2.7 3V28h-4.2V7zm-27.6 16.1c-1.5 0-2.7 1.2-2.7 2.7s1.2 2.7 2.7 2.7 2.7-1.2 2.7-2.7-1.2-2.7-2.7-2.7z"></path>
</svg>
<span class="govuk-header__logotype-text">GOV.UK</span>
</span>
</a>
</div>
<div class="govuk-header__product-name">
Apply for teacher training
</div>
</div>
</header>
<div class="govuk-width-container">
<main class="govuk-main-wrapper" id="main-content" role="main">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">This service is currently unavailable</h1>
<p class="govuk-body">We're sorry the service is not available right now.</p>
<p class="govuk-body">Try again later.</p>
<p class="govuk-body">If you reached this page after submitting information then it has not been saved. You will need to enter it again when the service is available.</p>
<p class="govuk-body">If you have any questions, email us at<br>
<a class="govuk-link" href="mailto:[email protected]">[email protected]</a>.</p>
</div>
</div>
</main>
</div>
<footer class="govuk-footer govuk-!-display-none-print" role="contentinfo">
<div class="govuk-width-container">
<div class="govuk-footer__meta">
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
<h2 class="govuk-heading-m">Get help</h2>
<div class="govuk-grid-row govuk-!-margin-bottom-5">
<div class=" govuk-grid-column-one-half">
<h2 class="govuk-heading-s govuk-!-margin-bottom-1">Email</h2>
<ul class="govuk-footer__meta-custom govuk-list govuk-!-font-size-16">
<li><a class="govuk-footer__link" href=" mailto:[email protected]">[email protected]</a> </li>
<li>You will get a response within 5 working days, or one working day for urgent requests.</li>
</ul>
</div>
</div>
</div>
<div class="govuk-footer__meta-item">
<a class="govuk-footer__link govuk-footer__copyright-logo govuk-!-margin-bottom-1" href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">© Crown copyright</a>
</div>
</div>
</div>
</footer>
</body>
</html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: apply-maintenance
labels:
app: apply-maintenance
spec:
replicas: 2
selector:
matchLabels:
app: apply-maintenance
template:
metadata:
labels:
app: apply-maintenance
spec:
nodeSelector:
teacherservices.cloud/node_pool: applications
kubernetes.io/os: linux
containers:
- name: apply-maintenance
image: ghcr.io/dfe-digital/apply-maintenance:#MAINTENANCE_IMAGE_TAG#
ports:
- containerPort: 80
resources:
requests:
memory: 64M
cpu: 0.1
limits:
memory: 64M
cpu: 1
12 changes: 12 additions & 0 deletions maintenance_page/manifests/maintenance/service_maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Service
metadata:
name: apply-maintenance
spec:
selector:
app: apply-maintenance
ports:
- protocol: TCP
port: 80
targetPort: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: www.apply-for-teacher-training.service.gov.uk
spec:
ingressClassName: nginx
rules:
- host: www.apply-for-teacher-training.service.gov.uk
http:
paths:
- pathType: ImplementationSpecific
backend:
service:
name: apply-production
port:
number: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: www.apply-for-teacher-training.service.gov.uk
spec:
ingressClassName: nginx
rules:
- host: www.apply-for-teacher-training.service.gov.uk
http:
paths:
- pathType: ImplementationSpecific
backend:
service:
name: apply-maintenance
port:
number: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: apply-production.teacherservices.cloud
spec:
ingressClassName: nginx
rules:
- host: apply-production.teacherservices.cloud
http:
paths:
- pathType: ImplementationSpecific
backend:
service:
name: apply-production
port:
number: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: apply-production.teacherservices.cloud
spec:
ingressClassName: nginx
rules:
- host: apply-production.teacherservices.cloud
http:
paths:
- pathType: ImplementationSpecific
backend:
service:
name: apply-maintenance
port:
number: 80
16 changes: 16 additions & 0 deletions maintenance_page/manifests/production_aks/ingress_maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: apply-maintenance.teacherservices.cloud
spec:
ingressClassName: nginx
rules:
- host: apply-maintenance.teacherservices.cloud
http:
paths:
- pathType: ImplementationSpecific
backend:
service:
name: apply-maintenance
port:
number: 80
Loading

0 comments on commit 3f8176f

Please sign in to comment.