<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dmitry Matyukhin</title>
    <description>The latest articles on DEV Community by Dmitry Matyukhin (@fancyapps).</description>
    <link>https://dev.to/fancyapps</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4275043%2Fee0b6bc3-ca0e-45c4-83b0-237cdf09b9ef.png</url>
      <title>DEV Community: Dmitry Matyukhin</title>
      <link>https://dev.to/fancyapps</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fancyapps"/>
    <language>en</language>
    <item>
      <title>Which kubectl column have you stopped trusting?</title>
      <dc:creator>Dmitry Matyukhin</dc:creator>
      <pubDate>Tue, 01 Dec 2026 02:33:41 +0000</pubDate>
      <link>https://dev.to/fancyapps/which-kubectl-column-have-you-stopped-trusting-5d0l</link>
      <guid>https://dev.to/fancyapps/which-kubectl-column-have-you-stopped-trusting-5d0l</guid>
      <description>&lt;p&gt;&lt;code&gt;kubectl get pods&lt;/code&gt; is the first thing most of us run in an incident, and I've slowly stopped taking some of its columns at face value.&lt;/p&gt;

&lt;p&gt;Two that keep catching people out:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RESTARTS.&lt;/strong&gt; It's a per-pod counter. When a Deployment rolls or the pod gets rescheduled, the new pod starts at 0. So an app that crashed 40 times yesterday can show a clean &lt;code&gt;0&lt;/code&gt; today, just because the pod was replaced. The history is gone unless you have events or metrics from before.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;READY 1/1.&lt;/strong&gt; All it means is that the readiness probe passes. If there's no readiness probe, the container counts as ready as soon as it starts. A pod can sit at &lt;code&gt;1/1 Running&lt;/code&gt; while returning 500 to every request.&lt;/p&gt;

&lt;p&gt;What I do now: &lt;code&gt;kubectl describe&lt;/code&gt; for events and last state, and I treat the table as a hint, not an answer.&lt;/p&gt;

&lt;p&gt;Which column (or command) did you learn not to trust, and what do you look at instead? Curious about &lt;code&gt;kubectl top&lt;/code&gt; and &lt;code&gt;AVAILABLE&lt;/code&gt; on Deployments in particular.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>sre</category>
    </item>
    <item>
      <title>My AI coding agent was running kubectl as cluster-admin. Here's the read-only identity I gave it instead</title>
      <dc:creator>Dmitry Matyukhin</dc:creator>
      <pubDate>Mon, 30 Nov 2026 20:49:55 +0000</pubDate>
      <link>https://dev.to/fancyapps/my-ai-coding-agent-was-running-kubectl-as-cluster-admin-heres-the-read-only-identity-i-gave-it-3ikf</link>
      <guid>https://dev.to/fancyapps/my-ai-coding-agent-was-running-kubectl-as-cluster-admin-heres-the-read-only-identity-i-gave-it-3ikf</guid>
      <description>&lt;p&gt;AI coding agents run &lt;code&gt;kubectl&lt;/code&gt; on my machine all the time now, and the first thing I changed was making sure they don't do it as me. Here's the setup, built and tested on Kubernetes 1.36: a separate read-only identity the API server enforces, no matter what the agent decides to try.&lt;/p&gt;




&lt;p&gt;An AI coding agent that runs &lt;code&gt;kubectl&lt;/code&gt; should not run it as you. If Claude Code,&lt;br&gt;
Cursor or Copilot is shelling out to &lt;code&gt;kubectl&lt;/code&gt; and picking up your default&lt;br&gt;
kubeconfig, it is acting with your identity — which, on most engineers' laptops,&lt;br&gt;
is cluster-admin. The fix is not a prompt asking it to be careful. It is a&lt;br&gt;
separate identity that the API server will not let write anything, whatever the&lt;br&gt;
agent decides to try.&lt;/p&gt;

&lt;p&gt;That identity is a ServiceAccount, bound to a read-only ClusterRole, handed to the&lt;br&gt;
agent as a standalone kubeconfig carrying a short-lived token. The guarantee is&lt;br&gt;
enforced server-side, so it holds regardless of what the agent, its wrapper, or&lt;br&gt;
any MCP server in between believes about its own permissions.&lt;/p&gt;

&lt;p&gt;Everything below was built and verified on a single-node cluster running&lt;br&gt;
Kubernetes v1.36.1.&lt;/p&gt;
&lt;h2&gt;
  
  
  The fastest version
&lt;/h2&gt;

&lt;p&gt;Four objects and a file. Create the identity, bind read-only rules to it, mint a&lt;br&gt;
bounded token, and assemble a kubeconfig around that token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create namespace k28agent
kubectl -n k28agent create serviceaccount coding-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;namespace/k28agent created
serviceaccount/coding-agent created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The role is the part worth getting right, so it has its own section below. Once it&lt;br&gt;
exists and is bound, the whole point is provable in one command — as the token,&lt;br&gt;
not as yourself. Skip to proving it if you only want&lt;br&gt;
the check.&lt;/p&gt;
&lt;h2&gt;
  
  
  The role: read-only is a verb set, not a mode
&lt;/h2&gt;

