Skip to main content

validating-cross-resource-consistency

Use when reviewing, creating, or modifying Kubernetes manifests that contain multiple resources. Use when Services, Deployments, ConfigMaps, Secrets, RBAC resources, Ingress, Routes, or NetworkPolicies appear together. Use when manifests reference other resources by name, label selector, or service account. Use when debugging why pods aren't receiving traffic, why containers fail to start, or why RBAC permissions aren't working.

소스 정보

저장소
redhat-et/gitops-manifest-validator
최근 소스 활동
2026년 3월 16일 15:34
감지된 SKILL.md 언어
영어
스타
2
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
6 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
validating-cross-resource-consistency
description
Use when reviewing, creating, or modifying Kubernetes manifests that contain multiple resources. Use when Services, Deployments, ConfigMaps, Secrets, RBAC resources, Ingress, Routes, or NetworkPolicies appear together. Use when manifests reference other resources by name, label selector, or service account. Use when debugging why pods aren't receiving traffic, why containers fail to start, or why RBAC permissions aren't working.
# Validating Cross-Resource Consistency ## Overview **Core principle: Every cross-resource reference MUST resolve to an existing resource in the manifest set.** Linters validate individual resources but cannot detect broken links between them. You MUST verify ALL cross-references. Do NOT assume referenced resources "might exist elsewhere." ## Validation Checklist ### 1. Selector Alignment Service/NetworkPolicy/PDB `selector` must match Pod template labels (NOT Deployment metadata labels). Every label key AND value must match exactly. One mismatched character = zero Pods selected. See `references/selector-patterns.md`. ### 2. Name References Every name reference must resolve to a resource in the manifest set. See `references/k8s-resource-references.md` for the complete field-to-resource mapping. Key references to check: - ConfigMap/Secret names in `volumes`, `envFrom`, `env[].valueFrom` - `serviceAccountName` -> ServiceAccount - `imagePullSecrets` -> Secret - Ingress/Route backend -> Service - RoleBinding `subjects` -> ServiceAccount, `roleRef` -> Role ### 3. Port Consistency - Service `targetPort` must match a Pod `containerPort` - Ingress/Route port must match a Service port ### 4. Namespace Consistency All cross-referenced resources must share a namespace (except ClusterRole/ClusterRoleBinding). ### 5. RBAC Chain For every `serviceAccountName`: ServiceAccount must exist, RoleBinding must bind it, Role must exist and grant needed permissions. ## Report Format ``` CROSS-RESOURCE INCONSISTENCY: Source: [kind/name] field [field path] References: [target kind/name] Problem: [mismatch, missing, wrong namespace] Impact: [runtime failure] Fix: [specific correction] ``` ## Red Flags - STOP and Investigate - Selector matching zero Pods - ConfigMap/Secret referenced but not defined - ServiceAccount name not matching any ServiceAccount resource - Ingress/Route pointing to non-existent Service - Ports in Service not matching any container port ## Common Rationalizations to Reject | Excuse | Reality | |--------|---------| | "ConfigMap might exist in the cluster" | Untracked dependency. Flag it. | | "RBAC is handled by cluster admins" | If manifest has serviceAccountName, RBAC chain must be complete. | | "The selector probably works" | Verify character by character. `web-frontend` != `frontend`. | | "External resources are managed separately" | Flag undocumented external dependencies. | | "Each resource looks valid individually" | Individual validity is meaningless if cross-references break. | | "It worked in dev" | Dev has pre-existing resources. Production won't. | | "These are Kustomize bases, overlays add the rest" | Validate what's present. Flag missing resources with note about expected overlay. | | "Helm templates will resolve this" | If reviewing rendered manifests, all references must resolve. If templates, note unresolvable refs. | | "Other manifests exist in another directory" | Validate the set you have. Flag dependencies on external files explicitly. | ## Reference Files | File | Content | |------|---------| | `references/k8s-resource-references.md` | Complete cross-reference field mapping | | `references/selector-patterns.md` | Label selector patterns and common mismatches |
GitHub에서 보기