Configure auto image updater
When using the workload feature to deploy Helm charts from the catalog, you can also use the Auto image updater feature to automatically update the container images of Kubernetes workloads.
The image update feature is only supported 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 container Images and add the repository
of the green
build to your clipboard. Remember that the tag is main
.
You can now create a workload from the developer catalog:
-
Go to Workloads in the left menu and click on Create Workload.
-
Select the Quickstart-K8s-Deployment template from the catalog.
-
Set the name to green.
-
Set the Auto image updater to Digest and fill in the
ImageRepository
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: main
-
Click Submit.
In the example above, we used the digest update strategy. The semver strategy allows you to track and 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>
Commit the 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 with the text Welcome to the improved Green app.
Updated 2 days ago