&lt;p&gt;Kubernetes has no read-only switch. Read-only is exactly three verbs — &lt;code&gt;get&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;list&lt;/code&gt;, &lt;code&gt;watch&lt;/code&gt; — and it means whatever resources you attach them to. A ClusterRole&lt;br&gt;
that grants those verbs across the resources an agent actually needs to reason&lt;br&gt;
about a cluster, and nothing else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rbac.authorization.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterRole&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;k28agent-readonly&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"pods"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pods/log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"services"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"endpoints"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"configmaps"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"events"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"namespaces"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"nodes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"persistentvolumeclaims"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"persistentvolumes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"serviceaccounts"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"list"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"apps"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"deployments"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"replicasets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"statefulsets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"daemonsets"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"list"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"batch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"jobs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cronjobs"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"list"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"networking.k8s.io"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ingresses"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"networkpolicies"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"list"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bind it cluster-wide, so the agent can read every namespace it might be asked&lt;br&gt;
about, and apply both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply -f role.yaml
kubectl create clusterrolebinding k28agent-readonly \
  --clusterrole=k28agent-readonly \
  --serviceaccount=k28agent:coding-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clusterrole.rbac.authorization.k8s.io/k28agent-readonly created
clusterrolebinding.rbac.authorization.k8s.io/k28agent-readonly created
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the reasoning behind each verb and resource — including the cluster-scoped&lt;br&gt;
reads the built-in &lt;code&gt;view&lt;/code&gt; role silently omits — see&lt;br&gt;
&lt;a href="https://kubeglance.com/blog/kubernetes-read-only-rbac/" rel="noopener noreferrer"&gt;RBAC for a read-only Kubernetes user&lt;/a&gt;. This&lt;br&gt;
article is about handing that role to a non-human that will try things you did&lt;br&gt;
not anticipate.&lt;/p&gt;
&lt;h3&gt;
  
  
  The Secrets question: leave them out
&lt;/h3&gt;

&lt;p&gt;Notice what is not in that role: &lt;code&gt;secrets&lt;/code&gt;. This is deliberate, and it is the one&lt;br&gt;
decision people get wrong when they set an agent up "to be helpful".&lt;/p&gt;

&lt;p&gt;&lt;code&gt;get secrets&lt;/code&gt; is not read access in the ordinary sense. A Secret contains a&lt;br&gt;
credential, so reading it is holding the credential — there is no difference&lt;br&gt;
between "can read the database password" and "has the database password". An&lt;br&gt;
agent with &lt;code&gt;get secrets&lt;/code&gt; cluster-wide can read every service account token, every&lt;br&gt;
TLS private key, and every application password in the cluster, and an agent is&lt;br&gt;
precisely the kind of process that will paste one into a log, a prompt, or a file&lt;br&gt;
it then commits.&lt;/p&gt;

&lt;p&gt;So the role excludes Secrets, and the check confirms it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl auth can-i list secrets -A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Worth knowing the boundary is leakier than it looks: the role grants &lt;code&gt;pods/log&lt;/code&gt;,&lt;br&gt;
and applications log secrets all the time. There is no RBAC rule that fixes that —&lt;br&gt;
only application discipline. Read access to logs is genuinely useful to an agent&lt;br&gt;
and genuinely a data-exposure route, and both are true at once.&lt;/p&gt;
&lt;h2&gt;
  
  
  Mint a token with a lifetime
&lt;/h2&gt;

&lt;p&gt;Since Kubernetes 1.24 a ServiceAccount does not get a permanent token Secret. That&lt;br&gt;
is a feature. Request a signed, time-bound one instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl -n k28agent create token coding-agent --duration=8h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That prints a JWT to stdout. &lt;code&gt;--duration&lt;/code&gt; requests a lifetime; the API server may&lt;br&gt;
return a shorter one if it is configured with a lower cap, so treat the value as a&lt;br&gt;
ceiling rather than a promise. Eight hours is a working session — long enough to be&lt;br&gt;
useful, short enough that a leaked token is worth nothing tomorrow. If you need the&lt;br&gt;
agent to work unattended past that, mint a fresh token, do not reach for a&lt;br&gt;
long-lived Secret you then have to remember to rotate.&lt;/p&gt;
&lt;h2&gt;
  
  
  Build a standalone kubeconfig
&lt;/h2&gt;

&lt;p&gt;Do not merge this into &lt;code&gt;~/.kube/config&lt;/code&gt;, where a name collision could shadow it or&lt;br&gt;
your own context could be picked up by mistake. Build a separate file, and build it&lt;br&gt;
with &lt;code&gt;kubectl config&lt;/code&gt; rather than by hand so every field is well-formed. The&lt;br&gt;
&lt;code&gt;--kubeconfig&lt;/code&gt; flag makes each command write to that file instead of your default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;kubectl config view --minify -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.clusters[0].cluster.server}'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
kubectl config view --raw --minify \
  -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.clusters[0].cluster.certificate-authority-data}'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; base64 -d &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ca.crt
&lt;span class="nv"&gt;TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;kubectl -n k28agent create token coding-agent --duration=8h&lt;span class="o"&gt;)&lt;/span&gt;

kubectl config --kubeconfig=agent.kubeconfig set-cluster target \
  --server=&lt;span class="s2"&gt;"$SERVER"&lt;/span&gt; --certificate-authority=ca.crt --embed-certs
kubectl config --kubeconfig=agent.kubeconfig set-credentials coding-agent \
  --token=&lt;span class="s2"&gt;"$TOKEN"&lt;/span&gt;
kubectl config --kubeconfig=agent.kubeconfig set-context agent \
  --cluster=target --user=coding-agent --namespace=k28agent
