Skip to main content

KA-X006: ServiceAccount reference not found

Warning Cross-Resource

Why This Matters

A workload specifies a serviceAccountName that is not defined in the manifest. If the ServiceAccount does not exist at deploy time, the Pod will fail to be created with a "serviceaccount not found" error. This may be expected if the ServiceAccount is created by a Helm chart or operator.

How to Fix

Add the referenced ServiceAccount to the manifest

Before (incorrect)

spec:
  serviceAccountName: app-sa
  containers:
    - name: app

After (correct)

spec:
  serviceAccountName: app-sa
  containers:
    - name: app
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: app-sa

Rule Details

Rule Code
KA-X006
Severity
Warning
Category
Cross-Resource

Related Rules