I have a kubernetes deployment that looks like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: datacollector
spec:
replicas: 1
selector:
matchLabels:
pod-type: datacollector
template:
metadata:
labels:
pod-type: datacollector
spec:
imagePullSecrets:
- name: secret
containers:
- name: datacollector
image: "build.dorangg.dev/doranggdatacollector:latest"
imagePullPolicy: Always
Currently I run the following command whenever I want to update the deployment to use the newest version of the image from the docker registry (build.dorangg.dev) :
kubectl rollout restart deployment/datacollector
I want to initiate a rolling update of the deployment (what the above command does) AUTOMATICALLY whenever a new version of the image appears in the docker registry.
Can this be accomplished using the kubernetes configuration? If not, is this automation possible to do with a script?