Skip to main content

KubePattern Smells

The KubePattern analysis results are represented as Smells, which are structured findings that indicate potential issues, anti-patterns, or areas for improvement in your Kubernetes manifests. Each Smell is associated with a specific pattern from the Pattern Registry.

Retrieving Results

Using kubectl

# List all patterns across all namespaces
kubectl get patterns.kubepattern.dev -A

# Short form
kubectl get smells -A

# View details of specific pattern
kubectl describe smells <smell-name> -n <namespace>

# Get as YAML
kubectl get smells <smell-name> -n <namespace> -o yaml

# Filter by field, e.g. severity (requires label)
kubectl get smells -n pattern-analysis-ns --field-selector spec.severity=CRITICAL

KubePattern Smell Custom Resource Definition

Analysis results are stored as Kubernetes Custom Resources:

PropertyDescription
apiVersionAPI version of the Smell CRD (e.g., kubepattern.dev/v1)
kindAlways Smell
metadataStandard Kubernetes metadata (name, namespace, labels, annotations)
specCore specification of the smell, containing detection logic and relationships
spec.suppressboolean
spec.targetDetails about the target resource that triggered the smell (apiVersion, kind, name, namespace, uid)
spec.patternInformation about the pattern that generated the smell (name, version)
spec.referenceLink to documentation for the smell and its remediation
spec.messageCustom message describing the smell
spec.severitySeverity level of the smell (LOW, MEDIUM, HIGH, CRITICAL)
spec.categoryCategory of the smell (e.g., Security, Performance, Maintainability)
spec.nameName of the smell (e.g., "Exposed Service")