HowTo¶
How to Use¶
1 - Create an Image
resource:
apiVersion: kimup.cloudavenue.io/v1alpha1
kind: Image
metadata:
labels:
app.kubernetes.io/name: kube-image-updater
app.kubernetes.io/managed-by: kustomize
name: demo
namespace: default
spec:
image: traefik/whoami
baseTag: v1.9.0
triggers:
- type: crontab
value: "00 00 */12 * * *"
rules:
- name: Automatic update semver minor
type: semver-minor
actions:
- type: apply
2 - Apply the Image
resource:
kubectl apply -f image.yaml
In this example the image traefik/whoami
will be updated every 12 hours with the latest minor version.
3 - Check the Image TAG:
kubectl get image demo'
NAME IMAGE TAG
demo traefik/whoami
But you can force the update by running the following command:
kubectl annotate image demo kimup.cloudavenue.io/action=refresh
The Image TAG is now updated:
NAME IMAGE TAG
demo traefik/whoami v1.10.0
4 - Make a deployment with the image:
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: whoami
template:
metadata:
annotations:
kimup.cloudavenue.io/enabled: "true"
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami
5 - Apply the deployment:
kubectl apply -f deployment.yaml
Now the deployment is running with the image traefik/whoami:v1.10.0
define by your rules in the CRD Image
.