Install Portefaix

Instructions for deploying Portefaix infrastructure on GCP

Organization

Create a Google Cloud Organization using Google Workspace or Cloud Identity

See: https://cloud.google.com/resource-manager/docs/creating-managing-organization?hl=fr

Bootstrap

Authenticate on the Google Cloud Platform:

❯ gcloud auth application-default login
xxxxxxxxxx

❯ gcloud organizations list
DISPLAY_NAME             ID  DIRECTORY_CUSTOMER_ID
xxxxxxx  xxxxxx              xxxxxxxx

Bootstrap the organization:

❯ make -f hack/build/gcp.mk gcp-organization-bootstrap GCP_ORG_ID=xxxxxxxxxxx GCP_USER=xxxxxxxxxxxxxxxxx

Then go to https://console.cloud.google.com/cloud-setup/organization to creates groups and create the billing account.

Then create the bootstrap project:

❯ make -f hack/build/gcp.mk gcp-organization-project GCP_ORG_NAME=xxxx GCP_ORG_ID=xxxxxxxxxxx

Associate this project to the Billing Account (on GCP console or using gcloud):

gcloud alpha billing accounts projects link my-project --billing-account=xxxxxxx

Then create the bucket for boostraping the organization:

❯ make -f hack/build/gcp.mk gcp-bucket GCP_ORG_NAME=xxxxxxx

Enable APIs:

❯ make -f hack/build/gcp.mk gcp-enable-apis ENV=dev

Create a bucket for the Terraform tfstates:

❯ make -f hack/build/gcp.mk gcp-bucket ENV=dev

Create a service account for Terraform:

❯ make -f hack/build/gcp.mk gcp-terraform-sa ENV=dev

And a key:

❯ make -f hack/build/gcp.mk gcp-terraform-key ENV=dev

Configure Portefaix environment file ${HOME}/.config/portefaix/portefaix.sh:

And load environment :

❯ . ./portefaix.sh gcp

Terraform Cloud / Github Actions

Terraform Cloud is used as the remote backend. Github Actions perform tasks to deploy the GCP infrastructure.

Configure Terraform Cloud workspaces:

❯ make terraform-apply SERVICE=terraform/gcp/terraform-cloud ENV=dev
Portefaix GCP deployment

Gitops for Kubernetes

Next: Gitops

Last modified 19.10.2022: Update: gitops link (7524a42)