Following resources would be created using this repo.
- VPC and subnet
- GKE regional cluster (default region: europe-west1, default name: demo-application) with a nodepool
- Relevant service accounts
- Container registry (GCR)
- Secret "gcr-json-key" for docker image pull access for deployments
- Static IP address
- Cloud DNS, DNS Zone with A type record set pointing to static IP
- nginx ingress-controller
- cert-manager and letsencrypt
- This repo's Dockerfile is used to create image (japrakash/cci-terraform-light-gcloudsdk:0.0.1) with terraform and gcloud sdk
-
Find out a GCP project or create a new one and then create a bucket e.g. "demo-application-tfstate-eu-gcs" for saving terraform state.
-
Create a service account "cicd-pipeline" which will be used to run pipelines. Download its key file in json format and use as GCP_CREDS value.
-
Create below mentioned env variables in CircleCi with respective values
CLUSTER_NAME = demo-application CLUSTER_REGION = europe-west1 GCP_CREDS = <json file contents created in step 2> GCP_PROJECT = Jagendraatal Prakash Contino DNS_NAME = demoapplication.squadzero.io.
-
Let the pipeline run and that should create complete infra.
-
Need to create a serviceaccount for dns by running below commands.
$ PROJECT_ID=myproject-id $ gcloud iam service-accounts create dns01-solver --display-name "dns01-solver" $ gcloud projects add-iam-policy-binding $PROJECT_ID
--member serviceAccount:dns01-solver@$PROJECT_ID.iam.gserviceaccount.com
--role roles/dns.admin $ gcloud iam service-accounts keys create key.json
--iam-account dns01-solver@$PROJECT_ID.iam.gserviceaccount.com $ kubectl create secret generic cert-manager-credentials
--from-file=key.json
-
PodSecurityPolicy (pod_security_policy_config) for cluster is currently disable. So need to enable it.
-
Automation of new project, terraform state bucket and service account creation.
-
Introduce tflint and tfsec checks in pipeline.
No requirements.
Name | Version |
---|---|
n/a | |
google-beta | n/a |
random | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
default_max_nodes_per_zone_per_pool | n/a | string |
"3" |
no |
default_min_nodes_per_zone_per_pool | n/a | string |
"1" |
no |
disk_size_gb | n/a | string |
"100" |
no |
disk_type | n/a | string |
"pd-standard" |
no |
gcr_bucket_name | The bucket name for the Google Container Registry | any |
n/a | yes |
initial_node_count | n/a | string |
"1" |
no |
machine_type | n/a | any |
n/a | yes |
min_master_version | n/a | any |
n/a | yes |
name | n/a | any |
n/a | yes |
node_ip_range | n/a | any |
n/a | yes |
node_pool_oauth_scopes | The oauth scope(s) to apply to the node pools | list(string) |
[ |
no |
nodepool_count | n/a | any |
n/a | yes |
pod_ip_range | n/a | any |
n/a | yes |
preemptible | n/a | any |
n/a | yes |
region | n/a | any |
n/a | yes |
service_ip_range | n/a | any |
n/a | yes |
Name | Description |
---|---|
cluster_ca_certificate | n/a |
cluster_endpoint | n/a |
cluster_master_version | n/a |
cluster_name | n/a |
cluster_region | n/a |
network_name | n/a |
service_account_email | n/a |
subnet_name | n/a |