Software Defined Infrastructure

This is a documentation that contains instructions on how to setup Hetzner Cloud and solve all exercises completed in the Software Defined Infrastructure course with explanations by Johannes Rödel (jr125).

This documentation includes a detailed description of the exercises, workflows, and lessons learned, accessible through a browser-friendly GUI powered by MkDocs.

If you want to take a look at the source code checkout the

Git Repository

After Exercise 10 all exercises come with implementations for configuration files, scripts, and infrastructure-as-code artifacts.

The purpose of this repository is to provide a reproducible learning environment and an easily navigable documentation platform.

You should be able to successully execute every source code from exercise 10 - exercise 26 if you have the following requirements setup:

  1. Terraform is installed on your machine
  2. You have generated and stored a public and private key with the ED25519 algorithm to your ~/.ssh directory.
  3. You have registered a Hetzner Account. Hetzner Cloud Setup
  4. You added your own secrets.auto.tfvars and config.auto.tfvars containing the sensible data to connect to the cloud services in the root of the /src folder.
  5. All old servers are killed before running a new one.

The purpose of this repository is to provide a reproducible learning environment and an easily navigable documentation platform.

The MkDocs documentation for this repository is hosted under:

GitLab Hosted Documentation

Note

Open the side panel menu to quickly navigate between the exercises.

The documentation supports a search function to quickly search for specific words.

Info

The provided documentation is a MkDocs Collection run on the GitLab Page CI/CD pipeline.

If you want to run it locally on your machine follow the instructions down below.

Project Structure

.
├── site/                      # Includes a finished build for the MkDocs documentation
├── src/                       # All work files
│   ├── cloud-setup/           # All exercises from the course
│   │   │   ├── docs/          # Hetzner Cloud Setup for the following exercises documentation (Markdown)
│   ├── exercises/             # All exercises from the course
│   │   ├── exercise-XY/       # One exercise
│   │   │   ├── docs/          # Exercise-specific documentation (Markdown)
│   │   │   └── src            # Exercise source code starting at exercise 11 (scripts, configs, IaC, etc.). Some exercise only need shell commands for execution. These will only be documented in the appropiate documention file. 
│   │   ├── ...                # Additional exercises follow the same structure
│   └── index.md               # Main documentation home (rendered by MkDocs)
├── .gitignore                 # Local files that don't get pushed to the remote repository
├── .gitlab-ci.yml             # CI pipeline to build GitLab Page for MkDocs
├── mkdocs.yml                 # MkDocs configuration (theme, navigation, settings)
└── README.md                  # Repository overview & setup instructions (this file)

Getting Started

Clone This Repository

git clone https://gitlab.mi.hdm-stuttgart.de/jr125/sdi-documentation-g11-jr125.git

cd sdi-documentation-g11-jr125

Using Source Code

Each exercise directory contains a file with configuration instructions. But you should be able to execute the the source code for each exercise by:

cd ./src/exercises/exercise-11/src
terraform init
terraform apply

To kill the server in your Hetzner cloud run:

terraform destroy

Warning

If you modefied the source code after deploying the server it can happen, that you need to fix mismatches first.

Alternative you can always kill the server over the Hetzner GUI.

Running MkDocs Locally

With the following steps you can run the MkDocs locally.

Install Python

Ensure Python and pip are installed on your system:

python3 --version
pip3 --version

If Python is not installed on your machine follow the official instructions for your system.

Install MdDocs With Plugins

I use MkDocs for a GUI interface to read the documentation for this project. Use these commands to install it:

pipx install mkdocs
pipx inject mkdocs mkdocs-material mkdocs-awesome-pages-plugin

Serve Documentation Locally

mkdocs serve

The documentation will be available at:

localhost:8000

License

This repository is provided for educational purposes within the scope of the Software Defined Infrastructure class. Reuse outside the course context may require permission.