Skip to content

Commit

Permalink
Clean up Faltrn
Browse files Browse the repository at this point in the history
  • Loading branch information
johnake committed Jan 5, 2024
1 parent ba03f50 commit bc057b6
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 162 deletions.
80 changes: 0 additions & 80 deletions .github/workflows/delete-review-app.yml

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ terraform-init: bin/terrafile
[[ "${SP_AUTH}" != "true" ]] && az account set -s $(AZURE_SUBSCRIPTION) || true
./bin/terrafile -p terraform/aks/vendor/modules -f terraform/aks/workspace_variables/$(CONFIG)_Terrafile
terraform -chdir=terraform/aks init -backend-config workspace_variables/$(CONFIG).backend.tfvars $(backend_config) -upgrade -reconfigure
$(if $(DOCKER_IMAGE), $(eval export TF_VAR_paas_app_docker_image=$(DOCKER_IMAGE)), $(error Missing environment variable "DOCKER_IMAGE"))
$(if $(DOCKER_IMAGE), $(eval export TF_VAR_app_docker_image=$(DOCKER_IMAGE)), $(error Missing environment variable "DOCKER_IMAGE"))

terraform-plan: terraform-init
terraform -chdir=terraform/aks plan -var-file workspace_variables/$(CONFIG).tfvars.json
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ A service that allows teachers to find their Teacher Reference Number (TRN).

### Links and application names

| Name | URL | Deployment | PaaS space | PaaS application |
| ---------- | ------------------------------------------------- | ---------- | ---------------- | ---------------------------- |
| Production | https://find-a-lost-trn.education.gov.uk/ | Automatic | `tra-production` | `find-a-lost-trn-production` |
| Preprod | https://preprod-find-a-lost-trn.education.gov.uk/ | Automatic | `tra-test` | `find-a-lost-trn-preprod` |
| Test | https://test-find-a-lost-trn.education.gov.uk/ | Automatic | `tra-test` | `find-a-lost-trn-test` |
| Dev | https://dev-find-a-lost-trn.education.gov.uk/ | Automatic | `tra-dev` | `find-a-lost-trn-dev` |
| Name | URL (Frontdoor) | Deployment | AKS namespace | Ingress URL |
| ------------- | ------------------------------------------------| ---------- | ---------------- | ----------------------------------------------------------------|
| Production | https://find-a-lost-trn.education.gov.uk | Automatic | `tra-production` | https://find-a-lost-trn-production.teacherservices.cloud |
| Preproduction | https://preprod.find-a-lost-trn.education.gov.uk| Automatic | `tra-test` | https://find-a-lost-trn-preproduction.test.teacherservices.cloud|
| Test | https://test.find-a-lost-trn.education.gov.uk | Automatic | `tra-test` | http://find-a-lost-trn-test.test.teacherservices.cloud |
| Dev | https://dev.find-a-lost-trn.education.gov.uk | Automatic | `tra-development`| https://find-a-lost-trn-development.test.teacherservices.cloud |

All environments have continuous deployment, the state of which can be inspected in Github Actions.

Expand Down Expand Up @@ -59,7 +59,7 @@ You can use this user to test that matching works against the preprod
## How the application works

Find a lost TRN is a monolithic Rails app built with the GOVUK Design System and hosted on
GOVUK PaaS.
GOVUK AKS.

We keep track of architecture decisions in [Architecture Decision Records
(ADRs)](/adr/).
Expand Down
22 changes: 0 additions & 22 deletions adr/00002-use-gov-paas.md

This file was deleted.

1 change: 0 additions & 1 deletion adr/00007-scheduled-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ We have considered:

Considering the effort to deploy and maintain the infrastructure to run the jobs, we think it's better to use sidekiq/sidekiq_cron.

The clockwork gem requires some workarounds to be able to run on PaaS.

#### Pros

Expand Down
2 changes: 1 addition & 1 deletion app/views/static/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ We also use Google’s G Suite to process some personal data. Google processes y

### Hosting services

We host our services on GOV.UK PaaS, which encrypts your data to prevent it being accessed by unauthorised people.
We host our services on AKS which encrypts your data to prevent it being accessed by unauthorised people.

