Using Loft in CI/CD Pipelines

When using Loft in a CI/CD pipeline to create namespaces and virtual cluster, there are couple of things to consider:

  1. You may want to use the offical loftsh/loft-ci image
  2. You definitely want to authenticate using Access Keys

Container Image

When using Loft in a CI/CD pipeline that runs based on containers, you can use the official loft-ci image either as a base image or directly.

This image is based on alpine and contains:

This is what the Dockerfile looks like:

FROM devspacesh/devspace:5
# Add helm
RUN wget -O helm.tar.gz https://get.helm.sh/helm-v3.3.3-linux-amd64.tar.gz \
&& tar -zxvf helm.tar.gz \
&& mv linux-amd64/helm /bin/helm
# Add Loft CLI (same version as the tag of this image)
COPY release/loft-linux-amd64 /bin/loft
RUN chmod +x /bin/loft

Authentication

1. Create Access Keys

Loft UI - Profile: Create Access Key

2. Login with Access Keys

loft login https://my-loft.url.tld --username [USERNAME] --access-key [ACCESS_KEY]