Configuring Moose for cloud environments
In the Packaging Moose for deployment page, we looked at how to package your moose application into Docker containers (using the moose build —-docker
command), and you've pushed them to your container repository.
We can connect and configure your container image with remote Clickhouse and Redpanda-hosted services.
The methods used to accomplish this are generally similar, but the specific details depend on your target cloud infrastructure. So, we'll look at the overarching concepts and provide some common examples.
Specifying your repository container
Earlier, we created two local containers and pushed them to a docker repository.
>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
moose-df-deployment-aarch64-unknown-linux-gnu 0.3.175 c50674c7a68a About a minute ago 155MB
moose-df-deployment-x86_64-unknown-linux-gnu 0.3.175 e5b449d3dea3 About a minute ago 163MB
We pushed the containers to the 514labs
Docker Hub account. So, we have these two containers available for use:
514labs/moose-df-deployment-aarch64-unknown-linux-gnu:0.3.175
514labs/moose-df-deployment-x86_64-unknown-linux-gnu:0.3.175
In later examples, we'll use an AMD64 (x86_64) based machine, so we'll stick to using the following container image: 514labs/moose-df-deployment-x86_64-unknown-linux-gnu:0.3.175
We'll also examine how the container image name can be used in various cloud providers and scenarios.
General overview
The general approach is to use a cloud provider that supports specifying a container image to launch your application. Examples include the Google Kubernetes Engine (GKE), Amazon's Elastic Kubernetes Service (EKS), and Elastic Container Service (ECS). Each provider also offers a way of configuring container environment variables that your container application will have access to. We'll look at which environment variables must be configured later in this document.