.kubeignore
file to control which Kubernetes resources AI agents should ignore when analyzing your cluster. This file is located at ~/.agentkube/.kubeignore
and follows a simple, line-based syntax similar to .gitignore
.
File Format
- Lines starting with
#
are comments - Blank lines are ignored
- Each rule is one line with a specific syntax pattern
- Globs use
*
,?
, and**
(for file paths)
Rule Types
Rule Type | Syntax | Description |
---|---|---|
Namespace | namespace: <glob> | Ignore any resource in matching namespaces |
Kind | kind: <glob> | Ignore resources by Kubernetes kind |
GVK | gvk: <apiVersion>/<Kind> | Ignore by exact API version and kind |
Name | name: <glob> | Ignore resources by name pattern |
GVKN | gvkn: <apiVersion>/<Kind>/<namespace>/<name> | Ignore specific resource in specific namespace |
Label | label: <key>=<value> | Ignore resources with matching labels |
Annotation | annotation: <key>=<value> | Ignore resources with matching annotations |
File | file: <glob> | Ignore manifest files by path pattern |
Example .kubeignore
How It Works
For each Kubernetes resource, Agentkube builds candidate keys from:metadata.namespace
(defaults todefault
)kind
andapiVersion
metadata.name
- All
metadata.labels
andmetadata.annotations
- Source file path (if applicable)
.kubeignore
matches one of these keys using glob patterns, the resource is ignored by AI agents.
Common Use Cases
Skip System Resources
Skip Sensitive Data
Skip Development Resources
Skip Temporary Resources
.kubeignore
file provides fine-grained control over what resources your AI agents can see and analyze, helping you maintain security and focus on relevant resources.