Skip to content

Kubernetes support: predict deployment failures against a specific cluster - #3

Merged
raphgm merged 4 commits into
mainfrom
feat/k8s
Sep 24, 2026
Merged

raphgm merged 4 commits into
mainfrom
feat/k8s

Conversation

@raphgm

@raphgm raphgm commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Adds container-preflight k8s. It checks Kubernetes manifests against a specific cluster before kubectl apply.

  • Input: YAML files or directories, or helm template / kustomize build output on stdin.
  • Cluster profile: read-only kubectl calls (nodes, API resources, StorageClasses), or a snapshot saved with --save-cluster and used with --cluster.
  • Rules:
    • k8s.api: no matches for kind
    • k8s.image: ErrImagePull / ImagePullBackOff
    • k8s.platform: image architecture vs eligible nodes; local clusters get an emulation warning
    • k8s.schedulable: FailedScheduling with the scheduler's reasons
    • k8s.storage: PVC Pending
  • Root causes: an unreachable cluster or missing RBAC is reported once, through the existing fact graph.

Validation

Checked on minikube: 4 of 5 predictions confirmed, 3 word for word. The miss (emulation on local clusters) is fixed. See docs/validation/2026-09-24-minikube-k8s.md.

Known limitations

  • Capacity is compared with node allocatable; pods already running aren't counted.
  • The ServiceAccount's imagePullSecrets aren't checked.

…cluster

container-preflight k8s reads manifests (files, dirs, or helm/kustomize
output on stdin), profiles a cluster with read-only kubectl calls (or a
saved snapshot) and checks five rules: k8s.api (no matches for kind),
k8s.image (ErrImagePull / ImagePullBackOff), k8s.platform (images that
cannot run on eligible node architectures), k8s.schedulable
(FailedScheduling with the scheduler's reasons) and k8s.storage (PVCs
Pending on missing StorageClasses). Unreachable clusters and missing
RBAC become root causes through the existing fact graph.
…d apiVersion hint

Applying the example manifests to minikube confirmed 4 of 5 predictions
(3 verbatim). The miss: an amd64-only image ran on the arm64 node through
Docker Desktop's emulation. Local clusters now get a warning instead of an
error. The API rule names the served apiVersion for a kind that moved
groups.
@raphgm
raphgm merged commit 2d3cc83 into main Sep 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant