Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 18, 2023 11:58 am GMT

Deploying Container Images With PaaS

There are a lot of tools, methods, and practices that you can use in todays tech world to deploy a container. There are also several locations, whether its Kubernetes, Nomad, or a simple virtual machine where you may want to deploy the container.

The problem is that, although every solution may not be cumbersome, the amount of solutions that are available is cumbersome. Its just too much for engineers. While engineers are trying to figure out how to get the best working environment, theyre bogged down with far too many options.

In this blog post, youll learn about one of the most straightforward options, PaaS.

What Is Platform-as-a-Service (PaaS)

Before diving into how PaaS can give you an idea on making containerization easier, lets first talk about what PaaS is.

Platform-as-a-Service, or PaaS for short, is an environment that includes everything you need to run a full application stack. It can contain:

  • The full cloud environment for you to deploy to.
  • All of the needed underlying networking.
  • The configurations for operating systems.
  • Underlying security protocols.

And a lot more depending on which PaaS you use.

The long and short of it is PaaS gives you the ability to build, deploy, and run an application stack. It doesnt even have to be just containers. It could be a simple binary or some code that you want to run.

Why PaaS Can Make Containerization Easier

Now that you know a little bit about PaaS, lets ask an important question - How does PaaS make containerization easier?

The answer is that it makes your team's life easier.

Example - a startup that has a few developers. The developers may be great at writing application code, but they may not have knowledge about networking, operating systems, CICD, and security. They just want a method of taking some code or a container and deploying it with everything the application needs to run out of the box.

Thats the best way that a PaaS can come into play.

It gives you the ability to not have to worry about managing infrastructure, networking, scaling, and operating systems. The goal is to simply deploy an application and it works as expected.

How To Use Aptible

Now that you have the theory and full understanding of why youd want to use a PaaS and how you can think about it from a containerization perspective, lets get hands-on and dive into a PaaS solution.

There are several solutions out there ranging from startups to large organizations like cloud providers. One solution that stuck out was Aptible.

Aptible stuck out because it targets startups, which is where a PaaS is ideal to run.

In the sections to come, youll see how to set up Aptible from start to finish.

Setting Up Aptible

Aptible offers a free 30-day trial that you can use to check it out and ensure that its the right solution for you. First, go to the Aptible signup page:

Image description

Next, click the purple 30 Day Free Trial button and fill in your information.

Image description

Setting Up An Environment

Once youre signed up, youll see an Environments tab. An Environment is where your application will be deployed to. There is one environment thats available by default.

Image description

You can also create your own environment which consists of either:

  • Shared tenancy (shared with other customers. Think Multitenancy).
  • Dedicated tenancy (think Singletenancy).

Image description

You can then choose where you want the stack to be deployed to, as in, which region.

Image description

Creating An App

Now that the environment is created or you decided to use the default, you can create and deploy a new app. For the purposes of this app, youll deploy a container image.

Within the container, click the orange Create App button.

Image description

Give your app a name and click the orange Save App button.

Image description

Once you create the new app, youll see a ton of different options available. You can use Terraform, Docker, or even deploy a code base.

Image description

For the purposes of deploying a container, youll use Docker. To do that, you need to use the CLI.

Deploying A Container Image

First, install the Aptible CLI.

brew install --cask aptible

Next, log into the CLI.

You will be prompted for you:

  • Email
  • Password
aptible login

Once logged in, you should see an output similar to the below.

  ~  aptible loginEmail:  Password:Token written to /Users/.aptible/tokens.jsonThis token will expire after 7 days (use --lifetime to customize)

Now that youre logged in, theres a simple one-liner that you need to run. Specify the app name you created in the UI and the container image that you want to deploy.

aptible deploy --app "testcontainer" --docker-image "nginx:latest"

Youll see an output similar to the below.

INFO -- : Image app-60487/4abf11ac-c37b-402c-bcbe-15200d0d798d successfully pushed to registry.INFO -- : STARTING: Register service cmd in APIINFO -- : COMPLETED (after 0.19s): Register service cmd in APIINFO -- : STARTING: Derive placement policy for service cmdINFO -- : COMPLETED (after 0.06s): Derive placement policy for service cmdINFO -- : STARTING: Create new release for service cmdINFO -- : COMPLETED (after 0.13s): Create new release for service cmdINFO -- : STARTING: Schedule service cmdINFO -- : COMPLETED (after 4.91s): Schedule service cmdINFO -- : STARTING: Stop old app containers for service cmdINFO -- : COMPLETED (after 0.0s): Stop old app containers for service cmdINFO -- : STARTING: Start app containers for service cmdINFO -- : WAITING FOR: Start app containers for service cmdINFO -- : COMPLETED (after 6.1s): Start app containers for service cmdINFO -- : STARTING: Delete old containers for service cmd in APIINFO -- : COMPLETED (after 0.0s): Delete old containers for service cmd in APIINFO -- : STARTING: Commit app containers in API for service cmdINFO -- : COMPLETED (after 0.16s): Commit app containers in API for service cmdINFO -- : STARTING: Commit service cmd in APIINFO -- : COMPLETED (after 0.07s): Commit service cmd in APIINFO -- : STARTING: Cache maintenance pageINFO -- : COMPLETED (after 0.05s): Cache maintenance pageINFO -- : STARTING: Commit app in APIINFO -- : COMPLETED (after 0.14s): Commit app in APIINFO -- : App deploy successful.

Go back into the Aptible UI and youll see that the app is now deployed.

Image description

Original Link:

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To