When using Loft in a CI/CD pipeline to create namespaces and virtual cluster, there are couple of things to consider:
- You might want to generate your kube configs manually
- You may want to use the offical
loftsh/loft-ciimage in a containerized CI/CD pipeline
- You definitely want to authenticate using Access Keys in either case
You can easily construct a kube config that can be used directly in any external CI/CD pipeline or tool to access a space, connected cluster or vcluster directly. For this you'll only need an access key.
Then you can create a kube config in this format:
Replace the $ACCESS_KEY with your generated access key, $CLUSTER with the name of the connected kubernetes cluster the space was created in and $SPACE with the name of the space. You can now use this kube config with any external applications such as
Then run any command in the space with:
Create Access Keys
Using the 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: