Article · 3 min read · Getting started

kubespin: Deploy an app from Git

Deploy a Docker Compose project from a GitHub repository onto one of your servers.

Deploy a Docker Compose project from a GitHub repository onto one of your servers.

Before you start

  • A server added to kubespin.
  • GitHub connected on Integrations.

Steps

  1. Go to Deployments and choose New deployment (or Deploy from Git).
  2. Target: give a Deployment name and choose the Server. If the server has a Kubernetes cluster, Where it runs offers it too.
  3. Source: choose GitHub Repo, then the GitHub repository and Branch (blank uses the default branch). Choose the folder the compose project runs in and its compose files. You can also paste a compose file (Docker Compose) or give a Container Image.
  4. Configure:
    • Domain: leave it blank to get a generated name with HTTPS, or give your own (see kubespin: Setting up custom DNS).
    • Proxy port: Detect automatically, or give the port to publish.
    • Environment variables: add them one by one, paste a .env, or Import .env from GitHub. Use Mark as secret on anything sensitive.
  5. Review before deploying, then Deploy.

kubespin checks there’s room first: about 3 GB free when it builds images, 1 GB when it only pulls. Without it, the deploy stops before changing anything and says what to do.

On a server with less than 2 GB of memory, an app that builds is built on your largest server instead, and pulled from your registry. See kubespin: Build an app on another server.

Private repositories

Each app gets a read-only deploy key, made on the server. Add it to the repository on GitHub.

After the first deploy

The app’s page has these tabs:

Tab What it’s for
Overview Running code, compose, automation and the last runs
Logs Each run with its own log, as it happens (kubespin: Runs, logs and kubespin restarts)
Environment Variables and secrets. Save and apply redeploys with them
Automation kubespin: Schedules and webhooks
Containers The app’s containers, each with its logs and Shell (kubespin: Shells on servers and in containers)
Security Security tests and the app firewall (kubespin: Security tests, kubespin: The app firewall)
Settings Code, deploy key, compose folder, access, Where it’s built (kubespin: Build an app on another server), and Move to another server

The buttons in the header:

  • Update: fast-forward to the branch and rebuild what changed.
  • Force update: match the branch exactly, pull images and recreate.
  • Restart.
  • Open ↗ opens the app in a new tab.

Each is recorded as a run with its commits and log, one at a time per app. A run carries on if kubespin restarts during it (kubespin: Runs, logs and kubespin restarts).

What was built is pushed to your area of the registry, where it’s scanned and patched. See kubespin: The local container registry.