Pleasue use kubernetes-client to do the same

See this blog-post as an example k8s-operator

Build Status Codacy Badge Maven Central Cats friendly


Freya is a Scala library to implement custom controllers for Kubernetes (K8s) easily. An implementation of custom controller is also known as Operator Pattern. Freya based on fabric8 kubernetes client and inspired by abstract-operator Java library.

Freya main features:

  1. Two options to implement your Kubernetes Operator:
    • Custom Resource Definition (CRD) based
    • ConfigMap based
  2. Scala Case Classes as Kubernetes resource specification. Serialization and deserialization of case classes is done by Freya using Circe or Jackson Scala Module library.
  3. Auto-restart of custom controller upon k8s api-server disconnect.
  4. Auto-deployment of CRDs, no YAML files to be written.
  5. Auto-deployment of JSON Schema for CRD validation.
  6. Effect management and Functional Programming powered by Cats-Effect.


SBT dependency

Freya supports Scala 2.13 only at the moment. Main dependency:

"io.github.novakov-alexey" %% "freya-core" % "@VERSION@" 

Second module has two options: circe or jackson. One of them needs to be added into your dependencies to be able to read custom resource JSON/YAML text or write resource status as JSON


"io.github.novakov-alexey" %% "freya-circe" % "@VERSION@" 


"io.github.novakov-alexey" %% "freya-jackson" % "@VERSION@"


Microsite: https://novakov-alexey.github.io/freya/docs/