Skip to content

alexpdp7/krust-manifesto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a Rust library to simplify the generation of Kubernetes manifests. This is an internal project, the only documentation is the code itself and the projects I have that use it.

Rationale

I find writing Kubernetes manifests a tedious task. Kubernetes manifests are flexible, but there are no shortcuts for common patterns.

I researched Jsonnet, Dhall, and Starlark. They are configuration languages that can build nested structures like Kubernetes manifests. In fact, these languages often include abstractions for common Kubernetes patterns, such as k8s-libsonnet. However, I did not want to learn a new language for this purpose, although these languages have unique advantages.

I did a prototype using Python. However, it was not enjoyable.

I decided to try using Rust. I discovered the k8s-openapi Rust model implementation. This implementation uses a custom code generator that results in much more ergonomic code.

Writing code that uses k8s-openapi is mostly enjoyable, but Kubernetes resources are still deeply-nested and require instantiating many Rust structs. I wrote this library to create Kubernetes resources in few function calls, implementing common abstractions.

Rust is not perfectly suited for this purpose, so I do not recommend using this library in general, but if you like Rust, the benefits might outweigh the drawbacks.

About

Abstractions to write concise Kubernetes manifests using Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages