# K8S Logs

> Read-only Kubernetes log and workload investigation skill. Use when users ask an agent to inspect pods, deployments, images, restarts, events, request ids, business ids, or bounded application logs without changing cluster state.

- Skill: `phperkael/k8s-logs` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add phperkael/k8s-logs`
- Raw SKILL.md: https://api.skillmd.com/api/skills/phperkael/k8s-logs/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: PHPerKael (https://skillmd.com/u/phperkael)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/phperkael/k8s-logs

---


# K8s Logs

Use this skill for read-only Kubernetes investigation.

This skill must not restart workloads, delete pods, scale deployments, edit resources, patch config, or mutate data.

## Required Inputs

Before running commands, identify:

- environment
- kubeconfig or context
- namespace
- deployment, pod, or label selector
- request id, business id, endpoint, error marker, or absolute time window

If the user only says "just now" or "today", convert it into an explicit time window before drawing conclusions.

## Workflow

1. Confirm kube context and API server.
2. Confirm namespace and workload.
3. Check deployed image, pod readiness, restart count, node, age, and recent events.
4. Query logs with bounded `--since` or `--since-time`.
5. Search by concrete ids first, then by error markers.
6. For cross-service traces, follow one direction at a time: entry service, handler branch, downstream call, async consumer, owner service.
7. Summarize evidence, missing expected markers, and next decisive check.

## Output

Include:

- environment and namespace
- deployment or pod name
- image tag
- log time window
- matched markers
- suspected failure point
- remaining uncertainty

Redact tokens, cookies, authorization headers, passwords, and personal data.

## References

Read [commands.md](./references/commands.md) for command templates.

