Configure auto image updater
When using the Workload feature in APL to deploy Helm charts from the Developer Catalog, then you can also use the Auto image updater
feature to to automatically update the container images of Kubernetes workloads.
APL only supports the image update feature in combination with a Helm chart stored in the Catalog.
Create a Workload with auto image updater
Before creating a workload from the developer catalog, we'll need the repository
and tag
of the image we like to deploy. Go to the list of Builds and add the repository
of the green
build to your clipboard. Remember that the tag is latest
.
You can now create a workload from the developer catalog:
-
Go to
Workloads
in the left menu and click onCreate Workload
-
Select
Quickstart-K8s-Deployment
from the catalog. -
Add the Name
green
for the workload. -
Set the
Auto image updater
toDigest
and fill in theImageRepository
from the clipboard.
Digest
is the update strategy and will update the image to the most recent pushed version of a given tag.
- In the workload
values
, change the following parameters:
image:
repository: <paste from clipboard>
tag: latest
-
Click
Submit
. -
Click
Deploy Changes
.
In the example above, we used the Digest
update strategy. The Semver
strategy allows you to track & update images which use tags that follow the semantic versioning scheme.
Expose the service
Now go to the Expose services lab and expose the green
service. When the service is created, go to Services
in the left menu and click on the Url of the green
service. What do you see?
Make code change to trigger a new build
In the Trigger Builds lab we already created a Build called green
and configured it with a trigger.
Now go to the green
repo in Gitea and change the the welcome message:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sample Deployment</title>
<style>
body {
color: #ffffff;
background-color: green
font-family: Arial, sans-serif;
font-size: 14px;
}
h1 {
font-size: 500%;
font-weight: normal;
margin-bottom: 0;
}
h2 {
font-size: 200%;
font-weight: normal;
margin-bottom: 0;
}
</style>
</head>
<body>
<div align="center">
<h1>Welcome to the improved Green app</h1>
</div>
</body>
</html>
And commit changes.
After the change has been committed, go to Services
in the left menu and click on the Url of the green
service. After a couple of minutes (note that the auto image update checks for changes every 2 minutes) you should see a green
page saying Welcome to the improved Green app