A Kubernetes lib containing definitions for Crystal-lang
0.0.5 Latest release released


A Kubernetes Binding lib for Crystal-lang forked from psykube/pyrite. Forked due to possibly destructive changes to change namespaces and adapt for use with Kube::Client

.github/workflows/ci.yml .github/workflows/docs.yml GitHub release Chat on Telegram

This library contains generated classes for Kubernetes resources for various Kubernetes API versions, as well as a Hashdiff module for comparing hashes of Kubernetes resources.


Add this to your application's shard.yml:

    github: spoved/k8s.cr


View the Documentation for the version you are using:



K8S.cr should support Kubernetes API from 1.11.0 and beyond. In order to use the bindings, you will want to include the VERSION that best maps to your k8s api version. Requiring more than one version at this time will result in an error.

require "k8s/versions/v1.20"

CRD Generation

To generate resources for a CRD, you can use the crd_gen.cr file.

# First dump the CRDs to a file
kubectl get crds -o yaml > crds.yaml

# Then generate the resources
./lib/k8s/bin/gen_crd.cr -- ./crds.yaml <output directory>


  1. Fork it ( https://github.com/spoved/k8s.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  github: spoved/k8s.cr
  version: ~> 0.0.5
Crystal >= 1.2.2, < 2.0.0

Dependencies 1

  • hashdiff ~> 1.0.2
    {'github' => 'spoved/hashdiff.cr', 'version' => '~> 1.0.2'}

Development Dependencies 3

  • any_hash
    {'github' => 'sija/any_hash.cr'}
  • open-api
    {'github' => 'spoved/open-api.cr'}
  • spectator ~> 0.10.1
    {'gitlab' => 'arctic-fox/spectator', 'version' => '~> 0.10.1'}

Dependents 1

Last synced .
search fire star recently