Home > OS >  Possible kubernetes image mismatch
Possible kubernetes image mismatch

Time:05-11

Good Afternoon,

I'm relatively new to kubernetes and am trying to track down a possible problem.

We have a dev application that used to work (before my time) but the local project works just fine. The Team Lead has assigned the ticket to me to find out why the dev version stopped working.

We were talking and he thinks that the kubernetes image that is being run in the dev environment is different than the one that is in the developer's environment but he wants me to prove it out.

I have basic kubernetes experience and have been run various kubectl commands but so far haven't been able to find the one(s) that I need to see what image version is in the local environment and what is currently running in the dev environment in order to do a comparison.

Any suggestions are greatly appreciated and I will continue trying to get to that information.

Thanks, Bill Youngman

CodePudding user response:

Hy,

if you describe your POD you should see the Image Id a Hash that you can compare.

kubectl describe pod <PODNAME>

Containers:
  ***:
    Container ID:   containerd://bb57f04e34e6e5e49b956dabc4d99eab1a23106a8cde03d058c2acfbbcf83561
    Image:          ****/***:12544
    Image ID:       ****/***@sha256:c197064bb83f386bc23bc5012c1a929b8a6b428288ddad7d6ab72a80227a6754

CodePudding user response:

So the version that the cluster is pulling is not working, but the one on the developer's machine is?

Easy way to verify this is to push the developers copy to a different tag, or different image.

So for example if the image is myimages/myimage, the developer can do:

docker tag myimages/myimage myimages/myimage:test
docker push myimages/myimage:test

Then set the kubernetes deployment to use myimages/myimage:test and see if that works.

If it works with that version, but doesn't when you use myimages/myimage then the developer's version is indeed different to the one used by the kubernetes cluster, most likely they made a code change and rebuilt the image but forgot to push to the registry.

  • Related