The Crystal Programming Language Forum

Kubernetes Client - Alpha Release -

Hey all! Just wanted to share that I have released an Alpha version of kube-client a Crystal client for interacting with the Kubernetes API.

This initial release supports the kubernetes api versions 1.11-1.23.

Check it out here: GitHub - spoved/ k8s api client
Report issues here: Issues · spoved/ · GitHub

I hope to continue to develop and improve this client as time goes on. If you are interested please give it a try and report any issues you find.



What you may also want to consider is creating a Podman client/interface.

Podman is a container engine that’s compatible with the OCI Containers.

More information on it.

Having Crystal apps for these Open Source standards can make it a player in these spaces.

Yeah i agree, trying to build tooling as i run into them. Podman is an up and comer now that docker sucks.

I had a look at the shard to see what the experience would be like for building operators (my main use case for creating this Kubernetes client) and I couldn’t get it to load my CRD. The README mentions these two methods, which seem to be intended for that:

  • K8S::Resource.from_file
  • K8S::Resource.from_files

But neither of them exist:

require "./src/kube-client/v1.23"

pp K8S::Resource.from_file("./crd.yaml")
# In

#  3 | pp K8S::Resource.from_file("./crd.yaml")
#                       ^--------
# Error: undefined method 'from_file' for K8S::Kubernetes::Resource.class

I get the same error for both methods. Am I just not doing it right?

@jgaskins ah. no your not doing it wrong. its a bug. i didnt make from_file a class method. You can just do a from_yaml tho. ill fix that up.

Pushed a quick release. 0.3.1 it really was a issue in the sub-shard that holds all the k8s classes/structs (GitHub - spoved/ A Kubernetes lib containing definitions for Crystal-lang).