The invention relates to the technical field of container management, in particular to a method and
system for automatically triggering K8s Pod updating. The method for automatically triggering K8s Pod update comprises the following steps: receiving a
Webhook event from a
mirror image warehouse, performing security
verification, extracting a
mirror image content abstract from the
Webhook event passing the
verification, and comparing the
mirror image content abstract with a historical mirror
image content abstract stored in a persistent
database in real time; when it is found that the mirror
image content abstract changes, a Kubernetes API is called to modify a Pod template
annotation of the target Deployment, so that an
annotation representing a new mirror
image content abstract is injected; and a rolling updating process is automatically triggered to gradually replace the old Pod instance, so that zero-shutdown deployment is realized. According to the method and
system for automatically triggering the updating of the K8s Pod, a
content awareness updating mechanism is utilized, the problem of updating failure caused by unchanged mirror image labels is thoroughly solved, a Kubernetes updating mechanism is triggered by utilizing
annotation injection, the operation and maintenance complexity is greatly reduced, and repeated operations generated by frequently changing packets in a development stage are reduced.