### Auditors

Expand Down
53 changes: 9 additions & 44 deletions docs/ops-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,20 @@

## SSHing to a live docker container

To SSH into a container, install the `cloudfoundry-cli`. Example using `asdf`:

```bash
$ asdf plugin add cf
$ asdf cf install latest
$ asdf global cf latest
$ cf --version
cf version 8.3.0+e6f8a85.2022-03-11
```

You'll need a PaaS account that has access to the
`tra-dev/tra-test/tra-production` space. Sign into your account using SSO:

```bash
$ cf login -a api.london.cloud.service.gov.uk --sso
API endpoint: api.london.cloud.service.gov.uk

Temporary Authentication Code ( Get one at https://login.london.cloud.service.gov.uk/passcode ):
Authenticating...
OK
To SSH into a container, install `kubectl`

- Configure the credentials using the `get-cluster-credentials`, within the Teacher-services-cloud repo, run make command. Example:

Targeted org dfe.

Select a space:
1. sandbox
2. tra-dev
3. tra-production
4. tra-test

Space (enter to skip): 2
Targeted space tra-dev.

API endpoint: https://api.london.cloud.service.gov.uk
API version: 3.112.0
user: 1XXXXXXXXXXXXXXXXXXXX
org: dfe
space: tra-dev
```
make test get-cluster-credentials
make development get-cluster-credentials ENVIRONMENT=cluster1
```

To SSH into the running docker container and go to the app directory:
find-a-lost-trn-test-57556754f9-q5mfd
To SSH into a container, in the test cluster. Example ssh into a container named `find-a-lost-trn-test`, within the pod `find-a-lost-trn-test-57556754f9-q5mfd`:

```bash
cf ssh find-a-lost-trn-dev
cd /app
```
run `kubectl -n tra-test exec -it find-a-lost-trn-test-57556754f9-q5mfd -c find-a-lost-trn-test -- /bin/sh`

**Note**: SSH access is monitored and logged as an event in the Events tab on
the PaaS website.

## Running a Rails console

Expand Down Expand Up @@ -98,7 +63,7 @@ xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy 'digital.education.gov.uk'
"tenantId": "xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy"
}
],
"name": "s165-teachingqualificationsservice-development",
"name": "s189-teacher-services-cloud-test",
"state": "Enabled",
"tenantId": "xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy",
"user": {
Expand Down
2 changes: 1 addition & 1 deletion docs/technical-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Find a lost TRN service is a public facing web application that allows its users to retrieve their TRN by supplying personal information. It works by querying the DQT API with the supplied details, and returning them to the user. As a fallback, if the DQT API is unavailable, the Find a lost TRN service will create a ticket in a Zendesk system that the supporting team will then pick up, and handle manually.

The web primary web application in hosted in GOV.UK PaaS, uses a Postgres database for persistence and a Redis instance for retry logic for deferred executions of tasks.
The web primary web application in hosted in AKS, uses a Postgres database for persistence and a Redis instance for retry logic for deferred executions of tasks.

## Architecture Diagram

Expand Down
4 changes: 2 additions & 2 deletions terraform/aks/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module "web_application" {
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name

docker_image = var.paas_app_docker_image
docker_image = var.app_docker_image
max_memory = var.memory_max
replicas = var.replicas
web_external_hostnames = var.gov_uk_host_names
Expand Down Expand Up @@ -52,7 +52,7 @@ module "worker_application" {
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
docker_image = var.paas_app_docker_image
docker_image = var.app_docker_image
command = ["bundle", "exec", "sidekiq", "-C", "./config/sidekiq.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
max_memory = var.worker_memory_max
Expand Down
5 changes: 2 additions & 3 deletions terraform/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ variable "gov_uk_host_names" {
type = list(any)
}

# PaaS variables
variable "paas_app_docker_image" {
description = "PaaS image name and version "
variable "app_docker_image" {
description = "image name and version "
}

variable "deploy_redis" {
Expand Down

0 comments on commit bc057b6

Please sign in to comment.