Skip to content

Commit

Permalink
docs: update cluster update tutorial tags and versions DOC-920
Browse files Browse the repository at this point in the history
  • Loading branch information
addetz committed Dec 19, 2023
1 parent a9e2f74 commit bd3bbdc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
18 changes: 9 additions & 9 deletions terraform/iaas-cluster-update-tf/clusters.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster" {
count = var.deploy-aws ? 1 : 0

name = "aws-cluster"
tags = concat(var.tags, ["env:aws", "service:frontend"])
tags = concat(var.tags, ["env:aws", "service:hello-universe-frontend"])
cloud_account_id = data.spectrocloud_cloudaccount_aws.account[0].id

cloud_config {
Expand Down Expand Up @@ -46,7 +46,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster-api" {
count = var.deploy-aws ? 1 : 0

name = "aws-cluster-api"
tags = concat(var.tags, ["env:aws", "service:backend"])
tags = concat(var.tags, ["env:aws", "service:hello-universe-backend"])
cloud_account_id = data.spectrocloud_cloudaccount_aws.account[0].id

cloud_config {
Expand Down Expand Up @@ -85,7 +85,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster-api" {
resource "local_file" "aws-kubeconfig" {
count = var.deploy-aws ? 1 : 0

content = data.spectrocloud_cluster.aws_cluster_api.kube_config
content = data.spectrocloud_cluster.aws_cluster_api[0].kube_config
filename = "aws-cluster-api.kubeconfig"
file_permission = "0644"
directory_permission = "0755"
Expand All @@ -98,7 +98,7 @@ resource "spectrocloud_cluster_azure" "azure-cluster" {
count = var.deploy-azure ? 1 : 0

name = "azure-cluster"
tags = concat(var.tags, ["env:azure", "service:frontend"])
tags = concat(var.tags, ["env:azure", "service:hello-universe-frontend"])
cloud_account_id = data.spectrocloud_cloudaccount_azure.account[0].id

cloud_config {
Expand Down Expand Up @@ -145,7 +145,7 @@ resource "spectrocloud_cluster_azure" "azure-cluster-api" {
count = var.deploy-azure ? 1 : 0

name = "azure-cluster-api"
tags = concat(var.tags, ["env:azure", "service:backend"])
tags = concat(var.tags, ["env:azure", "service:hello-universe-backend"])
cloud_account_id = data.spectrocloud_cloudaccount_azure.account[0].id

cloud_config {
Expand Down Expand Up @@ -190,7 +190,7 @@ resource "spectrocloud_cluster_azure" "azure-cluster-api" {
resource "local_file" "azure-kubeconfig" {
count = var.deploy-azure ? 1 : 0

content = data.spectrocloud_cluster.azure_cluster_api.kube_config
content = data.spectrocloud_cluster.azure_cluster_api[0].kube_config
filename = "azure-cluster-api.kubeconfig"
file_permission = "0644"
directory_permission = "0755"
Expand All @@ -203,7 +203,7 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster" {
count = var.deploy-gcp ? 1 : 0

name = "gcp-cluster"
tags = concat(var.tags, ["env:gcp", "service:frontend"])
tags = concat(var.tags, ["env:gcp", "service:hello-universe-frontend"])
cloud_account_id = data.spectrocloud_cloudaccount_gcp.account[0].id

cloud_config {
Expand Down Expand Up @@ -244,7 +244,7 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster-api" {
count = var.deploy-gcp ? 1 : 0

name = "gcp-cluster-api"
tags = concat(var.tags, ["env:gcp", "service:backend"])
tags = concat(var.tags, ["env:gcp", "service:hello-universe-backend"])
cloud_account_id = data.spectrocloud_cloudaccount_gcp.account[0].id

cloud_config {
Expand Down Expand Up @@ -283,7 +283,7 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster-api" {
resource "local_file" "gcp-kubeconfig" {
count = var.deploy-gcp ? 1 : 0

content = data.spectrocloud_cluster.gcp_cluster_api.kube_config
content = data.spectrocloud_cluster.gcp_cluster_api[0].kube_config
filename = "gcp-cluster-api.kubeconfig"
file_permission = "0644"
directory_permission = "0755"
Expand Down
6 changes: 6 additions & 0 deletions terraform/iaas-cluster-update-tf/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ data "spectrocloud_pack" "aws_ubuntu" {
}

data "spectrocloud_cluster" "aws_cluster_api" {
count = var.deploy-aws ? 1 : 0

name = "aws-cluster-api"
context = "project"

Expand Down Expand Up @@ -77,6 +79,8 @@ data "spectrocloud_pack" "azure_ubuntu" {
}

data "spectrocloud_cluster" "azure_cluster_api" {
count = var.deploy-azure ? 1 : 0

name = "azure-cluster-api"
context = "project"

Expand Down Expand Up @@ -116,6 +120,8 @@ data "spectrocloud_pack" "gcp_ubuntu" {
}

data "spectrocloud_cluster" "gcp_cluster_api" {
count = var.deploy-gcp ? 1 : 0

name = "gcp-cluster-api"
context = "project"

Expand Down
2 changes: 1 addition & 1 deletion terraform/iaas-cluster-update-tf/provider.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
spectrocloud = {
version = ">= 0.16.1"
version = "0.17.1-pre" #TODO change at release
source = "spectrocloud/spectrocloud"
}
tls = {
Expand Down

0 comments on commit bd3bbdc

Please sign in to comment.