Sri Sainath Adusumilli’s Post

Your pod is CrashLoopBackOff. You've run 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘥𝘦𝘴𝘤𝘳𝘪𝘣𝘦 𝘱𝘰𝘥 17 times. You still don't know why. Here's my Kubernetes debugging cheatsheet. Save this. You'll need it at 3am. 𝗦𝘁𝗲𝗽 𝟭: 𝗪𝗵𝗮𝘁'𝘀 𝘁𝗵𝗲 𝗮𝗰𝘁𝘂𝗮𝗹 𝗲𝗿𝗿𝗼𝗿? 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘭𝘰𝘨𝘴 <𝘱𝘰𝘥> --𝘱𝘳𝘦𝘷𝘪𝘰𝘶𝘴 The --previous flag shows logs from the crashed container. Most people forget this. 𝗦𝘁𝗲𝗽 𝟮: 𝗪𝗵𝘆 𝗱𝗶𝗱 𝗶𝘁 𝗰𝗿𝗮𝘀𝗵? 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘥𝘦𝘴𝘤𝘳𝘪𝘣𝘦 𝘱𝘰𝘥 <𝘱𝘰𝘥> | 𝘨𝘳𝘦𝘱 -𝘈5 "𝘓𝘢𝘴𝘵 𝘚𝘵𝘢𝘵𝘦" Exit code 137 = OOMKilled. Exit code 1 = app error. Exit code 143 = SIGTERM. 𝗦𝘁𝗲𝗽 𝟯: 𝗜𝘀 𝗶𝘁 𝗮 𝗿𝗲𝘀𝗼𝘂𝗿𝗰𝗲 𝗶𝘀𝘀𝘂𝗲? 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘵𝘰𝘱 𝘱𝘰𝘥 <𝘱𝘰𝘥> Hitting memory limits? That's your OOM. Increase limits or fix the leak. 𝗦𝘁𝗲𝗽 𝟰: 𝗜𝘀 𝗶𝘁 𝗮 𝘀𝘁𝗮𝗿𝘁𝘂𝗽 𝗶𝘀𝘀𝘂𝗲? 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘨𝘦𝘵 𝘦𝘷𝘦𝘯𝘵𝘴 --𝘧𝘪𝘦𝘭𝘥-𝘴𝘦𝘭𝘦𝘤𝘵𝘰𝘳 𝘪𝘯𝘷𝘰𝘭𝘷𝘦𝘥𝘖𝘣𝘫𝘦𝘤𝘵.𝘯𝘢𝘮𝘦=<𝘱𝘰𝘥> Events tell you what Kubernetes sees. Image pull errors, volume mounts, scheduling failures. 𝗦𝘁𝗲𝗽 𝟱: 𝗖𝗮𝗻 𝘆𝗼𝘂 𝗴𝗲𝘁 𝗶𝗻? 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘦𝘹𝘦𝘤 -𝘪𝘵 <𝘱𝘰𝘥> -- /𝘣𝘪𝘯/𝘴𝘩 If the container is crashing too fast, change the command to sleep 3600 temporarily. 𝗕𝗼𝗻𝘂𝘀: 𝗧𝗵𝗲 𝗻𝘂𝗰𝗹𝗲𝗮𝗿 𝗼𝗽𝘁𝗶𝗼𝗻 𝘬𝘶𝘣𝘦𝘤𝘵𝘭 𝘳𝘶𝘯 𝘥𝘦𝘣𝘶𝘨 --𝘪𝘮𝘢𝘨𝘦=𝘣𝘶𝘴𝘺𝘣𝘰𝘹 --𝘳𝘮 -𝘪𝘵 -- 𝘴𝘩 Spin up a debug container in the same namespace. Test DNS, network, service discovery. 𝟵𝟬% 𝗼𝗳 𝗽𝗿𝗼𝗱 𝗶𝘀𝘀𝘂𝗲𝘀 𝗮𝗿𝗲: • OOMKilled (increase memory) • Config/secrets missing (check mounts) • Image pull failed (check registry creds) • Readiness probe too aggressive (increase timeout) What's your go-to debugging command? #Kubernetes #SRE #DevOps #Debugging #K8s

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories