Modules

Overview

Walhall’s primary functions are to help you develop containerized apps and deploy them to your Kubernetes infrastructure. The apps derive their code from repositories linked from your GitHub organization. Walhall imports these repositories as modules. Users in your organization can deploy these modules to your Kubernetes infrastructure in the context of apps.

This section describes how modules work and how to configure them.

What is a module?

A module is a code repository that has been linked to Walhall from your GitHub organization.

When you create an app, you can choose one or more modules to add:

Screenshot: List of modules to add to your app

Your modules will be added to an environment. An environment includes your modules and environment-specific configurations for each module, such as ingress, databases, and environment variables.

When you deploy your app, Walhall will deploy the modules as containers in the designated Kubernetes cluster.

How do I create a module?

All you have to do is create a public repository in your linked GitHub organization that meets the following requirements:

  • It must include a Drone file. See the Drone page for more details.
  • It must include a Dockerfile.
  • The repository must have a tagged commit that includes both the Drone file and the Dockerfile.

How do I add a module to my app?

When you create an app, the first step is to choose which modules to add.

If you want to add modules to an existing app:

  1. Log in to Walhall and click on your app.
  2. Click the Create Draft button to enter draft mode.
  3. In the box labeled Add new module, click Browse.
  4. A list of modules, derived from your organization’s repositories, will load. If you don’t see your module, then click Refresh the list. If you do, then click the Add button.
  5. Click Finish selection.

The module will be added to your app. However, you must deploy the app again in order for the changes to take effect.

How do I configure a module?

You can define the environmental configuration settings for your module by clicking the Create Draft button and then clicking on the module.

Once you click on it, the module’s configuration screen will appear:

Screenshot: Module configuration screen

Repository

This section displays information about the module’s repository and displays a list of versions (i.e., GitHub release tags). Here, you can choose which version to deploy with the app.

When you choose a version, Walhall will build its Docker image (or take the existing one from the registry) and then deploy it to your cluster when you click Deploy.

Build logs

This section shows the logs for all of the build steps defined in your Drone file. You can use these logs to troubleshoot issues with your module’s Dockerfile or your Drone configuration.

Custom port mapping

This section lets you expose your module with a public URL. Check the box and enter the port on which it serves its content.

Other modules can use the module’s DNS name (and in-cluster IP address) as environment variables In the Variables section, enter a variable substitution in the value field with the format: ${modules.{MODULE-NAME}.service.external-name}. See the environment variables page for more information.

Databases

Walhall offers you the option to create databases for each module in a Google Cloud Platform (GCP) cluster managed by the platform itself. You can choose from the following types:

  • PostgreSQL
  • MongoDB (coming soon)
  • MySQL (coming soon)

When you create a platform-managed database instance, Walhall will create the following secrets:

  • DATABASE_HOST: Host address of the database.
  • DATABASE_PORT: Port where the database listens.
  • DATABASE_ENGINE: Engine used to run the database.
  • DATABASE_NAME: UUID for the database.
  • DATABASE_USER: Username of the database user.
  • DATABASE_PASSWORD: Password of the database user.

Variables

This section lets you add and remove environment variables from the module’s config map. These values will be exposed to your module in the current deployment environment and will not carry over to different environments.

Here, you can also define variable substitutions that reference other modules and resources in your app. See the environment variables for more information.

NOTE: You should not store sensitive credentials in the module’s config map. Use the Secrets tab instead.

Secrets

This section lets you define sensitive credentials to be exposed to your module in the runtime environment. See the Secrets page for information about how to define secrets for your module.

Container logs

This section shows the logs for the container that Walhall builds for this module. You can use these logs to troubleshoot runtime issues with your module.

How do I update a module?

When you want to push an update for a module that’s been deployed in a Walhall app, you must push a tag in the module’s GitHub repository. This will prompt Walhall to build a new image for the module.

Then, log in to Walhall and go to your app. Click Create Draft, then click on the module’s version dropdown, and you should see the new version you just pushed.

Screenshot: Select new module version in Walhall

How do I remove a module from an app?

On the app overview screen, click on the module you want to remove, and then click the Remove button in the lower left:

Screenshot: Remove module from app