# Deploying your first application

NOTE WELL

In order to be able to run through the steps of this tutorial in an operational Avassa Platform environment, contact usopen in new window to join our pilot program and get access to a running system.

We have also made a video walkthrough of this tutorial available and all the code and artifacts used in the example are available in our public gitlab repositoryopen in new window.

This tutorial guides you through the steps to deploy your first application on the Avassa Platform.

To prepare for this tutorial, request access to an Avassa Platform environment with the "Popcorn Manager" scenario.

# Check the status of the sites

This scenario includes four sites gothenburg-bergakungen, helsingborg-roda-kvarn, stockholm-sergel and stockholm-sture that has been pre-provisioned, has called home and is available to receive scheduled applications. To inspect the status of a site, click Sites in the sidebar, select any site in the list, then select State in the top bar.

Site state

The state: "initialized" string tells you that the site has successfully completed the call-home process and is ready to receive scheduled applications.

# Add a default remote registry

All containers used in this tutorial is hosted in the Avassa public GitLab container registry, so you need to add registry.gitlab.com as your default registry.

Click Remote registriesin the sidebar, then click Connect new registry.

Site state

Paste the following into the form field and click Submit.

name: "default"
address: "registry.gitlab.com"

# Register the application

To deploy an application service on the Avassa Platform, you need to register an application specification that defines the structure and content of an application, and a deployment specification that defines where the application shall be deployed.

In this case we define a very simple application popcorn-controller consisting of a single container kettle-popper-manager that manages all the popcorn machines in the theaters it is deployed in.

Click Applications in the sidebar, then click Register new application.

Register new application

Paste the following into the form field and click Submit.

name: popcorn-controller
services:
  - name: popcorn-controller-service
    containers:
      - name: kettle-popper-manager
        image: "avassa-public/movie-theaters-demo/kettle-popper-manager"
    mode: replicated
    replicas: 1

# Deploy the application

Since you have popcorn machines in all theaters, we want the system to create a deployment that places the popcorn-controller application in all sites of type edge.

Click Deployments in the sidebar, then click Register new deployment.

Register new deployment

Paste the following into the form field and click Submit.

name: popcorn-deployment
application: popcorn-controller
placement:
  match-site-labels: >
    system/type = edge

Your application is now being deployed to the all four sites.

# Check the status of the application

To inspect the status of the deployed application, click Deployments in the sidebar, select popcorn-deployment, then select State in the top bar.

Deployment state

The existence of the deployed-to: list means that the container image has been successfully pulled from the remote registry and has been deployed to all sites in the list.

# Conclusion

You have now deployed a single-container application with images from a remote registry, across four sites using label-matching for placement.

Last Updated: 6/23/2021, 11:26:11 AM