kubectl config --kubeconfig=agent.kubeconfig use-context agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cluster "target" set.
User "coding-agent" set.
Context "agent" created.
Switched to context "agent".
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each flag earns its place. &lt;code&gt;--embed-certs&lt;/code&gt; inlines the CA into the file so it is&lt;br&gt;
self-contained and you can hand it over as one artifact; without it the file would&lt;br&gt;
carry a path to &lt;code&gt;ca.crt&lt;/code&gt; that has to travel with it. &lt;code&gt;set-credentials --token&lt;/code&gt;&lt;br&gt;
stores the bearer token and nothing else — no certificate, no exec plugin, no way&lt;br&gt;
to widen the grant. &lt;code&gt;set-context&lt;/code&gt; joins a cluster to a user and pins a default&lt;br&gt;
namespace; &lt;code&gt;use-context&lt;/code&gt; marks it current so the agent needs no &lt;code&gt;--context&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;Lock the file down — it is a live credential until the token expires:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chmod 600 agent.kubeconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Prove it, don't trust it
&lt;/h2&gt;

&lt;p&gt;The whole design collapses to one command. Ask the cluster what this identity may&lt;br&gt;
do, using the file you just built:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl auth can-i --list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Resources                        Non-Resource URLs   Resource Names   Verbs
...
configmaps                       []                  []               [get list watch]
endpoints                        []                  []               [get list watch]
events                           []                  []               [get list watch]
namespaces                       []                  []               [get list watch]
nodes                            []                  []               [get list watch]
persistentvolumeclaims           []                  []               [get list watch]
persistentvolumes                []                  []               [get list watch]
pods/log                         []                  []               [get list watch]
pods                             []                  []               [get list watch]
serviceaccounts                  []                  []               [get list watch]
services                         []                  []               [get list watch]
daemonsets.apps                  []                  []               [get list watch]
deployments.apps                 []                  []               [get list watch]
replicasets.apps                 []                  []               [get list watch]
statefulsets.apps                []                  []               [get list watch]
cronjobs.batch                   []                  []               [get list watch]
jobs.batch                       []                  []               [get list watch]
ingresses.networking.k8s.io      []                  []               [get list watch]
networkpolicies.networking.k8s.io []                 []               [get list watch]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;get&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;watch&lt;/code&gt;. No &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, &lt;code&gt;patch&lt;/code&gt; or &lt;code&gt;delete&lt;/code&gt; anywhere, and&lt;br&gt;
no &lt;code&gt;secrets&lt;/code&gt;. The negative cases are the specification, and they are worth stating&lt;br&gt;
explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl auth can-i get secrets -A       &lt;span class="c"&gt;# no&lt;/span&gt;
&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl auth can-i delete pods -A       &lt;span class="c"&gt;# no&lt;/span&gt;
&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl auth can-i patch deployments -A &lt;span class="c"&gt;# no&lt;/span&gt;
&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl auth can-i create pods -A       &lt;span class="c"&gt;# no&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every one of those printed &lt;code&gt;no&lt;/code&gt;. And the reads that should work, do — the actual&lt;br&gt;
API server responses, not a promise:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl get pods -n k28agent
&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./agent.kubeconfig kubectl get nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME     READY   STATUS    RESTARTS   AGE
target   1/1     Running   0          39s
NAME                        STATUS   ROLES           AGE   VERSION
glance-blog-control-plane   Ready    control-plane   31d   v1.36.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why the API server, and not the agent's "read-only mode"
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdgedurggzdsbptm47lqv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdgedurggzdsbptm47lqv.png" alt="Sequence of an AI agent calling kubectl, the API server authenticating the token then authorising the verb against RBAC, and returning the object or 403" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many agents and MCP servers advertise a "read-only mode". Understand where it sits.&lt;br&gt;
That mode is a client-side gate: it decides whether the agent &lt;em&gt;sends&lt;/em&gt; a mutating&lt;br&gt;
request. It runs inside the process, before anything reaches the network. RBAC runs&lt;br&gt;
on the API server, after the request arrives, and it is the only thing that decides&lt;br&gt;
whether a request that &lt;em&gt;was&lt;/em&gt; sent takes effect.&lt;/p&gt;

&lt;p&gt;The two are not substitutes, because the failure modes that matter are exactly the&lt;br&gt;
ones a client-side gate cannot cover — a bug in the gate, a prompt injection that&lt;br&gt;
talks the agent past it, a tool the wrapper did not know mutates, a future version&lt;br&gt;
that changes the default. A client-side switch is a promise made by the code you&lt;br&gt;
are trusting not to have a bug. A token that cannot write is a fact, enforced by a&lt;br&gt;
component that is not the agent and does not run the agent's code. Set the agent's&lt;br&gt;
read-only mode as well by all means — defence in depth is real — but the boundary&lt;br&gt;
is the token. If &lt;code&gt;kubectl auth can-i --list&lt;/code&gt; says the identity cannot write, it&lt;br&gt;
cannot write, no matter what the agent tries to send.&lt;/p&gt;

&lt;p&gt;(This is a claim about mechanism, not about any specific product. If a particular&lt;br&gt;
MCP server's read-only mode does more than gate outbound calls, check its&lt;br&gt;
documentation — the general point is that no client-side control can be stronger&lt;br&gt;
than the RBAC behind it.)&lt;/p&gt;
&lt;h2&gt;
  
  
  Verbs that look like reads and are not
&lt;/h2&gt;

