Skip to content

Commit

Permalink
persistent disk work and release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmitchell committed Apr 29, 2021
1 parent 57d397b commit 05c1dce
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
3 changes: 2 additions & 1 deletion MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ The following values can be specified in your environment file, under `params:`
| `cf_deployment_env` | specify the name of the cf deployment environment | the cf-app-autoscaler environment name |
| `cf_deployment_type` | override the type of deployment used for the CF deployment | `cf` |
| `cf_core_network` | name of the core CF network. | provided by Exodus data from your CF Genesis kit deployment |
| `cf_system_domain` | thhe system domain for your CF deployment. | provided by Exodus data from your CF Genesis kit deployment |
| `cf_system_domain` | the system domain for your CF deployment. | provided by Exodus data from your CF Genesis kit deployment |
| `skip_ssl_validation` | set to false to force ssl validation | true |
| `db_disk_type` | the name of the persistent disk type to use for the local postgres VM. | `10GB`

## Features

Expand Down
38 changes: 34 additions & 4 deletions ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Official Release v1.0.0
# Attention Required

Replaces `app-autoscaler` feature in the v1.x cf genesis kits (and removed
from v2.x kits). See MANUAL.md for usage details, including how to upgrade
from embedded version in the v1.x cf kit.
* The 1.0.0 version of the kit was released without allocating the local
postgres database node a persistent disk. If you are not using an external
database, this can easily lead to loss of autoscaler service data. This is
fixed in this version of the kit - please follow the following instructions
to avoid data loss. Do not panic. Everything is going to be okay.

## Taking a Backup of the Existing Database

Make sure you take this backup before upgrading the kit!

* `bosh ssh` onto the `postgres_autoscaler` of the deployment.
* become root with `sudo -i`
* Run the following to take a backup `/var/vcap/packages/postgres-9.6.6/bin/pg_dumpall -U vcap >/tmp/pg_dump.sql`
* Fetch the backup from the VM by exiting the VM and running `bosh -e <envname> -d <depname> scp postgres_autoscaler:/tmp/pg_dump.sql ~/autoscaler_pg_dump.sql`

## Upgrade the Kit

* Bump the kit number in your environment file to this version and deploy it with `genesis deploy <envname>`

## Restore the Database

Now you have a fresh, empty database. Let's put the data back.

* Upload the backup you took to the VM with `bosh -e <envname> -d <depname> scp ~/autoscaler_pg_dump.sql postgres_autoscaler:/tmp/`
* SSH onto the `postgres_autoscaler` VM with `bosh ssh`
* Become root with `sudo -i`
* Perform the restore with `/var/vcap/packages/postgres-9.6.6/bin/psql -U vcap postgres </tmp/autoscaler_pg_dump.sql`

After this, service should be restored and the database should have a persistent disk.

# Additional Features

* The kit will now generate 10 year CA certs when creating a new deployment.
1 change: 1 addition & 0 deletions hooks/blueprint
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ manifests=( \
"upstream/templates/app-autoscaler-deployment.yml" \
"overlay/base.yml" \
"overlay/ten-year-ca-expiry.yml" \
"overlay/db-persistent-disk.yml" \
"overlay/upstream_version.yml" \
"overlay/change_deployment_and_network.yml" \
"overlay/releases/app-autoscaler.yml" \
Expand Down
3 changes: 3 additions & 0 deletions overlay/db-persistent-disk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance_groups:
- name: postgres_autoscaler
persistent_disk_type: (( grab params.db_disk_type || "10GB" ))
1 change: 0 additions & 1 deletion upstream/templates/app-autoscaler-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ instance_groups:
vm_type: small
networks:
- name: default
persistent_disk_type: 10GB
jobs:
- name: postgres
release: postgres
Expand Down

0 comments on commit 05c1dce

Please sign in to comment.