Skip to content

Commit 77882b1

Browse files
authored
fix: add terraform files for the getting started tutorial (#39)
* docs: add tf files for the getting started tutorial * fix: address review suggestions * docs: fix azure azs issue * fix: add k9s to the container image, review grammar of docker.md * fix: add terraform tests * fix: addressed review suggestions * fix: update spectro provider version, cluster profile logic, and broken tag * fix: metallb pack type * docs: fix merge conflicts in dockerfile * docs: update pack and images version
1 parent d06502e commit 77882b1

33 files changed

+2494
-9
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
ORAS_VERSION: 1.0.0
1414
TERRAFORM_VERSION: 1.9.0
1515
PALETTE_REGISTRY_CLI_VERSION: 4.3.0
16+
K9S_VERSION: 0.32.5
1617

1718
jobs:
1819
docker:
@@ -68,6 +69,7 @@ jobs:
6869
ORAS_VERSION=${{env.ORAS_VERSION}}
6970
TERRAFORM_VERSION=${{env.TERRAFORM_VERSION}}
7071
PALETTE_REGISTRY_CLI_VERSION=${{env.PALETTE_REGISTRY_CLI_VERSION}}
72+
K9S_VERSION=${{env.K9S_VERSION}}
7173
platforms: linux/amd64,linux/arm64
7274
push: true
7375
tags: ghcr.io/${{ github.repository }}:${{steps.dependencies.outputs.VERSION}}

.github/workflows/test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
ORAS_VERSION: 1.0.0
1414
TERRAFORM_VERSION: 1.9.0
1515
PALETTE_REGISTRY_CLI_VERSION: 4.3.0
16+
K9S_VERSION: 0.32.5
1617

1718
concurrency:
1819
group: docker-${{ github.ref }}
@@ -77,3 +78,4 @@ jobs:
7778
ORAS_VERSION=${{env.ORAS_VERSION}}
7879
TERRAFORM_VERSION=${{env.TERRAFORM_VERSION}}
7980
PALETTE_REGISTRY_CLI_VERSION=${{env.PALETTE_REGISTRY_CLI_VERSION}}
81+
K9S_VERSION=${{env.K9S_VERSION}}

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ARG PALETTE_REGISTRY_CLI_VERSION
2424
ARG PACKER_VERSION
2525
ARG ORAS_VERSION
2626
ARG TERRAFORM_VERSION
27+
ARG K9S_VERSION
2728

2829
ENV REGISTRY_LOG_LEVEL=info
2930
ENV REGISTRY_AUTH=htpasswd
@@ -64,16 +65,18 @@ RUN wget https://spectro-cli.s3.amazonaws.com/v$PALETTE_REGISTRY_CLI_VERSION/li
6465
rm -rf oras_${ORAS_VERSION}_*.tar.gz oras-install/ && \
6566
git clone https://github.com/spectrocloud/CanvOS.git && \
6667
rm -rf /var/cache/apk/* && \
68+
wget https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_amd64.tar.gz -O - | tar -xz -C /usr/local/bin && \
69+
rm -rf k9s_Linux_amd64.tar && \
6770
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
6871
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin && \
6972
rm -rf terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
70-
mkdir -p /var/log/ && chmod 777 /var/log/
73+
mkdir -p /var/log/ && chmod 777 /var/log/
7174

7275
ADD https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip /usr/local/sbin/
7376
RUN unzip /usr/local/sbin/packer_${PACKER_VERSION}_linux_amd64.zip -d /usr/local/sbin && \
7477
rm -rf /usr/local/sbin/packer_${PACKER_VERSION}_linux_amd64.zip && \
75-
mkdir -p /home/appuser/.config/packer && mkdir /root/.spectro && \
76-
chown -R appuser:appuser /home/appuser/.config/packer terraform/ packs/ edge/ CanvOS/ /var/log/ /root/.spectro/ /etc/spectro/
78+
mkdir -p /home/appuser/.config/packer && mkdir /root/.spectro && mkdir -p /home/appuser/.config/k9s && mkdir -p /home/appuser/etc/xdg/k9s && \
79+
chown -R appuser:appuser /home/appuser/.config/packer terraform/ packs/ edge/ CanvOS/ /var/log/ /root/.spectro/ /etc/spectro/ /home/appuser/.config/k9s /home/appuser/etc/xdg/k9s
7780
EXPOSE 5000
7881

7982
USER appuser

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ build-docker: ## Build docker image
1717
--build-arg PALETTE_CLI_VERSION=$(PALETTE_CLI_VERION) \
1818
--build-arg PALETTE_EDGE_VERSION=$(PALETTE_EDGE_VERSION) \
1919
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
20-
--build-arg ORAS_VERSION=$(PACKER_VERSION) \
20+
--build-arg ORAS_VERSION=$(ORAS_VERSION) \
2121
--build-arg TERRAFORM_VERSION=$(TERRAFORM_VERSION) \
22+
--build-arg K9S_VERSION=$(K9S_VERSION) \
2223
-t tutorials .
2324

2425

README.md

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

2323
- [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)
2424

25+
- [getting-started-deployment-tf](./terraform/getting-started-deployment-tf/README.md) - Learn how to deploy and update a cluster to AWS, Azure, GCP, and VMware vSphere with Palette. [Link](https://docs.spectrocloud.com/getting-started/terraform)
26+
2527
## Docker
2628

2729
All the tutorials are available in a Docker image that you can use to get started with the tutorials.

docs/docker.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Docker
22

3-
To download the image issue the following commnad. Change the version tag as needed.
3+
To download the image, issue the following command. Change the version tag as needed.
44

55
```shell
66
docker pull ghcr.io/spectrocloud/tutorials:1.0.12
@@ -12,7 +12,7 @@ You can start the container using the following command.
1212
docker run -p 5000:5000 --rm -it ghcr.io/spectrocloud/tutorials:1.0.12 bash
1313
```
1414

15-
> The Docker file is build for a Linux environment. You can use this on a Mac and Windows. Windows users will require the usage of WSL2.
15+
> The Docker file builds a Linux environment. You can use this image on a Mac and Windows. Windows users will require the usage of [WSL2](https://learn.microsoft.com/en-us/windows/wsl/about).
1616
1717
The Docker image includes the following tools.
1818

@@ -41,6 +41,7 @@ The Docker image includes the following tools.
4141
| `aws-cli` | AWS command-line interface |
4242
| `oras` | Tool for pushing and pulling OCI artifacts to and from OCI registries |
4343
| `podman` | Tool for building and deploying OCI images |
44+
| `k9s` | Tool that provides a terminal UI to interact with your Kubernetes clusters |
4445

4546
### Spectro Cloud Pack Registry Server
4647

@@ -50,7 +51,7 @@ The Spectro Cloud registry server has the following credentials:
5051

5152
- `password`: `admin`
5253

53-
You can start the registry server by issuing the following command.
54+
You can start the registry server by issuing the command below.
5455
Keep in mind that the registry server is started in HTTP mode. For additional guidance, review the [Registry Server documentation](https://docs.spectrocloud.com/registries-and-packs/adding-a-custom-registry).
5556

5657
```shell
@@ -59,8 +60,8 @@ registry serve /etc/spectro/config.yml > /var/log/registry.log 2>&1 &
5960

6061
# Local Builds
6162

62-
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.
63+
If you want to build the docker image locally, you must provide the build arguments for `PALETTE_VERSION`, `PALETTE_CLI_VERSION`, `PALETTE_EDGE_VERSION`, `PACKER_VERSION`, `ORAS_VERSION`, `TERRAFORM_VERSION`, and `K9S_VERSION`. Use the following command to build a local image and replace the versions as needed.
6364

6465
```shell
65-
docker build --build-arg PALETTE_VERSION=4.0.2 --build-arg PALETTE_CLI_VERSION=4.4.0 --build-arg PALETTE_EDGE_VERSION=4.4.2 --build-arg PACKER_VERSION=1.11.0 --build-arg ORAS_VERSION=1.0.0 --build-arg PALETTE_REGISTRY_CLI_VERSION=4.3.0 --build-arg TERRAFORM_VERSION=1.9.0 -t tutorials .
66+
docker build --build-arg PALETTE_VERSION=4.0.2 --build-arg PALETTE_CLI_VERSION=4.4.0 --build-arg PALETTE_EDGE_VERSION=4.4.2 --build-arg PACKER_VERSION=1.11.0 --build-arg ORAS_VERSION=1.0.0 --build-arg PALETTE_REGISTRY_CLI_VERSION=4.3.0 --build-arg TERRAFORM_VERSION=1.9.0 --build-arg K9S_VERSION=0.32.5 -t tutorials .
6667
```

0 commit comments

Comments
 (0)