&lt;p&gt;A read-only role is not finished when you have removed &lt;code&gt;delete&lt;/code&gt;. Several&lt;br&gt;
subresources are reached with verbs that look harmless, and a few have a quirk on&lt;br&gt;
current Kubernetes worth checking against your own cluster with &lt;code&gt;can-i&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pods/exec&lt;/code&gt;&lt;/strong&gt; opens a shell in a container — total control of the workload. It
is created, not read, so the role above cannot reach it. But there is a subtlety:
since the exec transport moved to a &lt;code&gt;GET&lt;/code&gt;-initiated WebSocket upgrade, a role
granting &lt;code&gt;get pods/exec&lt;/code&gt; reports &lt;code&gt;can-i get pods --subresource=exec&lt;/code&gt; as &lt;code&gt;yes&lt;/code&gt;,
which looks alarming. On 1.36 it is not sufficient on its own: the feature gate
&lt;code&gt;AuthorizePodWebsocketUpgradeCreatePermission&lt;/code&gt; (Beta, on by default since 1.35 —
verified on 1.36.1, source-checked on
&lt;a href="https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.36/pkg/features/kube_features.go#L1273" rel="noopener noreferrer"&gt;release-1.36&lt;/a&gt;)
forces an additional &lt;code&gt;create&lt;/code&gt; check on the upgrade. An identity with only &lt;code&gt;get&lt;/code&gt;
on the subresource gets &lt;code&gt;403 ... cannot create resource "pods/exec"&lt;/code&gt; when it
actually tries. The safe rule is unchanged: grant neither &lt;code&gt;get&lt;/code&gt; nor &lt;code&gt;create&lt;/code&gt; on
&lt;code&gt;pods/exec&lt;/code&gt;, &lt;code&gt;pods/attach&lt;/code&gt; or &lt;code&gt;pods/portforward&lt;/code&gt;, and confirm with &lt;code&gt;can-i&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pods/portforward&lt;/code&gt;&lt;/strong&gt; gives network reach to anything the pod can reach, from the
agent's host. &lt;code&gt;create&lt;/code&gt;, and excluded here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;nodes/proxy&lt;/code&gt;&lt;/strong&gt; is the sharp one. &lt;code&gt;get nodes/proxy&lt;/code&gt; proxies straight to the
kubelet API, which can run exec on any pod on that node — so a role with
&lt;code&gt;get nodes&lt;/code&gt; and &lt;code&gt;get nodes/proxy&lt;/code&gt; is effectively exec-everywhere, dressed as a
read. The role above grants &lt;code&gt;get nodes&lt;/code&gt; but deliberately not &lt;code&gt;nodes/proxy&lt;/code&gt;;
&lt;code&gt;kubectl auth can-i get nodes --subresource=proxy&lt;/code&gt; returns &lt;code&gt;no&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;serviceaccounts/token&lt;/code&gt;&lt;/strong&gt; lets the holder mint tokens for other ServiceAccounts
in scope, including more privileged ones — a direct escalation. &lt;code&gt;create&lt;/code&gt;, and not
granted; &lt;code&gt;can-i create serviceaccounts --subresource=token -A&lt;/code&gt; returns &lt;code&gt;no&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every one of those &lt;code&gt;no&lt;/code&gt; answers came out of &lt;code&gt;kubectl auth can-i&lt;/code&gt; against the real&lt;br&gt;
role on 1.36.1. When you audit any role that calls itself read-only, grep for&lt;br&gt;
&lt;code&gt;exec&lt;/code&gt;, &lt;code&gt;attach&lt;/code&gt;, &lt;code&gt;portforward&lt;/code&gt;, &lt;code&gt;proxy&lt;/code&gt; and &lt;code&gt;token&lt;/code&gt; before you grep for &lt;code&gt;delete&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Handing it to the agent
&lt;/h2&gt;

&lt;p&gt;The agent needs one environment variable pointing at the file. However you launch&lt;br&gt;
it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/agent.kubeconfig claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or set it in the shell the agent inherits. It will pick up the context, act as&lt;br&gt;
&lt;code&gt;system:serviceaccount:k28agent:coding-agent&lt;/code&gt;, and get a &lt;code&gt;403&lt;/code&gt; the instant it tries&lt;br&gt;
to write — the same &lt;code&gt;403&lt;/code&gt; that kubectl, KubeGlance, or anything else holding that&lt;br&gt;
file would get. That symmetry is the point: the security review of any tool you&lt;br&gt;
point at a cluster is &lt;code&gt;kubectl auth can-i --list&lt;/code&gt; with its credentials, and the&lt;br&gt;
answer is the same whoever is asking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preventing the quiet re-widening
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep the kubeconfig separate and mode &lt;code&gt;600&lt;/code&gt;.&lt;/strong&gt; It is a bearer credential. If you
ever do merge kubeconfigs, know which file wins — see
&lt;a href="https://kubeglance.com/blog/kubeconfig-merge-rules/" rel="noopener noreferrer"&gt;how KUBECONFIG merges multiple files&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-run &lt;code&gt;can-i --list&lt;/code&gt; after anyone touches RBAC.&lt;/strong&gt; The &lt;code&gt;view&lt;/code&gt;-family roles are
aggregated and can be widened cluster-wide by an unrelated change; the same
auditing that applies to human roles applies here, and it is covered in
&lt;a href="https://kubeglance.com/blog/kubernetes-read-only-rbac/" rel="noopener noreferrer"&gt;RBAC for a read-only Kubernetes user&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prefer a fresh short token over a long-lived one.&lt;/strong&gt; A token minted with
&lt;code&gt;--duration&lt;/code&gt; expires on its own. A Secret-backed token is a credential you now own
forever.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not scope down by editing the file.&lt;/strong&gt; A kubeconfig grants nothing by itself;
the identity inside it does. Issue a narrower identity instead, as in
&lt;a href="https://kubeglance.com/blog/kubeconfig-scope-down/" rel="noopener noreferrer"&gt;what a kubeconfig actually grants&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The honest version of a read-only guarantee is not a setting in the agent. It is a&lt;br&gt;
token the API server will not let write, and one command that proves it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How are you scoping your agents' cluster access?&lt;/strong&gt; A ServiceAccount like this, an MCP server, or just trusting the agent's own read-only mode?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://kubeglance.com/blog/ai-agent-read-only-kubernetes-access/" rel="noopener noreferrer"&gt;kubeglance.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>ai</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>I let AI agents write my Kubernetes blog. A testbed rule keeps them from being confidently wrong</title>
      <dc:creator>Dmitry Matyukhin</dc:creator>
      <pubDate>Mon, 30 Nov 2026 20:49:26 +0000</pubDate>
      <link>https://dev.to/fancyapps/i-let-ai-agents-write-my-kubernetes-blog-a-testbed-rule-keeps-them-from-being-confidently-wrong-3b3b</link>
      <guid>https://dev.to/fancyapps/i-let-ai-agents-write-my-kubernetes-blog-a-testbed-rule-keeps-them-from-being-confidently-wrong-3b3b</guid>
      <description>&lt;p&gt;I build a Kubernetes client, and its blog is written by AI agents. Not "AI-assisted": agents pick the topics from Search Console data, write the articles, draw the diagrams, run the build and deploy it. Around 40 troubleshooting posts so far.&lt;/p&gt;

