<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>kubectl on Simon Bergstrom</title><link>https://simonbrgstrm.se/tags/kubectl/</link><description>Recent content in kubectl on Simon Bergstrom</description><generator>Hugo -- gohugo.io</generator><copyright>&lt;a href="https://simonbrgstrm.se" target="_blank" rel="noopener">simonbrgstrm.se&lt;/a></copyright><lastBuildDate>Fri, 29 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://simonbrgstrm.se/tags/kubectl/index.xml" rel="self" type="application/rss+xml"/><item><title>kubectl Cheat Sheet</title><link>https://simonbrgstrm.se/posts/2026/05/kubectl-cheat-sheet/</link><pubDate>Fri, 29 May 2026 00:00:00 +0000</pubDate><guid>https://simonbrgstrm.se/posts/2026/05/kubectl-cheat-sheet/</guid><description>kubectl commands I use most often.
Setup # Show current context and all available contexts kubectl config current-context kubectl config get-contexts # Switch context / namespace kubectl config use-context &amp;lt;context-name&amp;gt; kubectl config set-context --current --namespace=&amp;lt;namespace&amp;gt; # Quick alias (optional) alias k=kubectl Inspect cluster resources # Nodes and namespaces kubectl get nodes -o wide kubectl get ns # Core workload objects kubectl get pods -A kubectl get deploy -A kubectl get svc -A kubectl get ing -A # Watch updates kubectl get pods -n &amp;lt;namespace&amp;gt; -w Deep dive and debugging # Describe object details and events kubectl describe pod &amp;lt;pod-name&amp;gt; -n &amp;lt;namespace&amp;gt; kubectl describe deploy &amp;lt;deploy-name&amp;gt; -n &amp;lt;namespace&amp;gt; # Logs kubectl logs &amp;lt;pod-name&amp;gt; -n &amp;lt;namespace&amp;gt; kubectl logs -f &amp;lt;pod-name&amp;gt; -n &amp;lt;namespace&amp;gt; kubectl logs &amp;lt;pod-name&amp;gt; -c &amp;lt;container-name&amp;gt; -n &amp;lt;namespace&amp;gt; # Open a shell in a container kubectl exec -it &amp;lt;pod-name&amp;gt; -n &amp;lt;namespace&amp;gt; -- /bin/sh # List recent namespace events kubectl get events -n &amp;lt;namespace&amp;gt; --sort-by=.</description></item></channel></rss>