Skip to content

Commit 5ac406a

Browse files
authored
feat: add cluster update tutorial DOC-920 (#28)
This PR makes the following changes: - Updates cluster pack versions - Adds support for Azure regions without AZs - Create the cluster update tutorial - Adds `podman` to the tutorial container docs: change azure worker node azs docs: add api uri to frontend docs: update README and cluster profile docs: update README docs: add README todo docs: update docker.md docs: rollback podman docs: update installation of terraform docs: update terraform install docs: add version arg to terraform install Apply suggestions from code review Co-authored-by: Karl Cardenas <[email protected]> docs: updates to inputs docs: update README for aws region docs: update docker image tag docs: provide version args docs: update cluster update tutorial tags and versions DOC-920 docs: bump up hello-universe tag in manifests DOC-921 docs: link cluster update tutorial in the readme DOC-921 docs:update aws output and terraform vars DOC-920 docs:update provider version
1 parent 53bfb7a commit 5ac406a

File tree

26 files changed

+1629
-57
lines changed

26 files changed

+1629
-57
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ env:
99
PALETTE_VERSION: 4.0.2
1010
PALETTE_CLI_VERSION: 4.0.1
1111
PALETTE_EDGE_VERSION: 3.4.3
12-
12+
PACKER_VERSION: 1.9.4
13+
ORAS_VERSION: 1.0.0
14+
TERRAFORM_VERSION: 1.6.5
1315

1416

1517
jobs:
@@ -66,6 +68,9 @@ jobs:
6668
PALETTE_VERSION=${{env.PALETTE_VERSION}}
6769
PALETTE_CLI_VERSION=${{env.PALETTE_CLI_VERSION}}
6870
PALETTE_EDGE_VERSION=${{env.PALETTE_EDGE_VERSION}}
71+
PACKER_VERSION=${{env.PACKER_VERSION}}
72+
ORAS_VERSION=${{env.ORAS_VERSION}}
73+
TERRAFORM_VERSION=${{env.TERRAFORM_VERSION}}
6974
platforms: linux/amd64,linux/arm64
7075
push: true
7176
tags: ghcr.io/${{ github.repository }}:${{steps.dependencies.outputs.VERSION}}

.github/workflows/test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ env:
99
PALETTE_VERSION: 4.0.2
1010
PALETTE_CLI_VERSION: 4.0.1
1111
PALETTE_EDGE_VERSION: 3.4.3
12+
PACKER_VERSION: 1.9.4
13+
ORAS_VERSION: 1.0.0
14+
TERRAFORM_VERSION: 1.6.5
1215

1316
concurrency:
1417
group: docker-${{ github.ref }}
@@ -73,5 +76,8 @@ jobs:
7376
PALETTE_VERSION=${{env.PALETTE_VERSION}}
7477
PALETTE_CLI_VERSION=${{env.PALETTE_CLI_VERSION}}
7578
PALETTE_EDGE_VERSION=${{env.PALETTE_EDGE_VERSION}}
76-
79+
PACKER_VERSION=${{env.PACKER_VERSION}}
80+
ORAS_VERSION=${{env.ORAS_VERSION}}
81+
TERRAFORM_VERSION=${{env.TERRAFORM_VERSION}}
82+
7783

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ override.tf.json
3737
my.*.tfvars
3838
.terraform.lock.hcl
3939
*.env
40-
40+
*.kubeconfig
4141

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ ADD static/defaults/registry-config.yml etc/spectro/config.yml
1717

1818
ARG PALETTE_CLI_VERSION
1919
ARG PALETTE_EDGE_VERSION
20-
ARG PACKER_VERSION=1.9.4
21-
ARG ORAS_VERSION=1.0.0
20+
ARG PACKER_VERSION
21+
ARG ORAS_VERSION
22+
ARG TERRAFORM_VERSION
2223

2324
ENV REGISTRY_LOG_LEVEL=info
2425
ENV REGISTRY_AUTH=htpasswd
@@ -30,7 +31,7 @@ COPY --from=server /etc/spectro/config.yml /etc/spectro/config.yml
3031

3132
RUN adduser -H -u 1002 -D appuser appuser && \
3233
apk update && \
33-
apk add --no-cache bash curl git terraform openssl jq bind-tools wget ca-certificates nano aws-cli xorriso govc
34+
apk add --no-cache bash curl git openssl jq bind-tools wget ca-certificates nano aws-cli xorriso govc podman
3435

3536
RUN wget https://software.spectrocloud.com/spectro-registry/cli/v$PALETTE_CLI_VERSION/linux/spectro && \
3637
mv spectro /usr/local/bin/spectro && \
@@ -57,7 +58,10 @@ RUN wget https://software.spectrocloud.com/spectro-registry/cli/v$PALETTE_CLI_V
5758
mv oras-install/oras /usr/local/bin/ && \
5859
rm -rf oras_${ORAS_VERSION}_*.tar.gz oras-install/ && \
5960
git clone https://github.com/spectrocloud/CanvOS.git && \
60-
rm -rf /var/cache/apk/*
61+
rm -rf /var/cache/apk/* && \
62+
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
63+
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin && \
64+
rm -rf terraform_${TERRAFORM_VERSION}_linux_amd64.zip
6165

6266
ADD https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip /usr/local/sbin/
6367
RUN unzip /usr/local/sbin/packer_${PACKER_VERSION}_linux_amd64.zip -d /usr/local/sbin && \

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ help: ## Display this help
1111

1212
build-docker: ## Build docker image
1313
@echo "Building docker image"
14-
docker build --build-arg PALETTE_VERSION=$(VERSION) --build-arg PALETTE_CLI_VERSION=$(VERSION) --build-arg PALETTE_EDGE_VERSION=$(EDGE) --build-arg PACKER_VERSION=1.8.7 -t tutorials .
14+
docker build --build-arg PALETTE_VERSION=$(PALETTE_VERSION) \
15+
--build-arg PALETTE_CLI_VERSION=$(PALETTE_CLI_VERION) \
16+
--build-arg PALETTE_EDGE_VERSION=$(PALETTE_EDGE_VERSION) \
17+
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
18+
--build-arg ORAS_VERSION=$(PACKER_VERSION) \
19+
--build-arg TERRAFORM_VERSION=$(TERRAFORM_VERSION) \
20+
-t tutorials .

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ The following tutorial code is available:
1515

1616
- [terraform-cluster-deployment-tf](./terraform/iaas-cluster-deployment-tf/README.md) - Learn how to deploy a cluster to a cloud provider with Palette. [Link](https://docs.spectrocloud.com/clusters/public-cloud/deploy-k8s-cluster)
1717

18+
- [terraform-cluster-update-tf](./terraform/iaas-cluster-update-tf/README.md) - Learn how to update a cluster deployed to a cloud provider with Palette. [Link](https://docs.spectrocloud.com/clusters/cluster-management/update-k8s-cluster)
19+
1820
- [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)
1921

2022
## Docker

docs/docker.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
To download the image issue the following commnad. Change the version tag as needed.
44

55
```shell
6-
docker pull ghcr.io/spectrocloud/tutorials:1.0.2
6+
docker pull ghcr.io/spectrocloud/tutorials:1.0.12
77
```
88

99
You can start the container using the following command.
1010

1111
```shell
12-
docker run -p 5000:5000 --rm -it ghcr.io/spectrocloud/tutorials:1.0.2 bash
12+
docker run -p 5000:5000 --rm -it ghcr.io/spectrocloud/tutorials:1.0.12 bash
1313
```
1414

1515

@@ -42,6 +42,7 @@ The Docker image includes the following tools.
4242
| `GOVC` | Tool for interracting with VMware Vsphere via API |
4343
| `aws-cli` | AWS command-line interface |
4444
| `oras` | Tool for pushing and pulling OCI artifacts to and from OCI registries|
45+
| `podman` | Tool for building and deploying OCI images |
4546

4647
### Spectro Cloud Pack Registry Server
4748

@@ -61,9 +62,9 @@ registry serve /etc/spectro/config.yml > /var/log/registry.log 2>&1 &
6162

6263
# Local Builds
6364

64-
If you are wanting to build the docker image locally you must provide the the build arguments for `PALETTE_VERSION` and `PALETTE_CLI_VERSION`, `PALETTE_EDGE_VERSION`. Use the following command to build a local image. Replace the versions as needed.
65+
If you are wanting to build the docker image locally you must provide the the build arguments for `PALETTE_VERSION`, `PALETTE_CLI_VERSION`, `PALETTE_EDGE_VERSION`, `PACKER_VERSION`, `ORAS_VERSION` and `TERRAFORM_VERSION`. Use the following command to build a local image. Replace the versions as needed.
6566

6667

6768
```shell
68-
docker build --build-arg PALETTE_VERSION=4.0.2 --build-arg PALETTE_CLI_VERSION=4.0.1 --build-arg PALETTE_EDGE_VERSION=3.4.3 --build-arg PACKER_VERSION=1.9.4 -t tutorials .
69+
docker build --build-arg PALETTE_VERSION=4.0.2 --build-arg PALETTE_CLI_VERSION=4.0.1 --build-arg PALETTE_EDGE_VERSION=3.4.3 --build-arg PACKER_VERSION=1.9.4 --build-arg ORAS_VERSION=1.0.0 --build-arg TERRAFORM_VERSION=1.6.5 -t tutorials .
6970
```

terraform/iaas-cluster-deployment-tf/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To get started, open up the file **terraform.tfvars**. Toggle the provider varia
2727

2828
| Name | Version |
2929
|------|---------|
30-
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.13.1 |
30+
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.16.1 |
3131
| <a name="provider_tls"></a> [tls](#provider\_tls) | 4.0.4 |
3232

3333
## Modules
@@ -39,7 +39,7 @@ No modules.
3939
| Name | Type |
4040
|------|------|
4141
| [spectrocloud_cluster_aws.aws-cluster](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_aws) | resource |
42-
| [spectrocloud_cluster_azure.cluster](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_azure) | resource |
42+
| [spectrocloud_cluster_azure.azure-cluster](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_azure) | resource |
4343
| [spectrocloud_cluster_gcp.gcp-cluster](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_gcp) | resource |
4444
| [spectrocloud_cluster_profile.aws-profile](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_profile) | resource |
4545
| [spectrocloud_cluster_profile.azure-profile](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_profile) | resource |
@@ -68,11 +68,12 @@ No modules.
6868
|------|-------------|------|---------|:--------:|
6969
| <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 |
7070
| <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 |
71-
| <a name="input_aws-region"></a> [aws-region](#input\_aws-region) | AWS region | `string` | n/a | yes |
71+
| <a name="input_aws-region"></a> [aws-region](#input\_aws-region) | AWS region | `string` | `"us-east-1"` | yes |
7272
| <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 |
7373
| <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 |
7474
| <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 |
7575
| <a name="input_azure-region"></a> [azure-region](#input\_azure-region) | Azure region | `string` | `"eastus"` | no |
76+
| <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 |
7677
| <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 |
7778
| <a name="input_azure_resource_group"></a> [azure\_resource\_group](#input\_azure\_resource\_group) | Azure resource group | `string` | `""` | no |
7879
| <a name="input_azure_subscription_id"></a> [azure\_subscription\_id](#input\_azure\_subscription\_id) | Azure subscription ID | `string` | `""` | no |

terraform/iaas-cluster-deployment-tf/clusters.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster" {
4343
#########################
4444
# Azure Cluster Profile
4545
#########################
46-
resource "spectrocloud_cluster_azure" "cluster" {
46+
resource "spectrocloud_cluster_azure" "azure-cluster" {
4747
count = var.deploy-azure ? 1 : 0
4848

4949
name = "azure-cluster"

terraform/iaas-cluster-deployment-tf/data.tf

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
####################################
2+
# Data resources for the profile
3+
####################################
4+
data "spectrocloud_registry" "public_registry" {
5+
name = "Public Repo"
6+
}
7+
18
#############
29
# AWS
310
#############
@@ -7,20 +14,27 @@ data "spectrocloud_cloudaccount_aws" "account" {
714
}
815

916
data "spectrocloud_pack" "aws_csi" {
10-
name = "csi-aws-ebs"
11-
version = "1.16.0"
17+
name = "csi-aws-ebs"
18+
version = "1.22.0"
19+
registry_uid = data.spectrocloud_registry.public_registry.id
1220
}
21+
1322
data "spectrocloud_pack" "aws_cni" {
14-
name = "cni-calico"
15-
version = "3.24.5"
23+
name = "cni-calico"
24+
version = "3.26.1"
25+
registry_uid = data.spectrocloud_registry.public_registry.id
1626
}
27+
1728
data "spectrocloud_pack" "aws_k8s" {
18-
name = "kubernetes"
19-
version = "1.24.10"
29+
name = "kubernetes"
30+
version = "1.27.5"
31+
registry_uid = data.spectrocloud_registry.public_registry.id
2032
}
33+
2134
data "spectrocloud_pack" "aws_ubuntu" {
22-
name = "ubuntu-aws"
23-
version = "20.04"
35+
name = "ubuntu-aws"
36+
version = "22.04"
37+
registry_uid = data.spectrocloud_registry.public_registry.id
2438
}
2539

2640
#############
@@ -32,21 +46,29 @@ data "spectrocloud_cloudaccount_azure" "account" {
3246
}
3347

3448
data "spectrocloud_pack" "azure_csi" {
35-
name = "csi-azure"
36-
version = "1.25.0"
49+
name = "csi-azure"
50+
version = "1.28.3"
51+
registry_uid = data.spectrocloud_registry.public_registry.id
3752
}
53+
3854
data "spectrocloud_pack" "azure_cni" {
39-
name = "cni-calico-azure"
40-
version = "3.24.5"
55+
name = "cni-calico-azure"
56+
version = "3.26.1"
57+
registry_uid = data.spectrocloud_registry.public_registry.id
4158
}
59+
4260
data "spectrocloud_pack" "azure_k8s" {
43-
name = "kubernetes"
44-
version = "1.24.10"
61+
name = "kubernetes"
62+
version = "1.27.5"
63+
registry_uid = data.spectrocloud_registry.public_registry.id
4564
}
65+
4666
data "spectrocloud_pack" "azure_ubuntu" {
47-
name = "ubuntu-azure"
48-
version = "20.04"
67+
name = "ubuntu-azure"
68+
version = "22.04"
69+
registry_uid = data.spectrocloud_registry.public_registry.id
4970
}
71+
5072
#############
5173
# GCP
5274
#############
@@ -56,26 +78,25 @@ data "spectrocloud_cloudaccount_gcp" "account" {
5678
}
5779

5880
data "spectrocloud_pack" "gcp_csi" {
59-
name = "csi-gcp-driver"
60-
version = "1.7.1"
81+
name = "csi-gcp-driver"
82+
version = "1.8.2"
83+
registry_uid = data.spectrocloud_registry.public_registry.id
6184
}
85+
6286
data "spectrocloud_pack" "gcp_cni" {
63-
name = "cni-calico"
64-
version = "3.24.5"
87+
name = "cni-calico"
88+
version = "3.26.1"
89+
registry_uid = data.spectrocloud_registry.public_registry.id
6590
}
91+
6692
data "spectrocloud_pack" "gcp_k8s" {
67-
name = "kubernetes"
68-
version = "1.24.10"
93+
name = "kubernetes"
94+
version = "1.27.5"
95+
registry_uid = data.spectrocloud_registry.public_registry.id
6996
}
97+
7098
data "spectrocloud_pack" "gcp_ubuntu" {
71-
name = "ubuntu-gcp"
72-
version = "20.04"
99+
name = "ubuntu-gcp"
100+
version = "22.04"
101+
registry_uid = data.spectrocloud_registry.public_registry.id
73102
}
74-
#############
75-
# Universal
76-
#############
77-
78-
data "spectrocloud_pack" "proxy" {
79-
name = "spectro-proxy"
80-
version = "1.3.0"
81-
}

0 commit comments

Comments
 (0)