&lt;p&gt;Without one rule the whole thing would be worthless: &lt;strong&gt;no claim gets published until an agent has reproduced it on a real cluster.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's why that rule exists, and what it caught this month alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents are confident, not correct
&lt;/h2&gt;

&lt;p&gt;Kubernetes troubleshooting is full of plausible-sounding answers that are wrong in a small, important way. LLMs are very good at producing exactly those. So every article in the pipeline goes through the same loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Spin up a throwaway namespace on a local kind cluster (Kubernetes 1.36).&lt;/li&gt;
&lt;li&gt;Break the thing for real: apply the bad policy, the missing ConfigMap, the RWO volume on a rolling update.&lt;/li&gt;
&lt;li&gt;Capture the actual output, error strings, timings, &lt;code&gt;kubectl&lt;/code&gt; columns, and only then write the article around it.&lt;/li&gt;
&lt;li&gt;Delete the namespace.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The article quotes the real output, not what the model expects the output to look like.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the testbed caught (just this month)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A wrong answer, then a wrong fix.&lt;/strong&gt; An older article said &lt;code&gt;kubectl get pods&lt;/code&gt; shows the STATUS of the &lt;em&gt;last&lt;/em&gt; container in the pod. A reviewing agent read the printer source, saw the loop runs backwards, and concluded the &lt;em&gt;first&lt;/em&gt; container in spec order wins. Also plausible. The testbed said both were wrong: swapping container order in the spec changed nothing, renaming the containers flipped the result. The kubelet sorts container statuses &lt;strong&gt;by name&lt;/strong&gt; before the API server prints the table. Two confident readings of the source, both wrong, caught by a five-minute experiment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A claim about Helm that wasn't true.&lt;/strong&gt; A draft said &lt;code&gt;helm get manifest&lt;/code&gt; shows everything a release installed. Running it showed hooks are left out. Fixed before publishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A competitor comparison that had gone stale.&lt;/strong&gt; Our comparison pages make claims about other tools. A re-check against each vendor's own site found one tool's pricing had completely changed since we wrote the page. Now every comparison claim carries a "checked on" date and a source, and anything we can't verify gets removed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other guardrails
&lt;/h2&gt;

&lt;p&gt;The testbed is the big one, but the build refuses to ship without a few more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Front matter gates:&lt;/strong&gt; title and description lengths, a hero image present, dates sane.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diagram checks:&lt;/strong&gt; every diagram the article references must exist and render.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screenshot registry:&lt;/strong&gt; app screenshots must map to a real, current screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editorial checks:&lt;/strong&gt; a statistic with no link next to it gets flagged; a leftover "verify before publishing" marker fails the build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No made-up experience:&lt;/strong&gt; an article can say "on our cluster" only if it happened on our cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the agents don't grade their own homework on traffic either: they pull Search Console every month, and if a page gets impressions but no clicks, the fix is a better title, not another article.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell anyone doing this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Make the cluster the source of truth, not the model.&lt;/strong&gt; If a claim can be reproduced, reproduce it. If it can't, cite the primary source and say it wasn't reproduced.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expect the second answer to be wrong too.&lt;/strong&gt; The STATUS case wasn't a one-off; "fixes" from reading code are just as confident as the original mistake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gate the boring stuff in CI.&lt;/strong&gt; Most embarrassing errors are mechanical: broken images, stale facts, missing sources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post itself was drafted by the same agents, and checked against the commits and test outputs it describes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you run AI agents near production or near your docs: what's your equivalent of the testbed?&lt;/strong&gt; I'd love to know how others stop them from being confidently wrong.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>kubernetes</category>
      <category>devops</category>
    </item>
    <item>
      <title>Default-deny egress silently breaks DNS. I timed how each client fails (Go waits 40s)</title>
      <dc:creator>Dmitry Matyukhin</dc:creator>
      <pubDate>Mon, 30 Nov 2026 20:49:01 +0000</pubDate>
      <link>https://dev.to/fancyapps/default-deny-egress-silently-breaks-dns-i-timed-how-each-client-fails-go-waits-40s-5do2</link>
      <guid>https://dev.to/fancyapps/default-deny-egress-silently-breaks-dns-i-timed-how-each-client-fails-go-waits-40s-5do2</guid>
      <description>&lt;p&gt;We recently rolled out default-deny NetworkPolicies on our production cluster. The classic way that goes wrong is DNS: egress gets locked down, CoreDNS is forgotten, every pod stays &lt;code&gt;Running&lt;/code&gt; and &lt;code&gt;Ready&lt;/code&gt;, and nothing logs a dropped packet. The app just starts throwing confusing errors, and each client fails differently and at a different speed. So I reproduced it on a clean cluster and timed every client. Here's what I found, plus the fix and the two fixes that look right but aren't.&lt;/p&gt;




