Skip to content

bluebrown/krm-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KRM Filter

This mono repo contains krm filter (functions) that conform to the krm functions spec.

These filter can be used as standalone or managed by tools that support krm filter. Currently known tools are kustomize and kpt.

Example

kustomize fn run --image bluebrown/kubeaudit-fix dir/

Standalone

The filter can be run in standalone mode since they are wrapped as cobra commands.

Keep in mind that you MUST provide a config as first positional argument for each filter.

cat resources.yaml \
  | kubeconform schema-conf.yaml - \
  | kubeadit-fix audit-conf.yaml - \
  | kubeadit audit-conf.yaml - \

Resource List

With the help of some tools, i.e. kpt, which can generate a resource list, the filter can be chained together as well.

kpt fn source inputdir \
  | kubeconform \
  | kubeaudit-fix \
  | kubeaudit \
  | kpt fn sink outputdir

However, this way, there is no way of providing the function config. So it if that is required it is better to go all in by using kpt fn eval.

kpt fn source inputdir \
  | kpt fn eval - -i ko.local/kubeconform --network -- strict=true \
  | kpt fn eval - -i ko.local/kubeaudit-fix --fn-config audit.yaml \
  | kpt fn eval - -i ko.local/kubeaudit --fn-config audit.yaml \
  | kpt fn sink outputdir

Development

bin/init my-new-filter