Skip to content

Getting started

Deploy your first application

To deploy an application on levv cloud, define your services in a compose YAML file.

# myapp.yaml
services:
  website:
    image: nginx
    deploy:
      replicas: 1

Then deploy the services with:

levv apply -f myapp.yaml

Launching applications from a private repository requires uploading your credentials to levv cloud. Launching a container image from a private repository.

Assign the appropriate resources to your application

You can specify the number of replicas as well as the size for each service running on levv cloud.

# myapp.yaml
services:
  website:
    image: nginx
    deploy:
      replicas: 3
    labels:
      io.levv.size: "large"

For all available sizes and pricing, please visit https://levv.io/pricing

Display your services and running containers

To list all the services currently deployed in your account, run the following command:

levv ls

To show all the containers instances running, use the following command:

levv ps

Expose your application on the Internet

Labeling your services as public and exposing their HTTP ports in the compose specification are the only requirements to make them accessible from the outside world.

You can also link your web service to a custom domain name (you will need to create a CNAME record pointing towards the service's public URL).

In the following example, we are deploying an Nginx image and exposing it as an HTTP service linked to a custom domain.

# nginx.yaml
services:
  website:
    image: nginx
    deploy:
      replicas: 1
    labels:
      io.levv.public: "80/http" # ServicePort/Protocol
    ports:
      - "80:80" # ServicePort:ContainerPort
    domainname: "website.example.com"

You can also expose TCP/UDP ports directly. In the following example, we are deploying a Redis instance and exposing it as a TCP service.

# redis.yaml
services:
  website:
    image: redis
    deploy:
      replicas: 1
    labels:
      io.levv.public: "6379/tcp"
    ports:
      - "6379:6379" # ServicePort:ContainerPort

The service port will be exposed as a dynamic TCP/UDP port (eg. 31456). The port number will be displayed in the CLI when the deployment is ready. You can also display the port information using the levv ls command.

The service will then be reachable at public.levv.io:<public-port>.

Get your application's energy footprint

levv cloud comes with sustainability in mind. We help you achieving your goals on reducing your carbon footprint by viewing the energy utilization and carbon intensity of your applications in real-time.

You can display your current footpring using the following command:

levv footprint

Create a volume

Volumes offer local persistent storage for applications running on levv cloud. Volumes can be created using the levv CLI:

levv volumes create

They can also be created when launching applications that attach a new volume.

Attach a volume to your application

Volumes can be accessed through a mounting point in your application’s file system.

# myapp.yaml
services:
  website:
    image: nginx
    deploy:
      replicas: 1
    volumes:
      - disk-one:/usr/share/nginx/html
volumes:
  disk-one:
    driver_opts:
      size: 2G

If disk-onedoes not exist, the levv CLI will automatically create it. Set the requested size using the driver_opts.size option (default: 1G).

Volumes can be shared between multiple applications, allowing you to expand their functionality.

# myapp.yaml
services:
  website:
    image: nginx
    deploy:
      replicas: 1
    volumes:
      - disk-one:/usr/share/nginx/html
  writer:
    image: myrepo/myapp:latest
    deploy:
      replicas: 1
    volumes:
      - disk-one:/usr/local/data
volumes:
  disk-one:

Create a storage bucket

levv cloud offers object storage buckets that allow you to persist and retrieve unstructured data through the S3 protocol. Object buckets can be created using the levv CLI.

levv buckets create

After creation, you will be able to manage your buckets using the credentials provided by the levv CLI.

List and manage your buckets

The buckets that you have created can be easily retrieved using the levv CLI

levv buckets ls

Equally, you can obtain a bucket credentials and use them to manage it with an S3 client

levv buckets credentials my-bucket.mycompany.com

We recommend using s5cmd to manage permissions, and store or retrieve data.