&lt;p&gt;If every name lookup in a namespace started timing out right after someone&lt;br&gt;
applied a NetworkPolicy, the policy cut off DNS. A pod that a policy isolates for&lt;br&gt;
egress may only send traffic the policies list, and a default-deny lists nothing,&lt;br&gt;
so lookups to CoreDNS count too. Every query is dropped, the resolver waits out&lt;br&gt;
its timeouts, and the application reports a name it cannot resolve. Pods carry on&lt;br&gt;
&lt;code&gt;Running&lt;/code&gt; and &lt;code&gt;Ready&lt;/code&gt; the whole time.&lt;/p&gt;

&lt;p&gt;The fix is one more policy: allow egress to the CoreDNS &lt;strong&gt;pods&lt;/strong&gt;, on port 53,&lt;br&gt;
over &lt;strong&gt;UDP and TCP&lt;/strong&gt;. Two versions of it look right and do not work. Both are&lt;br&gt;
below.&lt;/p&gt;
&lt;h2&gt;
  
  
  The fastest check
&lt;/h2&gt;

&lt;p&gt;Run a lookup from inside an affected pod:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; -n shop deploy/checkout -- nslookup payments
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Kubernetes 1.36.1 with Calico 3.31.4 (Canal), after a default-deny egress&lt;br&gt;
policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;;; communications error to 10.96.0.10#53: timed out
;; communications error to 10.96.0.10#53: timed out
;; communications error to 10.96.0.10#53: timed out
;; no servers could be reached
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same failure, in the words of whatever is asking:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Client&lt;/th&gt;
&lt;th&gt;What it prints&lt;/th&gt;
&lt;th&gt;Time to fail&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Go program (&lt;code&gt;net&lt;/code&gt; resolver)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lookup payments on 10.96.0.10:53: read udp 10.244.1.7:38923-&amp;gt;10.96.0.10:53: i/o timeout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;40.0 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;curl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;curl: (6) Could not resolve host: payments&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;11.3 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;getent hosts payments&lt;/code&gt; (glibc)&lt;/td&gt;
&lt;td&gt;nothing; exit status 2&lt;/td&gt;
&lt;td&gt;10.0 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;dig&lt;/code&gt; / &lt;code&gt;nslookup&lt;/code&gt; (BIND 9.18)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;;; communications error to 10.96.0.10#53: timed out&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;15.0 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;busybox &lt;code&gt;nslookup&lt;/code&gt; (in an ephemeral container)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;;; connection timed out; no servers could be reached&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A Go service usually prints that line with its own prefix, such as&lt;br&gt;
&lt;code&gt;dial tcp: lookup payments on 10.96.0.10:53: …&lt;/code&gt;. The part to recognise is a&lt;br&gt;
&lt;em&gt;read&lt;/em&gt; that timed out against your cluster DNS address on port 53.&lt;/p&gt;

&lt;p&gt;Then compare what you see with what the cluster says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods -n shop
kubectl get networkpolicy -n shop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                        READY   STATUS    RESTARTS   AGE
checkout-67779ccf47-8m59d   1/1     Running   0          8m55s
payments-6b46c5746-2j4v6    1/1     Running   0          8m55s

NAME                  POD-SELECTOR   AGE
default-deny-egress   &amp;lt;none&amp;gt;         8m43s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything is green, and there is a policy with an empty pod selector. That&lt;br&gt;
combination is the answer. A pod that stays &lt;code&gt;Ready&lt;/code&gt; while its application cannot&lt;br&gt;
reach anything is a family of problems of its own, covered in&lt;br&gt;
&lt;a href="https://kubeglance.com/blog/pod-running-not-ready/" rel="noopener noreferrer"&gt;pod Running but not Ready&lt;/a&gt;. Here the probe passes&lt;br&gt;
because the kubelet's probe comes &lt;em&gt;in&lt;/em&gt; to the pod, and the policy only restricts&lt;br&gt;
what goes &lt;em&gt;out&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If the image has no shell or no lookup tools, an ephemeral container shares the&lt;br&gt;
pod's network namespace, so the same policy applies to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl debug -n shop checkout-67779ccf47-8m59d --profile=general --image=busybox:1.37 \
  -c dnscheck -- nslookup payments.shop.svc.cluster.local
