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 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.
It's essential for web applications running on Docker images to listen on port 8080
, especially when external access is enabled. This configuration ensures that the application is accessible through the designated external endpoint.
To enable external access for the application, it is important to ensure that the application listens on port 8080
. The TLS termination will be 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"
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 withlatest
Don't use tag with latest
-
astroctl app profile get # gets the all the profileNames
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 apply -f application.yaml
Validate
The platform provides standard debugging subcommands part of the astroctl.
- Access the cluster directly and perform the necessary validations via
kubectl
commandHow to get the kubeconfig of the remote cluster? - Follow Cluster Context
- Run the following commands:
astroctl app status hello-world
Events,CD: If availabile
astroctl app events hello-world
Events, K8s: If availabile
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
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.