You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+120-47
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# Humanitec Google Cloud Reference Architecture Implementation
2
+
>
2
3
> TL;DR
3
4
>
4
5
>Skip the theory? Go [here](#how-to-spin-up-your-humanitec-google-cloud-reference-architecture-implementation) to spin up your Humanitec Google Cloud Reference Architecture Implementation.
@@ -19,33 +20,34 @@ When McKinsey originally [published the reference architecture](https://youtu.be
This plane is the primary configuration layer and interaction point for the platform users. It harbors the following components:
25
26
26
27
* A **Version Control System**. GitHub is a prominent example, but this can be any system that contains two types of repositories:
27
-
* Application Source Code
28
-
* Platform Source Code, e.g. using Terraform
28
+
* Application Source Code
29
+
* Platform Source Code, e.g. using Terraform
29
30
***Workload specifications**. The reference architecture uses [Score](https://developer.humanitec.com/score/overview/).
30
31
* A **portal** for developers to interact with. It can be the Humanitec Portal, but you might also use [Backstage](https://backstage.io/) or any other portal on the market.
31
32
32
-
### Integration and Delivery Plane
33
+
### Integration and Delivery Plane
33
34
34
35
This plane is about building and storing the image, creating app and infra configs from the abstractions provided by the developers, and deploying the final state. It’s where the domains of developers and platform engineers meet.
35
36
36
37
This plane usually contains four different tools:
38
+
37
39
* A **CI pipeline**. It can be Github Actions or any CI tooling on the market.
38
40
* The **image registry** holding your container images. Again, this can be any registry on the market.
39
41
* An **orchestrator** which in our example, is the Humanitec Platform Orchestrator.
40
42
* The **CD system**, which can be the Platform Orchestrator’s deployment pipeline capabilities — an external system triggered by the Orchestrator using a webhook, or a setup in tandem with GitOps operators like ArgoCD.
41
43
42
-
### Monitoring and Logging Plane
44
+
### Monitoring and Logging Plane
43
45
44
46
The integration of monitoring and logging systems varies greatly depending on the system. This plane however is not a focus of the reference architecture.
45
47
46
-
### Security Plane
48
+
### Security Plane
47
49
48
-
The security plane of the reference architecture is focused on the secrets management system. The secrets manager stores configuration information such as database passwords, API keys, or TLS certificates needed by an Application at runtime. It allows the Platform Orchestrator to reference the secrets and inject them into the Workloads dynamically. You can learn more about secrets management and integration with other secrets management [here](https://developer.humanitec.com/platform-orchestrator/security/overview).
50
+
The security plane of the reference architecture is focused on the secrets management system. The secrets manager stores configuration information such as database passwords, API keys, or TLS certificates needed by an Application at runtime. It allows the Platform Orchestrator to reference the secrets and inject them into the Workloads dynamically. You can learn more about secrets management and integration with other secrets management [here](https://developer.humanitec.com/platform-orchestrator/security/overview).
49
51
50
52
The reference architecture sample implementations use the secrets store attached to the Humanitec SaaS system.
51
53
@@ -54,22 +56,19 @@ The reference architecture sample implementations use the secrets store attached
54
56
This plane is where the actual infrastructure exists including clusters, databases, storage, or DNS services. The configuration of the Resources is managed by the Platform Orchestrator which dynamically creates app and infrastructure configurations with every deployment and creates, updates, or deletes dependent Resources as required.
55
57
56
58
## How to spin up your Humanitec Google Cloud Reference Architecture Implementation
57
-
This repo contains an implementation of part of the Humanitec Reference Architecture for an Internal Developer Platform.
58
-
59
-
To install an implementation containing add-ons, follow the separate README. We currently feature these add-ons:
60
59
61
-
*[Base layer plus Backstage](examples/with-backstage/)
60
+
This repo contains an implementation of part of the Humanitec Reference Architecture for an Internal Developer Platform, including Backstage as optional Portal solution.
62
61
63
62
This repo covers the base layer of the implementation for Google Cloud (GCP).
64
63
65
64
By default, the following will be provisioned:
66
65
67
-
- VPC
68
-
- GKE Autopilot Cluster
69
-
- Google Service Account to access the cluster
70
-
- Ingress NGINX in the cluster
71
-
- Resource Definitions in Humanitec for:
72
-
- Kubernetes Cluster
66
+
* VPC
67
+
* GKE Autopilot Cluster
68
+
* Google Service Account to access the cluster
69
+
* Ingress NGINX in the cluster
70
+
* Resource Definitions in Humanitec for:
71
+
* Kubernetes Cluster
73
72
74
73
### Prerequisites
75
74
@@ -99,13 +98,13 @@ This reference architecture implementation uses Terraform. You will need to do t
99
98
100
99
For example:
101
100
102
-
```
101
+
```shell
103
102
export HUMANITEC_TOKEN="my-humanitec-api-token"
104
103
```
105
104
106
105
5. Run terraform:
107
106
108
-
```
107
+
```shell
109
108
terraform init
110
109
terraform plan
111
110
terraform apply
@@ -130,46 +129,90 @@ There are many other optional inputs that can be set. The full list is described
130
129
Check for the existence of key elements of the reference architecture. This is a subset of all elements only. For a complete list of what was installed, review the Terraform code.
131
130
132
131
1. Set the `HUMANITEC_ORG` environment variable to the ID of your Humanitec Organization (must be all lowercase):
133
-
```bash
134
-
export HUMANITEC_ORG="my-humanitec-org"
135
-
```
132
+
133
+
```bash
134
+
export HUMANITEC_ORG="my-humanitec-org"
135
+
```
136
136
137
137
2. Verify the existence of the Resource Definition for the GKE cluster in your Humanitec Organization:
Backstage requires a GitHub connection, which in turn needs:
170
+
171
+
* 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.
172
+
* Create a classic github personal access token with `repo`, `workflow`, `delete_repo` and `admin:org` scope [here](https://github.com/settings/tokens).
173
+
* Set the `GITHUB_TOKEN` environment variable to your token.
174
+
175
+
```shell
176
+
export GITHUB_TOKEN="my-github-token"
177
+
```
178
+
179
+
* Set the `GITHUB_ORG_ID` environment variable to your GitHub organization ID.
180
+
181
+
```shell
182
+
export GITHUB_ORG_ID="my-github-org-id"
183
+
```
184
+
185
+
* Install the GitHub App for Backstage into your GitHub organization
186
+
* Run `docker run --rm -it -e GITHUB_ORG_ID -v $(pwd):/pwd -p 127.0.0.1:3000:3000 ghcr.io/humanitec-architecture/create-gh-app` ([image source](https://github.com/humanitec-architecture/create-gh-app/)) and follow the instructions:
187
+
* “All repositories” ~> Install
188
+
* “Okay, […] was installed on the […] account.” ~> You can close the window and server.
189
+
190
+
#### Portal Usage
191
+
192
+
* Enable `with_backstage` inside your `terraform.tfvars` and configure the additional variables that a required for Backstage.
193
+
* Perform another `terraform apply`
194
+
195
+
#### Verify portal setup
196
+
197
+
*[Fetch the DNS entry](https://developer.humanitec.com/score/getting-started/get-dns/) of the Humanitec Application `backstage`, Environment `development`.
198
+
* Open the host in your browser.
199
+
* Click the "Create" button and scaffold your first application.
159
200
160
201
### Cleaning up
161
202
162
203
Once you are finished with the reference architecture, you can remove all provisioned infrastructure and the resource definitions created in Humanitec with the following:
163
204
164
-
1. Ensure you are (still) logged in with `gcloud`.
205
+
1. Delete all Humanitec Applications scaffolded using the Portal, if you used one, but not the `backstage` app itself.
206
+
207
+
2. Ensure you are (still) logged in with `gcloud`.
165
208
166
-
2. Ensure you still have the `HUMANITEC_TOKEN` environment variable set to an appropriate Humanitec API token with the `Administrator` role on the Humanitec Organization.
209
+
3. Ensure you still have the `HUMANITEC_TOKEN` environment variable set to an appropriate Humanitec API token with the `Administrator` role on the Humanitec Organization.
167
210
168
211
You can verify this in the UI if you log in with an Administrator user and go to Resource Management, and check the "Usage" of each resource definition with the prefix set in `humanitec_prefix` - by default this is `htc-ref-arch-`.
169
212
170
-
3. Run terraform:
213
+
4. Run terraform:
171
214
172
-
```
215
+
```shell
173
216
terraform destroy
174
217
```
175
218
@@ -180,31 +223,63 @@ Once you are finished with the reference architecture, you can remove all provis
*[Tutorial: Provision a Redis cluster on AWS using Terraform](https://developer.humanitec.com/training/master-your-internal-developer-platform/provision-redis-aws/)
229
304
*[Tutorial: Update Resource Definitions for related Applications](https://developer.humanitec.com/training/master-your-internal-developer-platform/update-resource-definitions-for-related-applications/)
0 commit comments