Skip to content

Add Kubernetes manifest validation CI workflow #99

@KaranJagtiani

Description

@KaranJagtiani

The Kubernetes YAML manifests in deployment/ are not validated in CI. Invalid manifests, deprecated API versions, or security misconfigurations can reach the main branch without detection.

Scope

  • CI (.github/workflows/k8s-validate.yml):
    • Trigger on pull requests that modify files in deployment/.
    • Steps:
      1. Install kubeval or kubeconform for schema validation.
      2. Install kube-score for best-practice scoring.
      3. Validate all YAML files in deployment/ against the Kubernetes API schema.
      4. Run kube-score to check for security and reliability best practices.
      5. Fail on schema errors; warn on best-practice violations.

Acceptance criteria

  • CI workflow validates all Kubernetes manifests on relevant PRs.
  • Invalid YAML or deprecated API versions fail the workflow.
  • Best-practice violations are reported as warnings.
  • Workflow is fast (< 2 minutes).

How to test manually

  1. Create a PR that modifies a file in deployment/.
  2. Verify the CI workflow triggers and validates the manifests.
  3. Introduce an invalid resource spec and verify the workflow fails.
  4. Fix the issue and verify the workflow passes.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions