Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
caroldelwing committed Feb 21, 2024
1 parent 4c1b572 commit 6b436a3
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 33 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

# Spectro Cloud Tutorials

A collection of Spectro Cloud tutorials and their respective sample code.

<p align="center">
<img src="/static/img/spectro-wizard.png" alt="drawing" width="500"/>
</p>


The following tutorial code is available:

- [hello-universe-tf](./terraform/hello-universe-tf/README.md) - Deploy the Hello Universe application into two Palette Virtual Clusters. [Link](https://docs.spectrocloud.com/devx/apps/deploy-app) to the tutorial.

- [pack-tf](./terraform/pack-tf/README.md) - Learn how to create a custom pack. [Link](https://docs.spectrocloud.com/registries-and-packs/deploy-pack)
Expand All @@ -19,9 +20,11 @@ The following tutorial code is available:

- [Deploy an Edge cluster on VMware](./edge/vmware/README.md) - Learn how to deploy an Edge cluster on VMware. [Link](https://docs.spectrocloud.com/clusters/edge/site-deployment/deploy-cluster)

- [vmware-cluster-deployment-tf](./terraform/vmware-cluster-deployment-tf/README.md) - Learn how to deploy a VMware cluster and the Hello Universe application as a part of the Deploy App Workloads with a PCG tutorial. [Link](https://docs.spectrocloud.com/clusters/pcg/deploy-app-pcg)

## Docker

All the tutorials are available in a Docker image that you can use to get started with the tutorials.
All the tutorials are available in a Docker image that you can use to get started with the tutorials.
Review the [Docker steps](./docs/docker.md) to get started with the Docker image.

## Image Verification
Expand Down
49 changes: 25 additions & 24 deletions terraform/vmware-cluster-deployment-tf/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion terraform/vmware-cluster-deployment-tf/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "spectrocloud_cluster_vsphere" "cluster" {
depends_on = [spectrocloud_cluster_profile.profile]

cloud_config {
ssh_key = var.ssh_key
ssh_key = local.ssh_public_key
datacenter = var.datacenter_name
folder = var.folder_name
static_ip = true
Expand Down
4 changes: 2 additions & 2 deletions terraform/vmware-cluster-deployment-tf/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ data "spectrocloud_pack" "csi" {
}

data "spectrocloud_pack" "metallb" {
name = "lb-metallb"
version = "0.13.7"
name = "lb-metallb-helm"
version = "0.13.11"
registry_uid = data.spectrocloud_registry.public_registry.id
}

Expand Down
4 changes: 2 additions & 2 deletions terraform/vmware-cluster-deployment-tf/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ variable "tags" {
description = "The default tags to apply to Palette resources"
# Value and key must be 63 characters or less, must start and end with an alphanumeric character, and can contain only alphanumeric characters, dots, dashes or underscores.
# Slashes `\` are not allowed.
default = ["spectro-cloud-education", "app:hello-universe", "terraform_managed:true"]
default = ["spectro-cloud-education", "app:hello-universe", "terraform_managed:true", "repository:spectrocloud:tutorials", "tutorial:DEPLOY_APP_WORKLOADS_WITH_A_PCG"]
}

#################################################
Expand All @@ -51,7 +51,7 @@ variable "tags" {
# The value should include the public key for accessing the cluster nodes.
variable "ssh_key" {
type = string
description = "Specify the public key that will be used to access the cluster nodes."
description = "Specify the public key that will be used to access the cluster nodes. If not provided, a new key pair will be generated. Press enter to generate a new key pair."
sensitive = true
}

Expand Down
4 changes: 2 additions & 2 deletions terraform/vmware-cluster-deployment-tf/profile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ resource "spectrocloud_cluster_profile" "profile" {
}

pack {
name = "lb-metallb"
name = "lb-metallb-helm"
tag = "0.13.x"
uid = data.spectrocloud_pack.metallb.id
values = format("%s - %s", data.spectrocloud_pack.metallb.values, var.metallb_ip)
values = replace(data.spectrocloud_pack.metallb.values, "192.168.10.0/24", var.metallb_ip)
}

############################
Expand Down
6 changes: 6 additions & 0 deletions terraform/vmware-cluster-deployment-tf/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ terraform {
version = ">= 0.16.1"
source = "spectrocloud/spectrocloud"
}

vsphere = {
source = "hashicorp/vsphere"
version = ">= 2.6.1"
}

tls = {
source = "hashicorp/tls"
version = "4.0.4"
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions terraform/vmware-cluster-deployment-tf/ssh-key.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

resource "tls_private_key" "tutorial_ssh_key" {
count = var.ssh_key == "" ? 1 : 0
algorithm = "RSA"
rsa_bits = "4096"
}

locals {
ssh_public_key = var.ssh_key != "" ? var.ssh_key : tls_private_key.tutorial_ssh_key[0].public_key_openssh
}

0 comments on commit 6b436a3

Please sign in to comment.