Liking cljdoc? Tell your friends :D

Build Status Discuss on Slack

What

A set of Clojure libraries for interacting with Kubernetes from Clojure applications. Composed of a core Kubernetes client + various modules offering higher level constructs (sometimes with added dependencies).

Why

Some Clojure Kubernetes libraries already exist, but they're not comprehensive. I want something robust enough that I can write production cluster integrations (controllers, operators, etc) in Clojure. I really enjoy the data orientation that you find in other Clojure libraries like cognitect's aws-api and have tried to provide the same here.

The fabric8.io kubernetes client for java is robust and comprehensive but it's rather painful to use from Clojure due to its focus on OOP ergonomics. That said, the fabric8 implementation has been my primary reference when implementing the trickier pieces of IO.

Modules

Clojars Project

This module bundles all modules (described below) for ease of use.


Clojars Project

View code examples

This implements the basic REST and websocket client code to communicate with the Kubernetes API. It defines the available operations using the swagger specification served from the remote Kubernetes cluster. You can use this to CRUD on Kubernetes resources and to explore the available operations.

Note that this core is intentionally minimal. All interactions with Kubernetes boil down to either some http calls or some websocket connections and that's all this module provides. If you're looking for more complex things like exec and port-forward have a look at the kube-api-io module that creates those things from these blocks.

Inspired by:

Leverages:


Clojars Project

View code examples

This implements higher level IO constructs like those you're accustomed to from kubectl. This is where you'll find things like exec, attach, logs, port-forward, proxy, and cp.

Leverages:

  • Java IO / NIO

Clojars Project

View code examples

This satisfies the same goals as the tools/cache package from the standard go client. Provides machinery for writing controllers (aka operators) that manages threads, watches, retries, and state for you so that your user space controller implementation doesn't need to worry about so many details.

Inspired by:

Leverages:


Clojars Project

View code examples

This module adapts the byte streams and command channel of an exec call into the requirements of a terminal emulator so you can display an interactive shell into the selected Kubernetes pod.

Leverages:


Clojars Project

View code examples

This module implements ring middleware for pod source ip based authentication. You can use this for service<>service authentication within a Kubernetes cluster (so long as the traffic originates from elsewhere in the cluster).


Clojars Project

View code examples

This module provides tooling to help write tests that can interact with an isolated kubernetes cluster using kind. This module is used to test kube-api itself.


License

This project is licensed under MIT license.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close