Image Maintenance

Administrators may wish to create and maintain a library of Kasm Images with custom software and configurations. They may also wish to ensure Images are always up to date with the latest software patches for improved security and reliability with no user downtime. In this situation, it is recommended for administrators to create a DevOps process for automatically building, testing and publishing custom Images to their Kasm deployment.

Process Overview

The following diagram highlights general steps that may be used to orchestrate an Image maintenance process.

../_images/process1.png

Image Maintenance Process

  • Build

    Create a repository inside a Version Control System (VCS) (e.g GitLab, BitBucket) to host the custom image Dockerfiles. Utilize automated CI/CD toolchains such as pipelines built into the VCS or standalone tools such as Jenkins to automatically build images based on a schedule.

    See Building Custom Images for more details in image creation.

    References:

  • Push

    Utilize the CI/CD toolchain to push the images to a docker container registry. This can be a public registry such as DockerHub, or private registry such those provided GitLab, AWS, Digital Ocean etc. The registry must be accessible by all Kasm Agents in order for them to automatically pull the Images.

    When defining the Image inside the Kasm UI, utilize the custom docker image name, registry , and if needed a username and password/access token needed to authenticate to the private registry.

    Consider the naming convention of the docker image tags. It may be beneficial to push an image with multiple tags such as one that represents something unique such as the current date/time myimage:11302020 and another that represents a moving target such as myimage:latest . Consider the Pull Behavior and how that will impact the desired process.

    References:

  • Test

    Register the desired Image in the Kasm UI. Within a few minutes the Agents will pull down the Images from the defined registry. Assign the Image to a testing group, and verify the desired functionality.

    ../_images/test_image.png

    Registering a Test Image

  • Deploy

    When ready, update the user-facing Images to use the verified docker image name and tag. The next time the user creates a session, the new Image will be used.

Pull Behavior

Kasm Agents check in with the Kasm Web App service every 30 seconds and will inform the Agent about which Images are defined in the system. If the Agent does not have currently have the Image it will immediately issue a docker pull. Separately, the Agent will also issue a pull every hour for those images even if they are present on the system in order to fetch an updated version if available. In either case, a pull only occurs if a Docker Registry is defined on the registered Image.

Note

Some registries such as DockerHub have implemented Pull Rate Limiting. Administrators should authenticate to the registry to raise those limits by utilizing the Docker Registry Username and Docker Registry Password options when registering an image.