Skip to content

Latest commit

 

History

History
157 lines (139 loc) · 20.3 KB

File metadata and controls

157 lines (139 loc) · 20.3 KB

Getting Started Cluster Deployment

This folder contains the demo code for the Getting Started Cluster Management with Terraform tutorials.

The Terraform code has four 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
deploy-vmware VMware vSphere Enable to deploy a cluster to VMware vSphere. false

You can enable as many providers as you want, just make sure to specify all required values for each provider.

To get started, open the terraform.tfvars file. Toggle the provider variable as specified in the table and provide values to your cloud provider variables, replacing all instances of the string REPLACE ME.

Requirements

Name Version
terraform >= 1.9
local 2.4.1
spectrocloud >= 0.20.6
tls 4.0.4
vsphere >= 2.6.1

Providers

Name Version
local 2.4.1
spectrocloud 0.20.6
tls 4.0.4

Modules

No modules.

Resources

Name Type
local_file.public_key_file resource
local_sensitive_file.private_key_file resource
spectrocloud_cluster_aws.aws-cluster resource
spectrocloud_cluster_azure.azure-cluster resource
spectrocloud_cluster_gcp.gcp-cluster resource
spectrocloud_cluster_profile.aws-profile resource
spectrocloud_cluster_profile.aws-profile-kubecost resource
spectrocloud_cluster_profile.azure-profile resource
spectrocloud_cluster_profile.azure-profile-kubecost resource
spectrocloud_cluster_profile.gcp-profile resource
spectrocloud_cluster_profile.gcp-profile-kubecost resource
spectrocloud_cluster_profile.vmware-profile resource
spectrocloud_cluster_profile.vmware-profile-kubecost resource
spectrocloud_cluster_vsphere.vmware-cluster resource
spectrocloud_privatecloudgateway_ippool.ippool resource
tls_private_key.tutorial_ssh_key resource
tls_private_key.tutorial_ssh_key_azure resource
spectrocloud_cloudaccount_aws.account data source
spectrocloud_cloudaccount_azure.account data source
spectrocloud_cloudaccount_gcp.account data source
spectrocloud_cloudaccount_vsphere.account data source
spectrocloud_pack.aws_cni data source
spectrocloud_pack.aws_csi data source
spectrocloud_pack.aws_k8s data source
spectrocloud_pack.aws_ubuntu data source
spectrocloud_pack.azure_cni data source
spectrocloud_pack.azure_csi data source
spectrocloud_pack.azure_k8s data source
spectrocloud_pack.azure_ubuntu data source
spectrocloud_pack.gcp_cni data source
spectrocloud_pack.gcp_csi data source
spectrocloud_pack.gcp_k8s data source
spectrocloud_pack.gcp_ubuntu data source
spectrocloud_pack.hellouniverse data source
spectrocloud_pack.kubecost data source
spectrocloud_pack.vmware_cni data source
spectrocloud_pack.vmware_csi data source
spectrocloud_pack.vmware_k8s data source
spectrocloud_pack.vmware_metallb data source
spectrocloud_pack.vmware_ubuntu data source
spectrocloud_private_cloud_gateway.pcg data source
spectrocloud_registry.community_registry data source
spectrocloud_registry.public_registry data source

Inputs

