Skip to content

ahmetb/kubectl-fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

108 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-fields

kubectl-fields is a kubectl plugin that annotates Kubernetes YAML object outputs with the manager of each field.

This helps you understand which controller is managing which part of your Kubernetes objects, and understand effects of server-side apply.

Usage

Pipe the output of kubectl get -o yaml --show-managed-fields to kubectl-fields:

kubectl get deploy/my-app -o yaml --show-managed-fields | kubectl fields

Example Output

Installation

For now, get this tool via:

go install github.com/ahmetb/kubectl-fields/cmd/kubectl-fields@latest

and ensure your GOBIN directory (typically ~/go/bin) is in your $PATH.

Features

  • Display separate color for each field manager.
  • Can handle multiple YAML documents or List results from kubectl output.
  • Use --above to add annotations above the fields instead of inline
  • Vertical alignment of YAML comments (the tool still generates valid YAML output)
  • Use --mtime=relative|absolute|hide to show when the field was edited
  • Use --show-operation to also display if it was a Patch or Apply operation.

Development

Use GSD to develop this project and have it reuse existing context/design docs checked into the repo.

About

Show managed fields on Kubernetes objects inline

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors