Skip to content

Creating a stack

After you've installed the CLI, you can bootstrap a new stack. Let's call it my-cloudstack and create the corresponding context directory.

Note

The context directory is where the configuration (the so called Stackfile) and lifecycle artifacts (e.g. TLS certifcates and SSH keys) of a stack are saved. You can set a custom context directory with --context. By default, the context directory is set to your current working directory.

Running cloudstack init will get you started with an example config that works with Docker for Desktop out of the box.

mkdir my-cloudstack
cd my-cloudstack
cloudstack init

Note

Instead of creating and entering the context directory manually, you can initialize a new stack from anywhere and have the directory created automatically by using the following command: cloudstack --context $PWD/my-cloudstack init

You can install your new stack running the following command:

cloudstack launch --pull

Note

--pull downloads the latest Cloudstack image from GitLab's container registry. You can use --image-ref to specify your own image (e.g. if you forked Cloudstack). By default, the CLI will use the latest tag of the image. Use --image-version to specify a different tag.

Note

In case you're not using the CLI from within the context directory, you can specify the context directory manually: cloudstack --context $PWD/my-cloudstack install --pull.

Note

The CLI tries to automatically discover the Kubernetes cluster to work with by detecting a kubeconfig file. By default, it looks for a kubeconfig.yml in the context directory. This file is automatically created for you if you use a plugin that provides kubernetes. If it doesn't exist, the CLI tries to fall back to $HOME/.kube/config and the KUBECONFIG environment variable in this order. If no kubeconfig can be found, the parts of the stack that interface with your Kubernetes cluster won't work.

You can manually specify a kubeconfig file using --kubeconfig which has precedence over the automatic discovery process.

After installation, you can access your stack under the following URLs:


Last update: November 6, 2021
Back to top