Skip to content

Commit

Permalink
docs: updated language DOC-1037
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding committed Jan 22, 2024
1 parent ec2dc31 commit bbd16b8
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 181 deletions.
30 changes: 14 additions & 16 deletions terraform/iaas-cluster-deployment-tf/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# IaaS Cluster Deployment


This Terraform code is explained in the [Deploy a Cluster](https://docs.spectrocloud.com/clusters/public-cloud/deploy-k8s-cluster) tutorial.

This Terraform code has three main toggle variables that you can use to deploy to one of the following cloud providers.

| Variable| Provider| Description| Default |
|---|---|---|---|
| `deploy-aws` | AWS | Enable to deploy a cluster to AWS. | `false`|
| `deploy-azure` | GCP | Enable to deploy a cluster to Azure. | `false`|
| `deploy-gcp` | Azure | Enable to deploy a cluster to GCP. | `false`|
| Variable | Provider | Description | Default |
| -------------- | -------- | ------------------------------------ | ------- |
| `deploy-aws` | AWS | Enable to deploy a cluster to AWS. | `false` |
| `deploy-azure` | GCP | Enable to deploy a cluster to Azure. | `false` |
| `deploy-gcp` | Azure | Enable to deploy a cluster to GCP. | `false` |

> You can enable as many of the providers as you want. You just need to ensure all provider's required values are specified.
To get started, open up the file **terraform.tfvars**. Toggle the provider variable mentioned in the table and start providing values for the respective cloud provider. Make sure you specify a value to your cloud provider variables and replace all values containing the string `REPLACE ME`.


## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 |
| <a name="requirement_spectrocloud"></a> [spectrocloud](#requirement\_spectrocloud) | >= 0.13.1 |
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | 4.0.4 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.16.1 |
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.13.2 |
| <a name="provider_tls"></a> [tls](#provider\_tls) | 4.0.4 |

## Modules
Expand Down Expand Up @@ -60,30 +58,30 @@ No modules.
| [spectrocloud_pack.gcp_csi](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack) | data source |
| [spectrocloud_pack.gcp_k8s](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack) | data source |
| [spectrocloud_pack.gcp_ubuntu](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack) | data source |
| [spectrocloud_pack.proxy](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack) | data source |
| [spectrocloud_registry.public_registry](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/registry) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws-cloud-account-name"></a> [aws-cloud-account-name](#input\_aws-cloud-account-name) | The name of your AWS account as assigned in Palette | `string` | `""` | no |
| <a name="input_aws-key-pair-name"></a> [aws-key-pair-name](#input\_aws-key-pair-name) | The name of the AWS key pair to use for SSH access to the cluster. Refer to [EC2 Key Pairs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) to learn more. | `string` | `""` | no |
| <a name="input_aws-region"></a> [aws-region](#input\_aws-region) | AWS region | `string` | `"us-east-1"` | yes |
| <a name="input_aws_master_nodes"></a> [aws\_master\_nodes](#input\_aws\_master\_nodes) | AWS master nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> availability_zones = list(string)<br> })</pre> | <pre>{<br> "availability_zones": [<br> "us-east-1a"<br> ],<br> "control_plane": true,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "m4.2xlarge"<br>}</pre> | no |
| <a name="input_aws-region"></a> [aws-region](#input\_aws-region) | AWS region | `string` | `"us-east-1"` | no |
| <a name="input_aws_control_plane_nodes"></a> [aws\_control\_plane\_nodes](#input\_aws\_control\_plane\_nodes) | AWS control plane nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> availability_zones = list(string)<br> })</pre> | <pre>{<br> "availability_zones": [<br> "us-east-1a"<br> ],<br> "control_plane": true,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "m4.2xlarge"<br>}</pre> | no |
| <a name="input_aws_worker_nodes"></a> [aws\_worker\_nodes](#input\_aws\_worker\_nodes) | AWS worker nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> availability_zones = list(string)<br> })</pre> | <pre>{<br> "availability_zones": [<br> "us-east-1a"<br> ],<br> "control_plane": false,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "m4.2xlarge"<br>}</pre> | no |
| <a name="input_azure-cloud-account-name"></a> [azure-cloud-account-name](#input\_azure-cloud-account-name) | The name of your Azure account as assigned in Palette | `string` | `""` | no |
| <a name="input_azure-region"></a> [azure-region](#input\_azure-region) | Azure region | `string` | `"eastus"` | no |
| <a name="input_azure-use-azs"></a> [azure-use-azs](#input\_azure-use-azs) | A flag for configuring whether to use Azure Availability Zones. Check if your Azure region supports availability zones by reviewing the [Azure Regions and Availability Zones](https://learn.microsoft.com/en-us/azure/reliability/availability-zones-service-support#azure-regions-with-availability-zone-support) resource. | `bool` | `true` | no |
| <a name="input_azure_master_nodes"></a> [azure\_master\_nodes](#input\_azure\_master\_nodes) | Azure master nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> azs = list(string)<br> is_system_node_pool = bool<br> })</pre> | <pre>{<br> "azs": [<br> "1"<br> ],<br> "control_plane": true,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "Standard_A8_v2",<br> "is_system_node_pool": false<br>}</pre> | no |
| <a name="input_azure-use-azs"></a> [azure-use-azs](#input\_azure-use-azs) | A flag for configuring whether to use Azure Availability Zones. Check if your Azure region supports availability zones by reviewing the [Azure Regions and Availability Zones](https://learn.microsoft.com/en-us/azure/reliability/availability-zones-service-support#azure-regions-with-availability-zone-support) resource | `bool` | n/a | yes |
| <a name="input_azure_control_plane_nodes"></a> [azure\_control\_plane\_nodes](#input\_azure\_control\_plane\_nodes) | Azure control plane nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> azs = list(string)<br> is_system_node_pool = bool<br> })</pre> | <pre>{<br> "azs": [<br> "1"<br> ],<br> "control_plane": true,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "Standard_A8_v2",<br> "is_system_node_pool": false<br>}</pre> | no |
| <a name="input_azure_resource_group"></a> [azure\_resource\_group](#input\_azure\_resource\_group) | Azure resource group | `string` | `""` | no |
| <a name="input_azure_subscription_id"></a> [azure\_subscription\_id](#input\_azure\_subscription\_id) | Azure subscription ID | `string` | `""` | no |
| <a name="input_azure_worker_nodes"></a> [azure\_worker\_nodes](#input\_azure\_worker\_nodes) | Azure worker nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> azs = list(string)<br> is_system_node_pool = bool<br> })</pre> | <pre>{<br> "azs": [],<br> "control_plane": false,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "Standard_A8_v2",<br> "is_system_node_pool": false<br>}</pre> | no |
| <a name="input_azure_worker_nodes"></a> [azure\_worker\_nodes](#input\_azure\_worker\_nodes) | Azure worker nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> azs = list(string)<br> is_system_node_pool = bool<br> })</pre> | <pre>{<br> "azs": [<br> "1"<br> ],<br> "control_plane": false,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "Standard_A8_v2",<br> "is_system_node_pool": false<br>}</pre> | no |
| <a name="input_deploy-aws"></a> [deploy-aws](#input\_deploy-aws) | A flag for enabling a deployment on AWS | `bool` | n/a | yes |
| <a name="input_deploy-azure"></a> [deploy-azure](#input\_deploy-azure) | A flag for enabling a deployment on Azure | `bool` | n/a | yes |
| <a name="input_deploy-gcp"></a> [deploy-gcp](#input\_deploy-gcp) | A flag for enabling a deployment on GCP | `bool` | n/a | yes |
| <a name="input_gcp-cloud-account-name"></a> [gcp-cloud-account-name](#input\_gcp-cloud-account-name) | The name of your GCP account as assigned in Palette | `string` | `""` | no |
| <a name="input_gcp-region"></a> [gcp-region](#input\_gcp-region) | GCP region | `string` | `"us-central1"` | no |
| <a name="input_gcp_master_nodes"></a> [gcp\_master\_nodes](#input\_gcp\_master\_nodes) | GCP master nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> availability_zones = list(string)<br> })</pre> | <pre>{<br> "availability_zones": [<br> "us-central1-a"<br> ],<br> "control_plane": true,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "n1-standard-4"<br>}</pre> | no |
| <a name="input_gcp_control_plane_nodes"></a> [gcp\_control\_plane\_nodes](#input\_gcp\_control\_plane\_nodes) | GCP control plane nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> availability_zones = list(string)<br> })</pre> | <pre>{<br> "availability_zones": [<br> "us-central1-a"<br> ],<br> "control_plane": true,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "n1-standard-4"<br>}</pre> | no |
| <a name="input_gcp_project_name"></a> [gcp\_project\_name](#input\_gcp\_project\_name) | The name of your GCP project | `string` | `""` | no |
| <a name="input_gcp_worker_nodes"></a> [gcp\_worker\_nodes](#input\_gcp\_worker\_nodes) | GCP worker nodes configuration. | <pre>object({<br> count = string<br> control_plane = bool<br> instance_type = string<br> disk_size_gb = string<br> availability_zones = list(string)<br> })</pre> | <pre>{<br> "availability_zones": [<br> "us-central1-a"<br> ],<br> "control_plane": false,<br> "count": "1",<br> "disk_size_gb": "60",<br> "instance_type": "n1-standard-4"<br>}</pre> | no |
| <a name="input_tags"></a> [tags](#input\_tags) | The default tags to apply to Palette resources | `list(string)` | <pre>[<br> "spectro-cloud-education",<br> "app:hello-universe",<br> "repository:spectrocloud:tutorials",<br> "terraform_managed:true",<br> "tutorial:iaas-cluster-deployment-tf"<br>]</pre> | no |
Expand Down
34 changes: 17 additions & 17 deletions terraform/iaas-cluster-deployment-tf/clusters.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ resource "spectrocloud_cluster_aws" "aws-cluster" {
machine_pool {
control_plane = true
control_plane_as_worker = true
name = "master-pool"
count = var.aws_master_nodes.count
instance_type = var.aws_master_nodes.instance_type
disk_size_gb = var.aws_master_nodes.disk_size_gb
azs = var.aws_master_nodes.availability_zones
name = "control-plane-pool"
count = var.aws_control_plane_nodes.count
instance_type = var.aws_control_plane_nodes.instance_type
disk_size_gb = var.aws_control_plane_nodes.disk_size_gb
azs = var.aws_control_plane_nodes.availability_zones
}

machine_pool {
Expand Down Expand Up @@ -64,13 +64,13 @@ resource "spectrocloud_cluster_azure" "azure-cluster" {
machine_pool {
control_plane = true
control_plane_as_worker = true
name = "master-pool"
count = var.azure_master_nodes.count
instance_type = var.azure_master_nodes.instance_type
azs = var.azure_master_nodes.azs
is_system_node_pool = var.azure_master_nodes.is_system_node_pool
name = "control-plane-pool"
count = var.azure_control_plane_nodes.count
instance_type = var.azure_control_plane_nodes.instance_type
azs = var.azure_control_plane_nodes.azs
is_system_node_pool = var.azure_control_plane_nodes.is_system_node_pool
disk {
size_gb = var.azure_master_nodes.disk_size_gb
size_gb = var.azure_control_plane_nodes.disk_size_gb
type = "Standard_LRS"
}
}
Expand Down Expand Up @@ -111,11 +111,11 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster" {
machine_pool {
control_plane = true
control_plane_as_worker = true
name = "master-pool"
count = var.gcp_master_nodes.count
instance_type = var.gcp_master_nodes.instance_type
disk_size_gb = var.gcp_master_nodes.disk_size_gb
azs = var.gcp_master_nodes.availability_zones
name = "control-plane-pool"
count = var.gcp_control_plane_nodes.count
instance_type = var.gcp_control_plane_nodes.instance_type
disk_size_gb = var.gcp_control_plane_nodes.disk_size_gb
azs = var.gcp_control_plane_nodes.availability_zones
}

machine_pool {
Expand All @@ -130,4 +130,4 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster" {
create = "30m"
delete = "15m"
}
}
}
16 changes: 8 additions & 8 deletions terraform/iaas-cluster-deployment-tf/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ variable "azure-use-azs" {
variable "aws-region" {
type = string
description = "AWS region"
default = "us-east-1"
default = "us-east-1"
}

variable "gcp-region" {
Expand All @@ -77,7 +77,7 @@ variable "aws-key-pair-name" {
default = ""
}

variable "aws_master_nodes" {
variable "aws_control_plane_nodes" {
type = object({
count = string
control_plane = bool
Expand All @@ -92,7 +92,7 @@ variable "aws_master_nodes" {
disk_size_gb = "60"
availability_zones = ["us-east-1a"]
}
description = "AWS master nodes configuration."
description = "AWS control plane nodes configuration."
}
variable "aws_worker_nodes" {
type = object({
Expand All @@ -112,7 +112,7 @@ variable "aws_worker_nodes" {
description = "AWS worker nodes configuration."
}

variable "azure_master_nodes" {
variable "azure_control_plane_nodes" {
type = object({
count = string
control_plane = bool
Expand All @@ -128,7 +128,7 @@ variable "azure_master_nodes" {
disk_size_gb = "60"
azs = ["1"]
is_system_node_pool = false }
description = "Azure master nodes configuration."
description = "Azure control plane nodes configuration."
}

variable "azure_worker_nodes" {
Expand All @@ -150,7 +150,7 @@ variable "azure_worker_nodes" {
description = "Azure worker nodes configuration."
}

variable "gcp_master_nodes" {
variable "gcp_control_plane_nodes" {
type = object({
count = string
control_plane = bool
Expand All @@ -164,7 +164,7 @@ variable "gcp_master_nodes" {
instance_type = "n1-standard-4"
disk_size_gb = "60"
availability_zones = ["us-central1-a"] }
description = "GCP master nodes configuration."
description = "GCP control plane nodes configuration."
}

variable "gcp_worker_nodes" {
Expand Down Expand Up @@ -194,4 +194,4 @@ variable "tags" {
"terraform_managed:true",
"tutorial:iaas-cluster-deployment-tf"
]
}
}
9 changes: 5 additions & 4 deletions terraform/iaas-cluster-deployment-tf/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aws-cloud-account-name = "REPLACE_ME"
aws-region = "REPLACE_ME"
aws-key-pair-name = "REPLACE_ME"

aws_master_nodes = {
aws_control_plane_nodes = {
count = "1"
control_plane = true
instance_type = "m4.2xlarge"
Expand All @@ -27,15 +27,15 @@ aws_worker_nodes = {
# Azure Deployment Settings
############################
deploy-azure = false # Set to true to deploy to Azure
azure-use-azs = true # Set to false when you deploy to a region without AZs
azure-use-azs = true # Set to false when you deploy to a region without AZs

azure-cloud-account-name = "REPLACE_ME"
azure-region = "REPLACE_ME"
azure_subscription_id = "REPLACE_ME"
azure_resource_group = "REPLACE_ME"


azure_master_nodes = {
azure_control_plane_nodes = {
count = "1"
control_plane = true
instance_type = "Standard_A8_v2"
Expand All @@ -61,7 +61,8 @@ deploy-gcp = false # Set to true to deploy to GCP
gcp-cloud-account-name = "REPLACE_ME"
gcp-region = "REPLACE_ME"
gcp_project_name = "REPLACE_ME"
gcp_master_nodes = {

gcp_control_plane_nodes = {
count = "1"
control_plane = true
instance_type = "n1-standard-4"
Expand Down
Loading

0 comments on commit bbd16b8

Please sign in to comment.