<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka" -->

---
title: 5 anti-patterns that cause Kubernetes operator...
description: Five anti-patterns in controller-runtime Kubernetes operators silently create unfiltered cluster-wide informers, causing OOMKill or deadlocks. The patterns...
canonical: https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: 5 anti-patterns that cause Kubernetes operator vulnerabilities | daily.dev
og:description: Five anti-patterns in controller-runtime Kubernetes operators silently create unfiltered cluster-wide informers, causing OOMKill or deadlocks. The patterns...
og:url: https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka
og:image: https://api.daily.dev/og/posts/TJSFjyvka.png
og:image:alt: 5 anti-patterns that cause Kubernetes operator vulnerabilities
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 5 anti-patterns that cause Kubernetes operator vulnerabilities

**[Red Hat Developer](https://daily.dev/sources/rhdev)** · 20 min read · 6 upvotes · 0 comments

## Summary

Five anti-patterns in controller-runtime Kubernetes operators silently create unfiltered cluster-wide informers, causing OOMKill or deadlocks. The patterns are: (1) predicates only filter reconciliation events, not cache storage; (2) DisableFor only affects client.Get/List, not controller builder registrations like Owns() or Watches(); (3) client.Get() on an unlisted type implicitly creates a cluster-wide informer; (4) missing DefaultNamespaces or label selectors defaults to watching all namespaces; (5) mismatched typed vs. unstructured watch/get operations waste cache memory. Each anti-pattern has a concrete fix using ByObject label selectors, DisableFor, uncached API readers, WatchesMetadata, or DefaultNamespaces. A 5-step grep-based audit process and the ReaderFailOnMissingInformer development flag help surface phantom watches before they hit production.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://developers.redhat.com/articles/2026/07/06/5-anti-patterns-cause-kubernetes-operator-vulnerabilities>

## Similar posts on daily.dev

- [Unlocking efficiency: A guide to operator cache configuration on Red Hat OpenShift and Kubernetes](https://daily.dev/posts/unlocking-efficiency-a-guide-to-operator-cache-configuration-on-red-hat-openshift-and-kubernetes-rrynupdxu) · Red Hat Developer · 0 upvotes · 0 comments
- [Protect your Kubernetes Operator from OOMKill](https://daily.dev/posts/protect-your-kubernetes-operator-from-oomkill-to0zvoqps) · Red Hat Developer · 0 upvotes · 0 comments
- [5 Kubernetes YAML Anti-Patterns I Still See in Production \(And How to Fix Them\)](https://daily.dev/posts/5-kubernetes-yaml-anti-patterns-i-still-see-in-production-and-how-to-fix-them--un8co0moc) · Medium · 0 upvotes · 0 comments

---

Tags: [#kubernetes](https://daily.dev/tags/kubernetes), [#golang](https://daily.dev/tags/golang)

[View this post on daily.dev](https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"5 anti-patterns that cause Kubernetes operator vulnerabilities","url":"https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka"},"datePublished":"2026-07-06T07:17:16.813Z","dateModified":"2026-07-06T07:17:47.879Z","description":"Five anti-patterns in controller-runtime Kubernetes operators silently create unfiltered cluster-wide informers, causing OOMKill or deadlocks. The patterns...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"Red Hat Developer","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Red Hat Developer","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/2a8895f3216c4900bdc455585a4ad3e4","url":"https://daily.dev/sources/rhdev"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/5-anti-patterns-that-cause-kubernetes-operator-vulnerabilities-tjsfjyvka","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"kubernetes,golang","timeRequired":"PT20M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Red Hat Developer","item":"https://daily.dev/sources/rhdev"},{"@type":"ListItem","position":3,"name":"5 anti-patterns that cause Kubernetes operator vulnerabilities"}]}
```

