Provisions the GCP reference architecture connected to Humanitec and installs Backstage.
- The same prerequisites as the base reference architecture, plus the following items.
- A GitHub organization and permission to create new repositories in it. Go to https://github.com/account/organizations/new to create a new org (the "Free" option is fine). Note: is has to be an organization, a free account is not sufficient.
- Create a classic github personal access token with
repo
,workflow
,delete_repo
andadmin:org
scope here. - Set the
GITHUB_TOKEN
environment variable to your token.export GITHUB_TOKEN="my-github-token"
- Set the
GITHUB_ORG_ID
environment variable to your GitHub organization ID.export GITHUB_ORG_ID="my-github-org-id"
- Node.js installed locally.
- Install the GitHub App for Backstage into your GitHub organization using
node create-gh-app/index.js
. Follow the instructions.- “All repositories” ~> Install
- “Okay, […] was installed on the […] account.” ~> You can close the window and server.
Follow the same steps as for the base layer, applying these modifications:
- Execute
cd ./examples/with-backstage
after cloning the repo. Execute all subsequent commands in this directory. - In particular, use the
./examples/with-backstage/terraform.tfvars.example
file as the basis for yourterraform.tfvars
file. It defines additional variables needed to setup and configure Backstage.
Check for the existence of key elements of the backstage module. This is a subset of all elements only. For a complete list of what was installed, review the Terraform code.
-
Perform the verification steps of the base installation if you have not already done so.
-
Verify the existence of the Backstage Application in your Humanitec Organization:
curl -s https://api.humanitec.io/orgs/${HUMANITEC_ORG}/apps/backstage \ --header "Authorization: Bearer ${HUMANITEC_TOKEN}"
This should output a JSON formatted representation of the Application like so:
{"id":"backstage","name":"backstage","created_at":"2023-10-02T13:44:27Z","created_by":"s-d3e94a0e-8b53-29f9-b666-27548b7e06e0","envs":[{"id":"development","name":"Development","type":"development"}]}
You can also check for the Application in the Humanitec Platform Orchestrator UI.
-
Connect to your GKE cluster via
kubectl
. See the GKE documentation or use this command:gcloud container clusters get-credentials htc-ref-arch-cluster --location <my-gcp-region>
-
Get the elements in the newly created Kubernetes namespace:
kubectl get all -n backstage-development
You should see
- a
deployment
,replicaset
, runningpod
, andservice
for Backstage - a
statefulset
, runningpod
, andservice
for PostgreSQL database used by Backstage.
Note: it may take up to ten minutes after the
terraform apply
completed until you actually see those resources. The Backstage application needs to built and deployed via a GitHub action out of the newly created repository in your GitHub organization. - a
Once you are finished with the reference architecture, you can remove all provisioned infrastructure and the resource definitions created in Humanitec with the following:
-
Delete all Humanitec applications scaffolded using Backstage, but not the
backstage
app itself. -
Follow the base reference architecture cleanup instructions.
Name | Version |
---|---|
terraform | >= 1.3.0 |
github | ~> 5.38 |
~> 5.1 | |
humanitec | ~> 1.0 |
random | ~> 3.5 |
Name | Version |
---|---|
github | ~> 5.38 |
~> 5.1 | |
humanitec | ~> 1.0 |
random | ~> 3.5 |
Name | Source | Version |
---|---|---|
backstage_mysql | git::https://github.com/humanitec-architecture/resource-packs-in-cluster.git//humanitec-resource-defs/mysql/basic | n/a |
backstage_postgres | git::https://github.com/humanitec-architecture/resource-packs-in-cluster.git//humanitec-resource-defs/postgres/basic | n/a |
base | ../../modules/base | n/a |
gh_oidc | terraform-google-modules/github-actions-runners/google//modules/gh-oidc | ~> 3.1 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
gar_repository_location | Location of the Google Artifact Registry repository, | string |
n/a | yes |
github_org_id | GitHub org id | string |
n/a | yes |
humanitec_ci_service_user_token | Humanitec CI Service User Token | string |
n/a | yes |
humanitec_org_id | Humanitec Organization ID | string |
n/a | yes |
project_id | GCP Project ID to provision resources in. | string |
n/a | yes |
region | GCP Region to provision resources in. | string |
n/a | yes |
environment | The environment to associate the reference architecture with. | string |
null |
no |
environment_type | The environment type to associate the reference architecture with. | string |
"development" |
no |
humanitec_prefix | A prefix that will be attached to all IDs created in Humanitec. | string |
"htc-ref-arch-" |
no |