https://github.com/hnaderi/scala-k8s
Kubernetes client, data models and typesafe manifest generation for scala, scalajs, and scala native
https://github.com/hnaderi/scala-k8s
circe http4s json4s k8s kubernetes kubernetes-api manifest playframework scala scalajs scalanative spray-json sttp typesafe typesafe-config typesafe-configuration typesafeconfig zio zio-http
Last synced: 4 months ago
JSON representation
Kubernetes client, data models and typesafe manifest generation for scala, scalajs, and scala native
- Host: GitHub
- URL: https://github.com/hnaderi/scala-k8s
- Owner: hnaderi
- License: apache-2.0
- Created: 2022-09-03T03:32:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T01:04:55.000Z (about 1 year ago)
- Last Synced: 2024-10-30T08:18:23.620Z (about 1 year ago)
- Topics: circe, http4s, json4s, k8s, kubernetes, kubernetes-api, manifest, playframework, scala, scalajs, scalanative, spray-json, sttp, typesafe, typesafe-config, typesafe-configuration, typesafeconfig, zio, zio-http
- Language: Scala
- Homepage: http://projects.hnaderi.dev/scala-k8s/
- Size: 911 KB
- Stars: 34
- Watchers: 3
- Forks: 4
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Scala K8S
Kubernetes client, data models and typesafe manifest generation for scala, scalajs, and scala native

[](https://index.scala-lang.org/hnaderi/scala-k8s/scala-k8s-objects)
[](https://javadoc.io/doc/dev.hnaderi/scala-k8s-docs_3)
[](https://scala-steward.org)
## What
This library provides a full blown extensible client that you can use to interact directly with kubernetes API server, to create operators or accomplish other automation tasks, also you can use it to create or manipulate manifests in scala.
## Why
Kubernetes spec is large enough to fit in one's brain, and YAML and helm are a joke! instead of using different tooling and languages with no to little IDE and compiler support, you can use this library to have the latest kubernetes API spec under your tool belt, in scala!
so the most complex templates are just simple functions, and you can use whatever abstraction you like to create objects; and create manifests easily.
for easy to use recipes and integration with sbt, visit [this project](https://github.com/hnaderi/sbt-k8s)
## Goals
- to become the defacto k8s integration library in all scala ecosystems
## Design principles
- As extensible as possible
- As dependency free as possible
- As Un-opinionated as possible
- Provide seamless integrations
- All specs are generated from the spec directly and will be in sync with kubernetes all the time
## Getting started
This library is currently available for Scala binary versions 2.12, 2.13 and 3.2 on JVM/JS/Native.
This library is designed in a microkernel fashion and all the main kubernetes stuff are implemented/generated in pure scala, and integration modules are provided separately.
main modules are:
- `objects` raw kubernetes objects, which has no dependency
- `client` raw kubernetes client and requests, requests can also be extended in user land easily!
``` scala
libraryDependencies ++= Seq(
"dev.hnaderi" %% "scala-k8s-objects" % "@VERSION@", // JVM, JS, Native ; raw k8s objects
"dev.hnaderi" %% "scala-k8s-client" % "@VERSION@", // JVM, JS, Native ; k8s client kernel and requests
)
```
The following integrations are currently available:
```scala
libraryDependencies ++= Seq(
"dev.hnaderi" %% "scala-k8s-http4s-ember" % "@VERSION@", // JVM, JS, Native ; http4s ember client integration
"dev.hnaderi" %% "scala-k8s-http4s-netty" % "@VERSION@", // JVM ; http4s netty client integration
"dev.hnaderi" %% "scala-k8s-http4s-blaze" % "@VERSION@", // JVM; http4s blaze client integration
"dev.hnaderi" %% "scala-k8s-http4s-jdk" % "@VERSION@", // JVM; http4s jdk-client integration
"dev.hnaderi" %% "scala-k8s-http4s" % "@VERSION@", // JVM, JS, Native ; http4s core and fs2 integration
"dev.hnaderi" %% "scala-k8s-zio" % "@VERSION@", // JVM ; ZIO native integration using zio-http and zio-json
"dev.hnaderi" %% "scala-k8s-sttp" % "@VERSION@", // JVM, JS, Native ; sttp integration using jawn parser
"dev.hnaderi" %% "scala-k8s-circe" % "@VERSION@", // JVM, JS ; circe integration
"dev.hnaderi" %% "scala-k8s-json4s" % "@VERSION@", // JVM, JS, Native; json4s integration
"dev.hnaderi" %% "scala-k8s-spray-json" % "@VERSION@", // JVM ; spray-json integration
"dev.hnaderi" %% "scala-k8s-play-json" % "@VERSION@", // JVM ; play-json integration
"dev.hnaderi" %% "scala-k8s-zio-json" % "@VERSION@", // JVM, JS ; zio-json integration
"dev.hnaderi" %% "scala-k8s-jawn" % "@VERSION@", // JVM, JS, Native ; jawn integration
"dev.hnaderi" %% "scala-k8s-manifests" % "@VERSION@", // JVM, JS, Native ; yaml manifest reading and generation
"dev.hnaderi" %% "scala-k8s-scalacheck" % "@VERSION@" // JVM, JS, Native; scalacheck instances
)
```
visit [project site](https://projects.hnaderi.dev/scala-k8s) to see more tutorials and docs,
also please drop a ⭐ if this project interests you. I need encouragement.
## sbt integration
see [this project](https://github.com/hnaderi/sbt-k8s)
## Future plans
- more integrations (akka-http, ...)!