0

We have a micro-services java applications, as and when we have changes in code we have to perform the kubernetes deployment.

How will I apply the latest changes to the deployment with the same Image name

we have a single replica and when I execute kubectl apply -f deployment.yaml it says unchanged.

We have kubelet version of v1.13.12

Please help.

magic
  • 254
  • 2
  • 10
  • 19
  • 1
    A best practice is to use a distinct image tag for each build; then when you `kubectl apply` the updated deployment, there will be a change that causes Kubernetes to restart the pods for you. You also can't roll back a failed build if you don't use a distinct tag for each. – David Maze Dec 31 '19 at 17:39

1 Answers1

2

This has been discussed in #33664

using :latest tag IMO is not the best practice as it's hard to track what image is really in use in your pod. I think tagging images by versions or using the digests is strictly better than reusing the same tag. Is it really such a hassle to do that?

The recommended way is to not use image tag :latest when using declarative deployment with kubectl apply.

Jonas
  • 121,568
  • 97
  • 310
  • 388