| Components | |
|---|---|
| Artifact Registry in Google Cloud | |
| GCP Kubernetes Cluster | |
| Flexible VPC setup in GCP | |
| Kubernetes ESO for Google Cloud Secret Manager | |
| DNS Management |
Cloudflare
|
| Infrastructure CI/CD pipeline |
GitLab CI
|
| Ingress Controller |
Nginx
|
| CI/CD Runner |
Bitbucket Runner
|
| Caching | Memorystore |
| Object Storage |
Cloud Storage Buckets
|
| SQL Database |
MySQL and PostgreSQL
|
| Helm Chart | |
| Setup by Corewide team | |
| Post-implementation training | |
| 2-week warranty support | |
| Documentation |
Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:
shellterraform login solutions.corewide.com
Download Infrasnap archive from My Library page, unpack it to a new directory and initialize a new project there:
shellcd infrasnap/
git init
git add .
Follow the instructions in README.md:
terraform.tfvars, or using environment variables)
infrasnap.yml parameters based on the reference belowbackend.tf
Initialize the setup, create the environment you configured in infrasnap.yml and
provision
the infrastructure:
shellterraform init
terraform workspace new <environment_name>
terraform workspace select <environment_name>
terraform apply
| Variable | Description | Type | Default | Required | Sensitive |
|---|---|---|---|---|---|
project_name |
Project name to use for resource naming | string |
yes | no | |
config |
Infrasnap configuration data | any |
{} |
no | no |
config_file |
Path to a YAML file with Infrasnap configuration data | string |
./infrasnap.yml |
no | no |
project_id |
GCP Project ID (can be set as GOOGLE_PROJECT/GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT environment variables) |
string |
no | no | |
service_account_credentials_file |
Either the path to or the content of a GCP service account key file in JSON format (can be set as GOOGLE_CREDENTIALS/GOOGLE_CLOUD_KEYFILE_JSON/GCLOUD_KEYFILE_JSON environment variables) |
string |
no | no | |
cloudflare_api_token |
Cloudflare API token with DNS management permissions for all DNS zones managed in the setup. This can also be sourced from the CLOUDFLARE_API_TOKEN environment variable |
string |
no | yes | |
bitbucket_oauth_client_id |
OAuth client ID of Bitbucket workspace | string |
yes | yes | |
bitbucket_oauth_client_secret |
OAuth client secret of Bitbucket workspace | string |
yes | yes |
| Variable | Description | Type | Default |
|---|---|---|---|
region |
GCP region to place the resources into | string |
us-east1 |
vpc_cidr_kubernetes |
CIDR block for Kubernetes stack of this environment | string |
10.10.0.0/16 |
vpc_cidr_data |
CIDR block for data stack (databases/caches) of this environment | string |
10.11.0.0/16 |
container_registry_workspace |
Environment where container registry must be created. Leave blank to not create at all | string |
development |
container_registry_repo_max_images |
Number of images stored before cleanup starts | number |
50 |
container_registry_repo_names |
List of container repositories to create | list |
|
k8s_zone |
Region zone index for the zonal cluster. Leave blank to use regional cluster | string |
|
k8s_version |
Kubernetes engine version to deploy the cluster with | string |
1.34 |
k8s_deletion_protection_enabled |
Enables deletion protection of the GKE cluster | bool |
true |
k8s_default_node_pool_node_size |
Machine type to use for all nodes in the default node pool | string |
e2-standard-2 |
k8s_default_node_pool_max_size |
Maximum number of nodes in the default node pool (for autoscaling) | number |
2 |
k8s_node_pools |
List of Kubernetes node pool definitions | list |
|
k8s_node_pools[*].name |
Name of the node pool to create | string |
application |
k8s_node_pools[*].node_size |
Machine type to use for all nodes in this node pool | string |
e2-standard-2 |
k8s_node_pools[*].max_size |
Maximum number of nodes in the node pool (for autoscaling) | number |
3 |
dns_zone_create |
Whether to create DNS zone or use the existing one | bool |
false |
dns_zone |
DNS zone in which to create records, disable to reuse the same zone from another workspace | string |
example.com |
dns_records_k8s |
A list of subdomains that must point at Ingress LoadBalancer | list |
|
dns_proxied_records_k8s |
A list of subdomains that must be proxied by Cloudflare and point at Ingress LoadBalancer | list |
|
dns_records |
List of extra records that do not point at Ingress LoadBalancer See module_docs for complete reference | map |
|
dns_records.www |
Name of the DNS record | map |
|
dns_records.www.type |
The type of the record. Possible values are: A, AAAA, CNAME, MX, NS and TXT |
string |
CNAME |
dns_records.www.value |
The content of the record | list |
['test'] |
cloudflare_account_id |
Cloudflare account ID in which to manage the DNS zone resources | NoneType |
|
cert_manager_email |
E-mail that Let's Encrypt cluster issuer will use to request certificates | string |
[email protected] |
cicd |
map |
||
cicd.bitbucket_repository_uuid |
Bitbucket repository UUID | string |
|
cicd.bitbucket_account_uuid |
Bitbucket account UUID | string |
account_uuid |
cicd.bitbucket_runner_uuid |
Bitbucket Pipelines Runner UUID | string |
runner_uuid |
cicd.node_pool_name |
Name of node pool to place Bitbucket Pipelines Runner | string |
maintenance |
cache_multi_az_enabled |
Indicates whether High Availability is enabled for the main cluster | bool |
true |
cache_shard_count |
Number of Redis cluster shards. Must be greater than 0 | number |
1 |
cache_node_size |
Redis cluster node size. Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL |
string |
REDIS_HIGHMEM_MEDIUM |
cache_node_replica_count |
Count of node replicas per shard. Value must be in 0-2 range | number |
0 |
cache_deletion_protection_enabled |
Indicates whether the main cluster is deletion protected | bool |
true |
cache_traffic_encryption_enabled |
Indicates whether in-transit encryption for the Redis cluster is enabled | bool |
true |
buckets |
Buckets definitions to create | map |
|
buckets.my-bucket |
Bucket name | map |
|
buckets.my-bucket.access_mode |
Cloud Storage bucket access mode. Allowed values: private, public-read |
string |
private |
buckets.my-bucket.versioning |
Enable versioning for the bucket | bool |
false |
| Output | Description | Type | Sensitive |
|---|---|---|---|
app_namespace |
Kubernetes namespace to deploy the application to | attribute |
no |
application_secret |
Name of GCP Secret Manager secret for sensitive data of the application. Insert values there manually | attribute |
no |
cluster_connection_cli |
CLI command to connect to the cluster | computed |
no |
container_registries |
GCR repositories to push container images to | computed |
no |
registry_connection_cli |
CLI command to authenticate to the container registry | computed |
no |
name_servers |
Name servers of DNS zone managed in this workspace | attribute |
no |
memorystore_connection_secret_name |
Name of GCP Secret Manager secret with Memorystore connection parameters | attribute |
no |
bucket_names |
List of bucket names | list(attribute) |
no |