kubeformat

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

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

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 b64
  • Output in JSON
  • Cleanup out-of-the-box CLI flags
  • Read input from files cat file | kubeformat accomplishes the same
  • Add installation guide
  • Importing custom filters

Usage

kubectl -n default get deployment | kubeformat

Documentation

Overview

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. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
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.
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL