Manifest Query Language

What

A prototype query language for Kubernetes manifests.

Examples

# names of all pods
select 'metadata.name' from 'v1:Pod'

# all pod containers images
select 'spec.containers.*.image' from 'v1:Pod'

# all pod name and images
select 'spec.containers.*.name', 'spec.containers.*.image' from 'v1:Pod'

# nginx pod containers resource requests cpu
select 'spec.containers.*.resources.requests.cpu' from 'v1:Pod' where 'metadata.name' = 'nginx'

Usage

go build -o mql cmd/main.go
./mql /path/to/file.yaml "select 'kind'"

GitHub

View Github