k8s-deprec8ions-templ8r

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 12 Imported by: 0

README

k8s-deprec8tions-templ8r

License Badge Version Badge Go Report Card

GHCR Badge DockerHub Badge OCI Badge Snyk Badge

Well that's a stupid name...

Yes, yes it is!

About

A simple tool to render Go templates from deprecations in the Kubernetes API schema.
Useful for crafting things like Rego policies to flag deprecations.

It works by downloading the Swagger file from the Kubernetes repo (version of your choice) and inspecting each API/API property's description field for occurrences of "deprecated". It then provides some abstract objects you can build Go templates around to render this information as you please.

Usage

k8s-deprec8ions-templ8r -version v1.20.2 -template templates/kove.rego.gotmpl

or with the Docker image

docker run --rm -it \
    -v $(pwd)/templates:/kdt/templates \
    ghcr.io/cmacrae/k8s-deprec8ions-templ8r:v0.1.0 \
    -path swagger -version v1.20.2 -template templates/kove.rego.gotmpl

Note: You must use -path swagger with this image

Options
  -force
    	Whether to force download the Kubernetes API Swagger file
  -log-level string
    	Log level. Should be: debug, info, warn, error (default "info")
  -path string
    	Path to read/download the Kubernetes API Swagger file (default same as 'version')
  -template string
    	Path to the template to render
  -version string
    	Kubernetes version to check for deprecations (default "master")

Implementations

Some example templates can be found in the templates/ directory.
The k8s-deprec8ions-templ8r template is used to provide policies for the k8s-deprec8ions-templ8r project: k8s-deprec8ions-templ8r-deprecations

Acknowledgements/Attributions

The meat of this code is based off kubepug, so a big thank you to @rikatz for his work on a great tool!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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