kubectl logs -n shop checkout-67779ccf47-8m59d -c dnscheck
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;kubectl debug&lt;/code&gt; needs a pod name. It rejects &lt;code&gt;deploy/checkout&lt;/code&gt; with&lt;br&gt;
&lt;code&gt;"apps/v1, Kind=Deployment" not supported by debug&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;The Kubernetes documentation says it in a caution box under&lt;br&gt;
&lt;a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#default-deny-all-egress-traffic" rel="noopener noreferrer"&gt;Default deny all egress traffic&lt;/a&gt;:&lt;br&gt;
"A default deny-all egress policy also blocks DNS traffic." The policy that&lt;br&gt;
causes it is the one most guides start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default-deny-egress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shop&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;podSelector: {}&lt;/code&gt; selects every pod in the namespace. &lt;code&gt;policyTypes: [Egress]&lt;/code&gt; with&lt;br&gt;
no &lt;code&gt;egress&lt;/code&gt; rules isolates them for egress and allows nothing. NetworkPolicies are&lt;br&gt;
additive allow lists: once a pod is isolated, a connection passes only if some&lt;br&gt;
policy that selects the pod allows it. A DNS query is a connection like any&lt;br&gt;
other.&lt;/p&gt;

&lt;p&gt;What makes it confusing is how the failure looks from inside the pod:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc94c2l27b0s4rg3qpo4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc94c2l27b0s4rg3qpo4u.png" alt="Sequence of a DNS lookup from an egress-isolated pod: the resolver sends UDP to the kube-dns Service IP, kube-proxy rewrites the destination to a CoreDNS pod IP, the network plugin finds no rule allowing it and drops the packet silently, and the resolver times out and retries before the app reports that the name could not be resolved" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Three details in that sequence explain everything you see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The drop is silent.&lt;/strong&gt; No ICMP error and no TCP reset come back, so the
resolver cannot tell a blocked query from a slow server. It waits the whole
timeout and retries. glibc's defaults are a 5-second &lt;code&gt;timeout&lt;/code&gt; and 2 &lt;code&gt;attempts&lt;/code&gt;
(&lt;a href="https://man7.org/linux/man-pages/man5/resolv.conf.5.html" rel="noopener noreferrer"&gt;resolv.conf(5)&lt;/a&gt;),
which is the 10 seconds &lt;code&gt;getent&lt;/code&gt; took above. Go's resolver does not stop at
the first timeout: it moves on through the &lt;code&gt;ndots:5&lt;/code&gt; search list, and took 40
seconds to give up on one short name. Each request that needs a fresh
lookup pays those seconds before it fails, so the first symptom is often
latency or upstream timeouts rather than a clear error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The pod looks healthy.&lt;/strong&gt; Nothing in the pod's status reflects which policies
select it. If the application exits when a lookup fails at startup, you get
&lt;a href="https://kubeglance.com/blog/crashloopbackoff/" rel="noopener noreferrer"&gt;CrashLoopBackOff&lt;/a&gt; instead, and the logs say "could not
resolve", which reads like a DNS outage rather than a policy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The destination has already been rewritten.&lt;/strong&gt; The pod sends to the kube-dns
Service IP (&lt;code&gt;10.96.0.10&lt;/code&gt; here), and kube-proxy translates that to one CoreDNS
pod's IP before the packet leaves the node. On Canal the policy is checked after
that rewrite. That is why the first "obvious" fix below does nothing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The fix: allow egress to the CoreDNS pods, UDP and TCP
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;allow-dns&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shop&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
  &lt;span class="na"&gt;egress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespaceSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;kubernetes.io/metadata.name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
      &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;k8s-app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-dns&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;UDP&lt;/span&gt;
      &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;53&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
      &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;53&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Apply it next to the default-deny, not instead of it. Policies add up, so the&lt;br&gt;
deny still blocks everything else. On the same cluster, a minute later:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;$ dig +short payments.shop.svc.cluster.local
10.96.217.27
$ dig +tcp +short payments.shop.svc.cluster.local
10.96.217.27
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What each part does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;kubernetes.io/metadata.name: kube-system&lt;/code&gt;&lt;/strong&gt; selects the namespace by name.
The control plane sets this label on every namespace, and you cannot remove or
change it
(&lt;a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#targeting-a-namespace-by-its-name" rel="noopener noreferrer"&gt;Targeting a Namespace by its name&lt;/a&gt;).
Any other namespace label is one somebody has to remember to add.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;namespaceSelector&lt;/code&gt; and &lt;code&gt;podSelector&lt;/code&gt; in the same list item&lt;/strong&gt; means &lt;em&gt;pods
labelled &lt;code&gt;k8s-app=kube-dns&lt;/code&gt; in &lt;code&gt;kube-system&lt;/code&gt;&lt;/em&gt;. Written as two items (a &lt;code&gt;-&lt;/code&gt; in
front of each), they would mean &lt;em&gt;anything in &lt;code&gt;kube-system&lt;/code&gt;, or any pod
labelled &lt;code&gt;k8s-app=kube-dns&lt;/code&gt; in this namespace&lt;/em&gt;, which is a different and much
wider rule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;k8s-app: kube-dns&lt;/code&gt;&lt;/strong&gt; is the label kubeadm, kind and most distributions give
the CoreDNS pods. The Service is named &lt;code&gt;kube-dns&lt;/code&gt; for historical reasons. Check
yours before relying on it:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  kubectl get svc -n kube-system kube-dns -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.spec.selector}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whatever that prints is what the rule's &lt;code&gt;podSelector&lt;/code&gt; must say.&lt;/p&gt;

