Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
➜  iiq-wp-platform git:(dev) kc describe -n wp-platform deployment/green-deployment
Name:                   green-deployment
Namespace:              wp-platform
CreationTimestamp:      Wed, 05 Apr 2023 15:06:04 -0600
Labels:                 app=green
Annotations:            deployment.kubernetes.io/revision: 63
Selector:               app=green
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:       app=green
  Annotations:  kubectl.kubernetes.io/restartedAt: 2023-04-11T05:00:45-06:00
  Containers:
   web:
    Image:      961406424767.dkr.ecr.us-west-2.amazonaws.com/rezfusion-cloud@sha256:1274e8bc4d963536e88265781170e72a2939caae25127cd9d400ab124393f946

...

Functionality & Examples

Create

Creating a site creates the bare-minimum configuration to represent a site:

Code Block
POST /sites/create
{
    "id": "ggg",
    "hostnames": ["ggg.cloud2-stg.rezfusion.com"],
    "service": "blue",
    "name": "Project Bluelaunch | GGG",
    "canonicalHostname": "ggg.cloud2-stg.rezfusion.com"
}

This will create the AWS Dynamo DB entry for the site as well as relevant secrets for accessing the database and WP CMS.


Provision

After creating a site, it is able to be provisioned. Provisioning a site means that an actual site instance, along with relevant databases created, S3 bucket subdirectories, etc. for the site to use. This endpoint kicks off the installation of a WP site, a job to add an Ingress entry, and a job to activate the desired theme for a given site.

Code Block
POST /sites/{site-id}/provision

Assuming all goes well, a site should be visible at the hostname configured during /sites/create within 5-10 minutes.

Reverting Bad Deployments/Rollbacks

...

This will delete the relevant AWS Secrets entries, database related to the site, S3 site objects (aka site files) and removes the ingress entry for the site. This removes the site and all related data.

Create

Creating a site creates the bare-minimum configuration to represent a site:

Code Block
POST /sites/create
{
    "id": "ggg",
    "hostnames": ["ggg.cloud2-stg.rezfusion.com"],
    "service": "blue",
    "name": "Project Bluelaunch | GGG",
    "canonicalHostname": "ggg.cloud2-stg.rezfusion.com"
}

This will create the AWS Dynamo DB entry for the site as well as relevant secrets for accessing the database and WP CMS.

...

After creating a site, it is able to be provisioned. Provisioning a site means that an actual site instance, along with relevant databases created, S3 bucket subdirectories, etc. for the site to use. This endpoint kicks off the installation of a WP site, a job to add an Ingress entry, and a job to activate the desired theme for a given site.

Code Block
POST /sites/{site-id}/provision

Assuming all goes well, a site should be visible at the hostname configured during /sites/create within 5-10 minutes.

Misc. Fixes

...

Before:

...

Sent request:

...

After:

DB is deleted

...

Ingress entry removed

...

Directory deleted in S3

...

Site is gone

...