The provisioning, configuration, and preparation needed for delivering the Cisco Full Stack Observability (FSO) series of workshops can be an extremely tedious and time-consuming challenge for SE's. To solve that problem, the FSO Lab DevOps project delivers a set of artifacts to automate the build, deployment, and configuration portion of these pre-workshop activities using open source tooling.
Although there are many tools available to accomplish the project's automation goals, it was decided to standardize on Packer, Terraform, and Terraform Cloud from HashiCorp. This is primarily due to their capability for building and deploying software platforms to multi-cloud environments, as well as having a high level of adoption within the developer community.
Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant. A machine image (or immutable VM image) is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines.
As part of this project, Packer is used to create an immutable Lab VM image consisting of a standardized installation of Amazon Linux 2 with a set of common software. This static image is later used by Terraform when standing-up the infrastructure and compute resources needed by workshop participants. Currently, this VM consists of the following type:
- LPAD VM: A 'Launchpad' Lab VM with pre-configured tooling for Kubernetes and AWS CLI Operations.
For SE-lead workshops, the Lab VM image is built and maintained by Cisco/AppDynamics. However, all of the artifacts used to build the image are present in this project, so customers are free to customize and build their own VM images if desired.
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. The infrastructure Terraform can manage includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc.
In this project, Terraform is used to automate the deployment of the Lab infrastructure, including VPCs, subnets, security groups, load balancers, Kubdernetes clusters, and Lab VM using templates.
Terraform Cloud is HashiCorp’s managed service offering for Terraform. It eliminates the need for unnecessary tooling and documentation for practitioners, teams, and organizations to use Terraform in production.
To configure the FSO Lab workshop environments, the first step is to set-up your development environment by installing the needed software.
You install Packer and Terraform on a control node, usually your local laptop, which then uses the cloud CLI and/or SSH to communicate with your cloud resources and managed nodes.
NOTE: A remote Virtual Machine with access to the internet can also be used as the control node. The specific instructions for installing the required software are left as an exercise for the reader.
For macOS environments, the following open source software needs to be installed on the host macOS machine:
- Homebrew 4.2.12
- Git 2.44.0
- Packer 1.10.2
- Terraform 1.7.4
- jq 1.7.1
Perform the following steps to install the needed software:
-
Install the Homebrew 4.2.12 package manager for macOS 64-bit. Paste the following into a macOS Terminal prompt:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
-
Install Git 2.44.0 for macOS 64-bit.
brew install git
-
Install Packer 1.10.2 for macOS 64-bit.
brew tap hashicorp/tap brew install hashicorp/tap/packer
-
Install Terraform 1.7.4 for macOS 64-bit.
brew tap hashicorp/tap brew install hashicorp/tap/terraform
-
Install jq 1.7.1 for macOS 64-bit.
brew install jq
-
Validate installed command-line tools:
brew --version # Homebrew 4.2.12 brew doctor # Your system is ready to brew. git --version # git version 2.44.0 packer --version # 1.10.2 terraform --version # Terraform v1.7.4 jq --version # jq-1.7.1
-
Configure Git for local user:
git config --global user.name "<first_name> <last_name>" git config --global user.email "<your_email>" git config --global --list
Windows users have a wide variety of choice in terminals and shells for running the command-line tools, such as the Windows Command Prompt, PowerShell, Windows Terminal, Git Bash, and the Windows Subsystem for Linux (WSL).
Although you are free to use any of these tools, the installation steps described below will be based on the usage of the Git Bash terminal or the Windows Subsystem for Linux (WSL) with an Ubuntu installation.
Here is a list of the recommended open source software to be installed on the host Windows machine:
- Curl 7.68.0 (Ubuntu 64-bit only)
- Wget 1.21.2 (Ubuntu 64-bit only)
- Git 2.44.0
- Packer 1.10.2
- Terraform 1.7.4
- jq 1.7.1
Perform the following steps to install the needed software:
-
Install Git 2.44.0 for Windows 64-bit.
-
Install Packer 1.10.2 for Windows 64-bit.
Create suggested install folder and extract contents of ZIP file to:
C:\HashiCorp\bin
-
Install Terraform 1.7.4 for Windows 64-bit.
Create suggested install folder and extract contents of ZIP file to:
C:\HashiCorp\bin
-
Install jq 1.7.1 for Windows 64-bit.
Create suggested install folder and rename binary to:
C:\Program Files\Git\usr\local\bin\jq.exe
-
Set Windows Environment
PATH
to:PATH=C:\HashiCorp\bin;C:\Program Files\Git\usr\local\bin;%PATH%
-
Reboot Windows.
-
Launch Git Bash.
Start Menu -- > All apps -- > Git -- > Git Bash -
Validate installed command-line tools:
git --version # git version 2.44.0.windows.1 packer --version # 1.10.2 terraform --version # Terraform v1.7.4 jq --version # jq-1.7.1
-
Configure Git for local user:
git config --global user.name "<first_name> <last_name>" git config --global user.email "<your_email>" git config --global --list
-
Install Curl 7.68.0 for Ubuntu 64-bit.
sudo apt install curl
-
Install Wget 1.21.2 for Ubuntu 64-bit.
sudo apt install wget
-
Install Git 2.44.0 for Ubuntu 64-bit.
sudo apt install git
-
Install Packer 1.10.2 for Ubuntu 64-bit.
cd /usr/local/bin sudo wget https://releases.hashicorp.com/packer/1.10.2/packer_1.10.2_linux_amd64.zip sudo unzip packer_1.10.2_linux_amd64.zip sudo rm -i packer_1.10.2_linux_amd64.zip
-
Install Terraform 1.7.4 for Ubuntu 64-bit.
cd /usr/local/bin sudo wget https://releases.hashicorp.com/terraform/1.7.4/terraform_1.7.4_linux_amd64.zip sudo unzip terraform_1.7.4_linux_amd64.zip sudo rm -i terraform_1.7.4_linux_amd64.zip
-
Install jq 1.7.1 for macOS 64-bit.
sudo apt install jq
-
Validate installed command-line tools:
git --version # git version 2.44.0 packer --version # 1.10.2 terraform --version # Terraform v1.7.4 jq --version # jq-1.7.1
-
Configure Git for local user:
git config --global user.name "<first_name> <last_name>" git config --global user.email "<your_email>" git config --global --list
-
Create a folder for your FSO Lab DevOps project or use your home directory:
cd ~
-
Get the code from GitHub:
git clone https://github.com/APO-SRE/fso-lab-devops.git cd fso-lab-devops
The FSO Lab DevOps project currently supports a VM image build for Amazon AWS. Click on the link below for platform-specific instructions and a Bill-of-Materials:
- AWS Build and Deploy: Instructions