Skip to content

Instantly share code, notes, and snippets.

@znd4
Created July 11, 2025 16:58
Show Gist options
  • Save znd4/647aed8a047c555e3371eec84373b8ec to your computer and use it in GitHub Desktop.
Save znd4/647aed8a047c555e3371eec84373b8ec to your computer and use it in GitHub Desktop.
vendoring CRDs from your kuberrnetes cluster to cue modules with timoni
# assumes you've `mkdir -p my_module && cd my_module && cue mod init`
export module=my_module \
group=domain.foo.com \
version=v1alpha1
crds=$(mktemp)
kubectl get crd -o yaml \
| yq '
.items[]
| select(
.spec.group == strenv(group)
and (.spec.versions[] | select(.name == strenv(version)))
) | split_doc
' > $crds
timoni mod vendor crd $module -f $crds
@brandonjbjelland
Copy link

Ooooo this is nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment