Code Monkey home page Code Monkey logo

skuber's Introduction

skuber logo

Scala client for the Kubernetes API.


Latest release date Maven Central Discord

Read the Documentation.


Quick start

This example lists pods in kube-system namespace:

import skuber._
import skuber.json.format._
import org.apache.pekko.actor.ActorSystem
import scala.util.{Success, Failure}

implicit val system = ActorSystem()
implicit val dispatcher = system.dispatcher

val k8s = k8sInit
val listPodsRequest = k8s.list[PodList](Some("kube-system"))
listPodsRequest.onComplete {
  case Success(pods) => pods.items.foreach { p => println(p.name) }
  case Failure(e) => throw(e)
}

Documentation

Read the documentation and join discord community to ask your questions!

Features

  • Uses standard kubeconfig files for configuration - see the configuration guide for details
  • Scala 3.2, 2.13, 2.12 support
  • Typed Kubernetes Client for creating, reading, updating, removing, listing and watching resources on a Kubernetes cluster.
  • Dynamic Kubernetes Client, which allows you to interact with Kubernetes API without strict types.
  • Refreshing EKS tokens Refresh EKS Token guide
  • Comprehensive support for Kubernetes API model represented as Scala case classes
  • Support for core, extensions and other Kubernetes API groups
  • Full support for converting resources between the case class and standard JSON representations
  • The API is asynchronous and strongly typed e.g. k8s get[Deployment]("nginx") returns a value of type Future[Deployment]
  • Fluent API for creating and updating specifications of Kubernetes resources

Prerequisites

  • Java 17
  • Kubernetes cluster

A Kubernetes cluster is needed at runtime. For local development purposes, minikube is recommended. To get minikube follow the instructions here

Release

You can use the latest release by adding to your build:

  • Scala 3.2, 2.13, 2.12 support
libraryDependencies += "io.github.hagay3" %% "skuber" % "4.0.2"

Building

Building the library from source is very straightforward. Simply run sbt test in the root directory of the project to build the library (and examples) and run the unit tests to verify the build.

CI + Build

The CI parameters defined in build.sbt.

ci.yaml and clean.yaml are generated automatically with sbt-github-actions plugin.

Run sbt githubWorkflowGenerate && bash infra/ci/fix-workflows.sh in order to regenerate ci.yaml and clean.yaml.

CI Running against the following k8s versions

  • v1.19.6
  • v1.20.11
  • v1.21.5
  • v1.22.9
  • v1.23.6
  • v1.24.1

skuber supports all other k8s versions, not all of them tested under CI.

https://kubernetes.io/releases/

Support

I'm trying to be responsive to any new issues, you can create github issue or contact me.

Skuber chat on discord: https://discord.gg/byEh56vFJR

Email: [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.