Skip to main content

Image

For stateless web applications, leveraging container images is a streamlined approach to defining the application's runtime environment. This method enables developers to directly reference public Docker images for their applications, with the platform automatically configuring necessary aspects, including the provision of an external access endpoint.

Private Docker Registry?

Private Docker Registry support is forthcoming

Future enhancements will introduce source-to-image conversion capabilities, further simplifying application deployment. Additionally, support for StatefulSet application abstractions is on the horizon, aiming to ease the deployment process. Currently, to deploy applications, users must utilize Helm charts or opt for the more advanced YAML source type.

By default the platform routes traffic to port 8080. If your application listens somewhere else, set port under image and traffic follows it.

External Access?

Traffic reaches whichever port you declare: 8080 unless you set port. Make sure it matches the port your container actually serves, or the application deploys cleanly and answers nothing. TLS termination is configured through the ingress service.

name: "hello-world"
profileName: "default-profile"
source:
type: "image"
image:
registry: "docker.io"
repository: "astropulse/latency"
tag: "v1.0.0"
port: 3000

Manifest

The provided above YAML snippet is an application resource manifest to deploy a image.

  • name: The name of the application. In this example, it is set to "hello-world".
  • profileName: The name of the profile used for this application. Here, it is "default-profile".
  • source:
    • type: The type of source, which is "image" in this case.
    • image: Specifies that the application is defined using a container image.
      • registry: The container registry where the image is hosted. In this example, it is "docker.io".

      • repository: The repository path of the image, here "astropulse/latency".

      • tag: The specific version of the image to use, in this case, "v1.0.0".

        tag with latest

        Don't use tag with latest

      • port: The container port the application listens on. Optional, and 8080 if you leave it out. Must be 1024 or above, so the port can bind on any node whatever that node's unprivileged-port threshold is.

How to find supported profile name?
astroctl app profile get # gets the all the profileNames
Detail
astroctl app profile get <profileName> -oyaml

Deploy

To deploy this YAML manifest using the astroctl command-line tool, follow these steps:

Save the YAML manifest to a file, for example, `application.yaml. Use the following command to apply the manifest:

astroctl app apply -f application.yaml
Any surface

The console Deploy Application wizard and Nova deploy this same image source. You can ask Nova in plain language, for example "deploy hello-world from this image." See Deploy an application for the full walkthrough across the console, CLI, and Nova.

Validate

The platform provides standard debugging subcommands part of the astroctl.

  1. Access the cluster directly and perform the necessary validations via kubectl command

    How to get the kubeconfig of the remote cluster? - Follow Cluster Context

  2. Run the following commands:
Status
astroctl app status hello-world

Events, CD: If available

astroctl app events hello-world

Events, K8s: If available

astroctl app events hello-world -k

Logs: This will provide logs of all the pods running

astroctl app logs hello-world -ojson

For more, please check the Application subcommand part of the CLI

External Access

The optional externalAccess block controls how an image-source application is exposed. Set accessType to Ingress or LoadBalancer to expose it. Without an externalAccess block — or with None — the application is not exposed externally.

To disable external access, add the following structure to the manifest:

...
externalAccess:
accessType: None

This will disable external access if it is not required.

Upgrade

When upgrading applications deployed from Docker images, simply update the image tag to the newer version and use astroctl command to deploy the manifest. The platform will handle the rolling upgrade with zero downtime.