To begin login to your Google Account. Easy way of doing this running the following command:
Ensure yoi have already created a Project and retrieve the ProjectId
e.g sportsloop is my Project Id for this example.
gcloud auth login
To begin we need to create the remote state files for terrafrom.
make setup-gcp-for-terraform PROJECT=sportsloop
This will create the Terraform State file in A Bucket in GCP
We need to create a service account which will grant access to the GCP APIs. We will then download the keyfile in order to give us access to those API's so we can run terraform.
Execute the following command:
make generate-keyfile PROJECT=sportsloop
This project provides modules to create a private kubernetes cluster. This is backed by static IP's and Subnets. There are 2 main commands which executes the provisioning of the clusters.
- Network Creation
- Cluster Creation
make apply NETWORK=us-central1 PROJECT=sportsloop
make apply NETWORK=prod PROJECT=sportsloop
if you would like to see detailed changes then use the following instead:
make plan NETWORK=dev PROJECT=sportsloop
make plan NETWORK=prod PROJECT=sportsloop
make apply CLUSTER=dev PROJECT=sportsloop
make apply CLUSTER=prod PROJECT=sportsloop
if you would like to see detailed changes then use the following instead:
make plan CLUSTER=dev PROJECT=sportsloop
make plan CLUSTER=prod PROJECT=sportsloop
make apply DATABASE=dev PROJECT=sportsloop
make apply DATABASE=prod PROJECT=sportsloop
if you would like to see detailed changes then use the following instead:
make plan DATABASE=dev PROJECT=sportsloop
make plan DATABASE=prod PROJECT=sportsloop
make apply-skip PROJECT=sportsloop && \
make apply-skip NETWORK=dev PROJECT=sportsloop && \
make apply-skip NETWORK=prod PROJECT=sportsloop && \
make apply-skip CLUSTER=dev PROJECT=sportsloop && \
make apply-skip CLUSTER=prod PROJECT=sportsloop && \
make apply-skip DATABASE=dev PROJECT=sportsloop && \
make apply-skip DATABASE=prod PROJECT=sportsloop
The following commands are similar to creating the Networks and Clusters
make destroy CLUSTER=dev PROJECT=sportsloop
make destroy CLUSTER=prod PROJECT=sportsloop
make destroy NETWORK=dev PROJECT=sportsloop
make destroy NETWORK=prod PROJECT=sportsloop
make destroy DATABASE=dev PROJECT=sportsloop
make destroy DATABASE=prod PROJECT=sportsloop
make destroy-skip DATABASE=dev PROJECT=sportsloop && \
make destroy-skip DATABASE=prod PROJECT=sportsloop && \
make destroy-skip CLUSTER=dev PROJECT=sportsloop && \
make destroy-skip CLUSTER=prod PROJECT=sportsloop && \
make destroy-skip NETWORK=dev PROJECT=sportsloop && \
make destroy-skip NETWORK=prod PROJECT=sportsloop && \
make destroy-skip PROJECT=sportsloop
- Reserve a static address in google
- Create Billing Export & Enable Big Data Query
- Global Ingress (Not Done)
- n1-standard-1 (1vCPU, 3.75GB) on both clusters.
- Node Upgrades are not disabled
- Create Cloud Functions for Notifications (Especially since Google updates the Control Plane)
- 2 Node Pools (Default is for Apps, Core is for Cluster Management e.g Prometheus)
- dev cluster is in 1 Zone, Prod Cluster in 2 Zones
- Both Dev and Prod DB's are HA and have 3 replicas. Dev does not have to be HA as assuming you would want many of these
make setup-gcp-for-terraform PROJECT=<..>
make generate-keyfile
mkdir .docker && touch .docker/config.json
make plan PROJECT=<..>
make plans PROJECT=<..>
make apply PROJECT=<..>
make plan-destroy PROJECT=<..>
make destroy PROJECT=<..>
make plan NETWORK=<..> PROJECT=<..>
make plans NETWORK=<..> PROJECT=<..>
make apply NETWORK=<..> PROJECT=<..>
make plan-destroy NETWORK=<..> PROJECT=<..>
make destroy NETWORK=<..> PROJECT=<..>
Must have ENV variable GITLAB_TOKEN set.
make plan CLUSTER=<..> PROJECT=<..>
make plans CLUSTER=<..> PROJECT=<..>
make apply CLUSTER=<..> PROJECT=<..>
make plan-destroy CLUSTER=<..> PROJECT=<..>
make destroy CLUSTER=<..> PROJECT=<..>