Dev Container

This page contains the configuration for a development container that provides a consistent environment for working with Terrakube.

The devcontainer includes all the necessary tools and dependencies to develop both the Java backend, TypeScript frontend components and includes terraform CLI.

Make sure The below was tested using Ubuntu-based distribution, not sure if this will work with macos, windows or codespaces

Features

  • Java 17 (Liberica)

  • Maven 3.9.9

  • Node.js 20.x with Yarn

  • VS Code extensions for Java, JavaScript/TypeScript

Getting Started

Prerequisites

Local Development Domains

To use the devcontainer we need to setup the following domains in our local computer:

terrakube.platform.local
terrakube-api.platform.local
terrakube-registry.platform.local
terrakube-dex.platform.local

HTTPS Local Certificates

Install mkcert to generate the local certificates.

To generate local CA certificate execute the following:

Create Docker Network for the devcontainer

We will be using 10.25.25.253 for our the traefik gateway

Local DNS entries

Update the /etc/hosts file adding the following entries:

Opening the Project in a Dev Container

  • Clone the Terrakube repository and run the project:

  1. When prompted to "Reopen in Container", click "Reopen in Container". Alternatively, you can:

    • Press F1 or Ctrl+Shift+P

    • Type "Remote-Containers: Reopen in Container" and press Enter

  2. Wait for the container to build and start. This may take a few minutes the first time.

  3. Start all Terrakube components

    image

  4. Terrakube should be availabe with the following url https://terrakube.platform.local using [email protected] with password admin

Ports

The devcontainer forwards the following ports:

  • 8080: Terrakube API

  • 8075: Terrakube Registry

  • 8090: Terrakube Executor

  • 3000: Terrakube UI

  • 80/443: Traefik Gateway

Customization

You can customize the devcontainer by modifying:

  • .devcontainer/devcontainer.json: VS Code settings and extensions

  • .devcontainer/Dockerfile: Container image configuration

Last updated

Was this helpful?