Skip to content

Commit a1e171a

Browse files
committed
more updates
1 parent caed6c7 commit a1e171a

File tree

3 files changed

+52
-28
lines changed

3 files changed

+52
-28
lines changed

.github/workflows/merge-to-main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
push: true
4949
tags: ${{ steps.meta.outputs.tags }}
5050
labels: ${{ steps.meta.outputs.labels }}
51+
build-args: |
52+
BACKEND_URL=${{ vars.BACKEND_URL }}
5153
5254
build-and-push-subgraph-image:
5355
runs-on: ubuntu-latest

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ At a minimum, you will need:
2626
- A Github account.
2727
- An enterprise Apollo GraphOS account.
2828
- You can use [a free enterprise trial account](https://studio.apollographql.com/signup?type=enterprise-trial) if you don't have an enterprise contract.
29-
- Either:
30-
- An account for:
31-
- Google Cloud Platform (GCP).
32-
- Amazon Web Services (AWS).
33-
- A local Minikube setup.
29+
- An account for either:
30+
- Google Cloud Platform (GCP).
31+
- Amazon Web Services (AWS).
3432

3533
Further requirements are noted within the [setup instructions](./docs/setup.md) as each type of environment (cloud vs. local) requires additional tooling.
3634

@@ -41,10 +39,12 @@ Further requirements are noted within the [setup instructions](./docs/setup.md)
4139

4240
### [Setup](/docs/setup.md)
4341

44-
- Part A: Gather accounts and credentials
45-
- Part B: Provision resources
46-
- Part C: Deploy applications
42+
During setup, you'll be:
43+
44+
- Gathering accounts and credentials
45+
- Provisioning resources
46+
- Deploying the applications, including router, subgraphs, client, and observability tools
4747

4848
### [Cleanup](/docs/cleanup.md)
4949

50-
- Part A: Automated cleanup
50+
Once finished, you can cleanup your environments following the above document.

docs/setup.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- [Minimum required dependencies](#minimum-required-dependencies)
1010
- [GCP](#gcp)
1111
- [AWS](#aws)
12-
- [Minikube](#minikube)
1312
- [Gather accounts](#gather-accounts)
1413
- [Gather credentials](#gather-credentials)
1514
- [ GCP](#-gcp)
@@ -18,7 +17,6 @@
1817
- [Run setup commands](#run-setup-commands)
1918
- [ GCP](#-gcp-1)
2019
- [ AWS](#-aws-1)
21-
- [Minikube](#minikube-1)
2220
- [General](#general)
2321
- [Part B: Provision resources](#part-b-provision-resources)
2422
- [Create Kubernetes clusters, basic infrastructure, and Github repositories](#create-kubernetes-clusters-basic-infrastructure-and-github-repositories)
@@ -29,9 +27,11 @@
2927
- [Deploy the router](#deploy-the-router)
3028
- [ GCP](#-gcp-2)
3129
- [ AWS](#-aws-2)
32-
- [Client](#client)
30+
- [Deploy the client](#deploy-the-client)
3331
- [ GCP](#-gcp-3)
3432
- [ AWS](#-aws-3)
33+
- [ GCP](#-gcp-4)
34+
- [ AWS](#-aws-4)
3535

3636
## Part A: Gather accounts and credentials
3737

@@ -65,10 +65,10 @@ git pull
6565
- Optional: [Helm](https://helm.sh/docs/intro/install/)
6666

6767

68-
#### Minikube
68+
<!-- #### Minikube
6969
7070
- [Minikube](https://minikube.sigs.k8s.io/docs/start/) configured according to the link
71-
- [Helm](https://helm.sh/docs/intro/install/)
71+
- [Helm](https://helm.sh/docs/intro/install/) -->
7272

7373
### Gather accounts
7474

@@ -113,19 +113,19 @@ git pull
113113

114114
### Export all necessary variables
115115

116-
First, change directories in the cloud provider you wish to use (or minikube). All terraform is within the `terraform` root level folder, with each provider having a subfolder within. For the below examples, we'll assume GCP, however the others will use the same commands.
116+
First, change directories in the cloud provider you wish to use. All Terraform is within the `terraform` root level folder, with each provider having a subfolder within. For the below examples, we'll assume GCP, however the others will use the same commands.
117117

118118
Next, make a copy of `.env.sample` called `.env` to keep track of these values. You can run `source .env` to reload all environment variables in a new terminal session.
119119

120120
```sh
121-
# in either terraform/aws, terraform/gcp, or terraform/minikube
121+
# in either terraform/aws or terraform/gcp
122122
cp .env.sample .env
123123
```
124124

125125
Edit the new `.env` file:
126126

127127
```sh
128-
export PROJECT_ID="<your google cloud project id>" # if using AWS or minikube, you will not see this line and can omit this
128+
export PROJECT_ID="<your google cloud project id>" # if using AWS, you will not see this line and can omit this
129129
export APOLLO_KEY="<your apollo personal api key>"
130130
export GITHUB_ORG="<your github account name or organization name>"
131131
export TF_VAR_github_token="<your github personal access token>"
@@ -171,11 +171,11 @@ gh auth login
171171
```
172172

173173

174-
#### Minikube
174+
<!-- #### Minikube
175175
176176
```sh
177177
gh auth login
178-
```
178+
``` -->
179179

180180
#### General
181181

@@ -204,7 +204,7 @@ You may need to clean up your Github packages before creating new repos of the s
204204

205205
**Note: If using a cloud provider, the following commands will create resources on your cloud provider account and begin to accrue a cost.** The reference infrastructure defaults to a lower-cost environment (small node count and instance size), however it will not be covered by either of GCP's or AWS's free tiers.
206206

207-
**Note: If you are using Minikube, this will not create a local cluster and instead configure the local environment to be ready to be deployed to.**
207+
<!-- **Note: If you are using Minikube, this will not create a local cluster and instead configure the local environment to be ready to be deployed to.** -->
208208

209209
```sh
210210
# for example, if using GCP
@@ -270,7 +270,7 @@ After this completes, you're ready to deploy your subgraphs!
270270
### Deploy subgraphs to dev
271271

272272
```sh
273-
gh workflow run "Merge to Main" --repo $GITHUB_ORG/apollo-supergraph-k8s-subgraph-a
273+
gh workflow run "Merge to Main" --repo $GITHUB_ORG/reference-architecture
274274
gh workflow run "Merge to Main" --repo $GITHUB_ORG/apollo-supergraph-k8s-subgraph-b
275275
# this deploys a dependency for prod, see note below
276276
gh workflow run "Deploy Open Telemetry Collector" --repo $GITHUB_ORG/apollo-supergraph-k8s-infra
@@ -336,8 +336,8 @@ Follow the below instructions for your cloud provider you are using. Please note
336336

337337
```sh
338338
kubectx apollo-supergraph-k8s-prod
339-
ROUTER_IP=$(kubectl get ingress -n router -o jsonpath="{.*.*.status.loadBalancer.ingress.*.ip}")
340-
open http://$ROUTER_IP
339+
ROUTER_HOSTNAME=$(kubectl get ingress -n router -o jsonpath="{.*.*.status.loadBalancer.ingress.*.ip}")
340+
open http://$ROUTER_HOSTNAME
341341
```
342342

343343
Upon running the above commands, you'll have the Router page open and you can make requests against your newly deployed supergraph!
@@ -352,11 +352,33 @@ open http://$ROUTER_HOSTNAME
352352

353353
Upon running the above commands, you'll have the Router page open and you can make requests against your newly deployed supergraph!
354354

355-
### Client
355+
### Deploy the client
356+
357+
The last step to getting fully configured is to deploy the client to both environments. To do so, we'll need our router ingress URL to point the client to. This can be pulled from the prior commands, so if you are using the same terminal session, feel free to skip the next set of commands.
358+
359+
#### <image src="../images/gcp.svg" height="13" style="margin:auto;" /> GCP
360+
361+
```sh
362+
kubectx apollo-supergraph-k8s-prod
363+
ROUTER_HOSTNAME=$(kubectl get ingress -n router -o jsonpath="{.*.*.status.loadBalancer.ingress.*.ip}")
364+
```
356365

357-
The last step to getting fully configured is to deploy the client to both environments.
366+
Upon running the above commands, you'll have the Router page open and you can make requests against your newly deployed supergraph!
358367

359-
To do so:
368+
#### <image src="../images/aws.svg" height="13" style="margin:auto;" /> AWS
369+
370+
```sh
371+
kubectx apollo-supergraph-k8s-prod
372+
ROUTER_HOSTNAME=$(kubectl get ingress -n router -o jsonpath="{.*.*.status.loadBalancer.ingress.*.hostname}")
373+
```
374+
375+
Once you have the router hostname, you'll need to set it as a secret in the GitHub repository created.
376+
377+
```sh
378+
gh variable set BACKEND_URL --body "$ROUTER_HOSTNAME" --repo $GITHUB_ORG/reference-architecture
379+
```
380+
381+
Lastly, we'll need to deploy the client:
360382

361383
```sh
362384
gh workflow run "Deploy Client" --repo $GITHUB_ORG/reference-architecture \
@@ -370,7 +392,7 @@ gh workflow run "Deploy Client" --repo $GITHUB_ORG/reference-architecture \
370392
-f debug=false
371393
```
372394

373-
This will create another ingress specific to the client, so much like the router, you can run the following commands depending on your provider.
395+
This will create another ingress specific to the client, so much like the router, you can run the following commands depending on your provider. As with the other ingress, this may take a few minutes to become active.
374396

375397
#### <image src="../images/gcp.svg" height="13" style="margin:auto;" /> GCP
376398

@@ -380,7 +402,7 @@ ROUTER_IP=$(kubectl get ingress -n client -o jsonpath="{.*.*.status.loadBalancer
380402
open http://$ROUTER_IP
381403
```
382404

383-
Upon running the above commands, you'll have the Router page open and you can make requests against your newly deployed supergraph!
405+
You should now have the full architecture deployed!
384406

385407
#### <image src="../images/aws.svg" height="13" style="margin:auto;" /> AWS
386408

0 commit comments

Comments
 (0)