&lt;p&gt;Once DNS works, the error changes. The same &lt;code&gt;curl&lt;/code&gt; now fails with&lt;br&gt;
&lt;code&gt;curl: (28) Connection timed out after 10003 milliseconds&lt;/code&gt;. That one is the&lt;br&gt;
default-deny doing its job on the actual connection to &lt;code&gt;payments&lt;/code&gt;, which needs&lt;br&gt;
its own allow rule.&lt;/p&gt;
&lt;h2&gt;
  
  
  The fixes that look right and do not work
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Allowing the Service IP with ipBlock
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;egress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ipBlock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;cidr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.96.0.10/32&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;On our Canal cluster this left every lookup timing out, exactly as before. The&lt;br&gt;
policy sees the CoreDNS pod's address, not &lt;code&gt;10.96.0.10&lt;/code&gt;. The Kubernetes docs do&lt;br&gt;
not promise either behaviour: whether address rewriting "happens before or after&lt;br&gt;
NetworkPolicy processing" is not defined, and "may be different for different&lt;br&gt;
combinations of network plugin, cloud provider, &lt;code&gt;Service&lt;/code&gt; implementation"&lt;br&gt;
(&lt;a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="noopener noreferrer"&gt;Network Policies&lt;/a&gt;).&lt;br&gt;
A rule that selects the DNS pods works on any plugin. A rule for the Service IP&lt;br&gt;
works on some.&lt;/p&gt;
&lt;h3&gt;
  
  
  UDP only
&lt;/h3&gt;

&lt;p&gt;The same rule with only the UDP port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dig +short payments.shop.svc.cluster.local
10.96.217.27
$ dig +tcp +short payments.shop.svc.cluster.local
;; Connection to 10.96.0.10#53(10.96.0.10) for payments.shop.svc.cluster.local failed: timed out.
;; no servers could be reached
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most lookups go over UDP, so this passes a quick test. A response too large for&lt;br&gt;
a UDP packet, such as a long list of addresses for a headless Service, comes back&lt;br&gt;
truncated, and the resolver then asks again over TCP. That TCP query is blocked,&lt;br&gt;
so the failure only appears for some names, some of the time.&lt;br&gt;
&lt;a href="https://www.rfc-editor.org/rfc/rfc7766#section-5" rel="noopener noreferrer"&gt;RFC 7766&lt;/a&gt; is blunt about it:&lt;br&gt;
"All general-purpose DNS implementations MUST support both UDP and TCP&lt;br&gt;
transport." Allow both.&lt;/p&gt;
&lt;h3&gt;
  
  
  Forgetting the other end
&lt;/h3&gt;

&lt;p&gt;A policy in your own namespace is not the only one that can cut DNS. A&lt;br&gt;
default-deny for &lt;em&gt;ingress&lt;/em&gt; in &lt;code&gt;kube-system&lt;/code&gt; isolates the CoreDNS pods, and&lt;br&gt;
breaks DNS for every namespace in the cluster, including ones with no policies&lt;br&gt;
at all. From a namespace without a single policy, after&lt;br&gt;
&lt;code&gt;default-deny-ingress&lt;/code&gt; was applied in &lt;code&gt;kube-system&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dig +short +time=2 +tries=1 web.np-b.svc.cluster.local
;; communications error to 10.96.0.10#53: timed out
;; no servers could be reached
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you lock down &lt;code&gt;kube-system&lt;/code&gt;, the CoreDNS pods need an ingress rule allowing&lt;br&gt;
UDP and TCP 53 from every namespace (&lt;code&gt;namespaceSelector: {}&lt;/code&gt;).&lt;/p&gt;
&lt;h2&gt;
  
  
  Finding it before it bites
&lt;/h2&gt;

&lt;p&gt;There is no &lt;code&gt;kubectl&lt;/code&gt; view of "which pods are egress-isolated without DNS", but&lt;br&gt;
the policies themselves hold enough to narrow it down. This lists every policy&lt;br&gt;
that restricts egress, with the DNS protocols it allows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get networkpolicy -A -o json &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.items[]
  | select(any(.spec.policyTypes[]?; . == "Egress"))
  | [.metadata.namespace, .metadata.name,
     ([.spec.egress[]?.ports[]? | select(.port == 53 or .port == "dns" or .port == "dns-tcp") | .protocol // "TCP"]
      | unique | join(",") | if . == "" then "-" else . end)]
  | @tsv'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; column -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shop  allow-dns            TCP,UDP
shop  default-deny-egress  -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A namespace whose lines all end in &lt;code&gt;-&lt;/code&gt; restricts egress and allows DNS nowhere.&lt;br&gt;
That is a strong hint, not a proof. Policies select pods by label, so an allow&lt;br&gt;
rule can exist and still miss the pod that needs it, and a rule with no &lt;code&gt;ports&lt;/code&gt;&lt;br&gt;
allows every port to its peers. The proof is a lookup from the pod itself, as in&lt;br&gt;
the first section. Run it after every policy change, not only when something&lt;br&gt;
breaks.&lt;/p&gt;

&lt;p&gt;KubeGlance (the Kubernetes client I build) runs this check for you. Its network policy coverage view works out which pods every policy selects, and flags any workload that egress isolation has cut off from the cluster's DNS pods, naming the policy responsible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you hit this with a client I didn't test?&lt;/strong&gt; Java and Node are the ones I'm most curious about. Java's resolver caching should make it even harder to spot.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://kubeglance.com/blog/networkpolicy-default-deny-dns-timeout/" rel="noopener noreferrer"&gt;kubeglance.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>networking</category>
      <category>dns</category>
    </item>
  </channel>
</rss>
