Skip to content

fix(core): Use k8s informers to watch host and network policies#2598

Merged
AryanBakliwal merged 1 commit into
kubearmor:mainfrom
AryanBakliwal:fix-crd-watch-timeout
May 29, 2026
Merged

fix(core): Use k8s informers to watch host and network policies#2598
AryanBakliwal merged 1 commit into
kubearmor:mainfrom
AryanBakliwal:fix-crd-watch-timeout

Conversation

@AryanBakliwal

@AryanBakliwal AryanBakliwal commented May 13, 2026

Copy link
Copy Markdown
Member

Purpose of PR?:
When running in K8s mode, after around 30-40 min. of deploying we get these logs

timeout while monitoring host security policies, kubearmorhostpolicies CRD not found
timeout while monitoring network security policies, kubearmornetworkpolicies CRD not found

Even though the CRDs are present in the cluster. Cause explained here.
This PR fixes this by using K8s informers for watching host and network policies, similar to watching cluster security policies.

Also fixes #1057

Does this PR introduce a breaking change?
No

If the changes in this PR are manually verified, list down the scenarios covered:

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

  • Bug fix. Fixes Deprecate k8s watchers in favor of k8s informers #1057
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

@rksharma95 rksharma95 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a suggestion commented inline.

Comment thread KubeArmor/core/kubeArmor.go Outdated
@AryanBakliwal AryanBakliwal force-pushed the fix-crd-watch-timeout branch from 1471e1d to 2c868c5 Compare May 14, 2026 05:42
@AryanBakliwal AryanBakliwal requested a review from rksharma95 May 14, 2026 05:43
@AryanBakliwal AryanBakliwal force-pushed the fix-crd-watch-timeout branch from 37cac69 to a408505 Compare May 27, 2026 10:23
@AryanBakliwal AryanBakliwal merged commit 94a1838 into kubearmor:main May 29, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate k8s watchers in favor of k8s informers

5 participants