# README
kubeformat
Tool to remove junk from kubectl manifests. For those of you who are also tired of kubectl flooding you with useless information. Also my coursework.
Installation
wget link_to_latest_release -O kubeformat
chmod +x kubeformat
mv kubeformat ~/usr/local/bin/kubeformat
Features:
- Cleans up fields using filters defined in cmd/defaults.go or in -p filename. Sample JSON with filters can be found in sample/. Usage:
... | kubeformat -p filepath
. Note that wildcard (*) only works for containers, and you should escape irrelevant dots with \\ - Iterates over containers(container filters are defined with *, "spec.template.spec.containers.*.terminationMessagePath")
- Removes empty fields
- Flattens Lists
Example
TODO
- Improve and unify error handling, right now its a mess
- Add tests
- Refactor function and variable names to be in line with conventions
- Maybe add statefulness (path to filters)
- Add parsing of multiple manifests (--- case)
Maybe add optional secret decoding from b64Output in JSONCleanup out-of-the-box CLI flagsRead input from filescat file | kubeformat accomplishes the sameAdd installation guideImporting custom filters
Usage
kubectl -n default get deployment | kubeformat
# Packages
Package cmd blah
Copyright © 2021 zxcxyz <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.