Name Description Type Default Required
app_namespace The namespace in which the application will be deployed. string n/a yes
app_port The cluster port number on which the service will listen for incoming traffic. number n/a yes
auth_token The base64 encoded auth token for the API connection. string n/a yes
aws-cloud-account-name The name of your AWS account as assigned in Palette. string n/a yes
aws-key-pair-name The name of the AWS key pair to use for SSH access to the cluster. string n/a yes
aws-region AWS region string "us-east-1" no
aws_control_plane_nodes AWS control plane nodes configuration.
object({
count = string
control_plane = bool
instance_type = string
disk_size_gb = string
availability_zones = list(string)
})
{
"availability_zones": [
"us-east-1a"
],
"control_plane": true,
"count": "1",
"disk_size_gb": "60",
"instance_type": "m4.2xlarge"
}
no
aws_worker_nodes AWS worker nodes configuration.
object({
count = string
control_plane = bool
instance_type = string
disk_size_gb = string
availability_zones = list(string)
})
{
"availability_zones": [
"us-east-1a"
],
"control_plane": false,
"count": "1",
"disk_size_gb": "60",
"instance_type": "m4.2xlarge"
}
no
azure-cloud-account-name The name of your Azure account as assigned in Palette. string "" no
azure-region Azure region. string "eastus" no
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 resource. bool n/a yes
azure_control_plane_nodes Azure control plane nodes configuration.
object({
count = string
control_plane = bool
instance_type = string
disk_size_gb = string
azs = list(string)
is_system_node_pool = bool
})
{
"azs": [
"1"
],
"control_plane": true,
"count": "1",
"disk_size_gb": "60",
"instance_type": "Standard_A8_v2",
"is_system_node_pool": false
}
no
azure_resource_group Azure resource group. string "" no
azure_subscription_id Azure subscription ID. string "" no
azure_worker_nodes Azure worker nodes configuration.
object({
count = string
control_plane = bool
instance_type = string
disk_size_gb = string
azs = list(string)
is_system_node_pool = bool
})
{
"azs": [
"1"
],
"control_plane": false,
"count": "1",
"disk_size_gb": "60",
"instance_type": "Standard_A8_v2",
"is_system_node_pool": false
}
no
datacenter_name The name of the datacenter in vSphere. string n/a yes
datastore_name The name of the vSphere datastore. string n/a yes
db_password The base64 encoded database password to connect to the API database. string n/a yes
deploy-aws A flag for enabling a deployment on AWS. bool n/a yes
deploy-aws-kubecost A flag for enabling a deployment on AWS with Kubecost. bool n/a yes
deploy-azure A flag for enabling a deployment on Azure. bool n/a yes
deploy-azure-kubecost A flag for enabling a deployment on Azure with Kubecost. bool n/a yes
deploy-gcp A flag for enabling a deployment on GCP. bool n/a yes
deploy-gcp-kubecost A flag for enabling a deployment on GCP with Kubecost. bool n/a yes
deploy-vmware A flag for enabling a deployment on VMware. bool n/a yes
deploy-vmware-kubecost A flag for enabling a deployment on VMware with Kubecost. bool n/a yes
deploy-vmware-static A flag for enabling a deployment on VMware using static IP placement. bool n/a yes
folder_name The name of the folder in vSphere. string n/a yes
gcp-cloud-account-name The name of your GCP account as assigned in Palette. string "" no
gcp-region GCP region string "us-central1" no
gcp_control_plane_nodes GCP control plane nodes configuration.
object({
count = string
control_plane = bool
instance_type = string
disk_size_gb = string
availability_zones = list(string)
})
{
"availability_zones": [
"us-central1-a"
],
"control_plane": true,
"count": "1",
"disk_size_gb": "60",
"instance_type": "n1-standard-4"
}
no
gcp_project_name The name of your GCP project. string "" no
gcp_worker_nodes GCP worker nodes configuration.
object({
count = string
control_plane = bool
instance_type = string
disk_size_gb = string
availability_zones = list(string)
})
{
"availability_zones": [
"us-central1-a"
],
"control_plane": false,
"count": "1",
"disk_size_gb": "60",
"instance_type": "n1-standard-4"
}
no
ip_range_end The last IP address of your PCG IP pool range. string n/a yes
ip_range_start The first IP address of your PCG IP pool range. string n/a yes
metallb_ip The IP address range for your MetalLB load balancer. string n/a yes
nameserver_addr A comma-separated list of DNS nameserver IP addresses of your network. set(string) n/a yes
network_gateway The IP address of the vSphere network gateway. string n/a yes
network_name The name of the vSphere network. string n/a yes
network_prefix The prefix of your vSphere network. Valid values are network CIDR subnet masks from the range 0-32. Example: 18. number n/a yes
palette-project The name of your project in Palette. string n/a yes
pcg_name The name of the PCG that will be used to deploy the cluster. string n/a yes
replicas_number The number of pods to be created. number n/a yes
resource_pool_name The name of the vSphere resource pool. string n/a yes
search_domain The name of network search domain. string n/a yes
ssh_key The path to the public key that will be added to the cluster nodes. If not provided, a new key pair will be generated. string n/a yes
ssh_key_private The path to the private key that will be used to access the cluster nodes. If not provided, a new key pair will be generated. string n/a yes
tags The default tags to apply to Palette resources. list(string)
[
"spectro-cloud-education",
"app:hello-universe",
"spectrocloud:tutorials",
"terraform_managed:true",
"tutorial:getting-started-terraform"
]
no
vsphere_cluster The name of your vSphere cluster. string n/a yes

Outputs

Name Description
Advisory n/a
ssh_connection_command Command to use the generated private SSH key to access the nodes.
ssh_connection_command_user Command to use the user's private SSH key to access the nodes.
ssh_key_location Location of the generated private SSH key file.
ssh_public_key_location Location of the generated public SSH key file.