Skip to content

Commit

Permalink
fix: updated language DOC-1037 (#34)
Browse files Browse the repository at this point in the history
* docs: updated language DOC-1037

* fix: applied license header
  • Loading branch information
karl-cardenas-coding authored Jan 23, 2024
1 parent ec2dc31 commit 0557096
Show file tree
Hide file tree
Showing 51 changed files with 343 additions and 182 deletions.
15 changes: 15 additions & 0 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema_version = 1

project {
copyright_holder = "Spectro Cloud"
license = "Apache-2.0"
copyright_year = 2024

# (OPTIONAL) A list of globs that should not have copyright/license headers.
# Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored
header_ignore = [
# "vendors/**",
# "**autogen**",
]
}
3 changes: 3 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

branches: [main]
repositoryUrl: https://github.com/spectrocloud/tutorials
plugins:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

ARG PALETTE_VERSION

FROM gcr.io/spectro-images-public/release/spectro-registry:${PALETTE_VERSION} as server
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.PHONY: license

init: ## Install dependencies and setup the project
@echo "initializing npm dependencies"
npm ci
Expand All @@ -17,4 +19,9 @@ build-docker: ## Build docker image
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
--build-arg ORAS_VERSION=$(PACKER_VERSION) \
--build-arg TERRAFORM_VERSION=$(TERRAFORM_VERSION) \
-t tutorials .
-t tutorials .


license: ## Adds a license header to all files. Reference https://github.com/hashicorp/copywrite to learn more.
@echo "Applying license headers..."
copywrite headers
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) Spectro Cloud
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
extends: [
'@commitlint/config-conventional'
Expand Down
3 changes: 3 additions & 0 deletions edge/vmware/clone_vm_template/delete-edge-host.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0


source ./setenv.sh

Expand Down
3 changes: 3 additions & 0 deletions edge/vmware/clone_vm_template/delete-packer-cache.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0


source /edge/vmware/clone_vm_template/setenv.sh

Expand Down
3 changes: 3 additions & 0 deletions edge/vmware/clone_vm_template/deploy-edge-host.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0


source ./setenv.sh

Expand Down
3 changes: 3 additions & 0 deletions edge/vmware/clone_vm_template/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

# Number of VMs to provision
export NO_OF_VMS=3
export VM_PREFIX="demo"
Expand Down
3 changes: 3 additions & 0 deletions edge/vmware/packer/build.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

packer {
required_plugins {
vsphere = {
Expand Down
3 changes: 3 additions & 0 deletions edge/vmware/packer/vsphere.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

# Virtual Machine Settings
########### DO NOT EDIT #################
# VM Template Name
Expand Down
3 changes: 3 additions & 0 deletions packs/hello-universe-pack/manifests/hello-universe.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: Service
metadata:
Expand Down
3 changes: 3 additions & 0 deletions packs/hello-universe-pack/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

pack:
# The namespace (on the target cluster) in which the pack will be deployed.
# When the namespace is not found, a new namespace will be created with the name specified.
Expand Down
3 changes: 3 additions & 0 deletions static/defaults/ngrok.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

# This token is intended for learning purposes, generated from https://ngrok.com/
version: "2"
authtoken: 2PWATzqpNw94GiZ9E2Ghheh2Mal_4gYsxK4DBRVEVLEdcee8m
3 changes: 3 additions & 0 deletions static/defaults/registry-config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

version: 0.1
log:
level: debug
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/application-profiles.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

##########################################
# Scenario 1: Single Application
##########################################
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/application.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

##########################################
# Scenario 1: Single Application
##########################################
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/data.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

data "spectrocloud_cluster_group" "beehive" {
name = var.cluster-group-name
context = "system"
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/inputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

variable "cluster-group-name" {
type = string
default = "beehive"
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

# output "beehive-cluster-id" {
# value = data.spectrocloud_cluster_group.beehive.id
# }
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

terraform {
required_providers {
spectrocloud = {
Expand Down
3 changes: 3 additions & 0 deletions terraform/hello-universe-tf/virutal-clusters.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

##########################################
# Scenario 1: Single Application
# ##########################################
Expand Down
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
3 changes: 3 additions & 0 deletions terraform/iaas-cluster-deployment-tf/cluster_profiles.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

#########################
# AWS Cluster Profile
#########################
Expand Down
37 changes: 20 additions & 17 deletions terraform/iaas-cluster-deployment-tf/clusters.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

#########################
# AWS Cluster Profile
########################
Expand All @@ -20,11 +23,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 +67,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 +114,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 +133,4 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster" {
create = "30m"
delete = "15m"
}
}
}
3 changes: 3 additions & 0 deletions terraform/iaas-cluster-deployment-tf/data.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

####################################
# Data resources for the profile
####################################
Expand Down
Loading

0 comments on commit 0557096

Please sign in to comment.