k8s-piper
A tool for extracting key information from kubectl commands and displaying it in an easy-to-digest way.
k8s-piper automatically detects the Kubernetes resource type from piped kubectl output and runs the appropriate analysis — no flags required.
Supported Resources
| Resource Kind | Analysis |
|---|---|
ConfigMap, Secret |
X.509 certificate extraction and analysis |
Deployment, StatefulSet, DaemonSet, Pod, Job, CronJob, ReplicaSet |
Container images, resource requests/limits, security contexts |
Role, ClusterRole |
RBAC policy rules with wildcard/danger highlighting |
RoleBinding, ClusterRoleBinding |
Role reference and subject bindings |
Usage
Pipe any supported kubectl resource into k8s-piper — the kind is detected automatically:
# Certificate analysis (ConfigMap or Secret)
kubectl get cm ca -n mynamespace -o yaml | k8s-piper
kubectl get secret mycerts -n mynamespace -o yaml | k8s-piper
# Workload analysis — images, resources, security (Deployment, Pod, StatefulSet, …)
kubectl get deploy myapp -n mynamespace -o yaml | k8s-piper
kubectl get pod mypod-abc123 -n mynamespace -o yaml | k8s-piper
kubectl get statefulset mydb -n mynamespace -o yaml | k8s-piper
# RBAC analysis (Role, ClusterRole, RoleBinding, ClusterRoleBinding)
kubectl get clusterrole cluster-admin -o yaml | k8s-piper
kubectl get rolebinding myrb -n mynamespace -o yaml | k8s-piper
What Each Analysis Shows
Certificates (ConfigMap / Secret)
- Subject, Issuer, and Subject Alternative Names
- Validity period with expiry warnings (⚠ < 30 days, 🔴 < 7 days)
- Key type, size, and signature algorithm
- Key Usage and Extended Key Usage
- OCSP / CRL revocation URLs and Must-Staple flag
- SHA-256 and SHA-1 fingerprints
- CA / self-signed status, path length constraint
Workloads (Deployment, Pod, StatefulSet, etc.)
- Images — full image reference, tag or digest, pull policy; flags
latestand untagged images - Resources — CPU and memory requests/limits per container; flags missing limits
- Security Contexts — pod-level and per-container security settings; flags dangerous values such as
privileged: true,allowPrivilegeEscalation: true, and added capabilities
RBAC (Role / ClusterRole)
- Policy rules table: API groups × resources × verbs
- Wildcard verbs (
*) and wildcard resources highlighted in red - Rules granting full wildcard access flagged as dangerous
RBAC (RoleBinding / ClusterRoleBinding)
- Role reference (kind and name)
- Subjects table: service accounts, users, and groups
Installation
pip install k8s-piper
Or install from source:
git clone https://github.com/tkdpython/k8s-piper.git
cd k8s-piper
pip install -e .
Metadata
Release files for k8s-piper 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| k8s_piper-0.3.0.tar.gz | 28.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| k8s_piper-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.5 kB
Release files / k8s_piper-0.3.0.tar.gz
| Download URL | k8s_piper-0.3.0.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0c8e2eb1e4fe17d381cc5891756a4fbceea273e0afef67e60f8ac297747f822
|
|
BLAKE2b-256 checksum How to use checksums |
743213e4f68e9c2817f089f51920a8ee51022a75cd17795987d02f1fc61398dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency logRelease files / k8s_piper-0.3.0-py3-none-any.whl
| Download URL | k8s_piper-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95254a796dcb045281ce6fbf128da019c2f98a52553ac9a604bbe0368d7affb0
|
|
BLAKE2b-256 checksum How to use checksums |
6c193fbd98b65dc5ff1403f65d0a4f5e11280c5b23284bbb91262186236163a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency log