项目作者: Orkestra-Tech

项目描述 :
Functional DevOps with Scala and Kubernetes
高级语言: Scala
项目地址: git://github.com/Orkestra-Tech/orkestra.git
创建时间: 2018-05-29T09:46:51Z
项目社区:https://github.com/Orkestra-Tech/orkestra

开源协议:Apache License 2.0

下载


Orkestra

Latest version
Gitter

Orkestra is an Open Source Continuous Integration / Continuous Deployment server as a library running on
Kubernetes.
It leverages Kubernetes concepts such as Jobs or Secrets, and configuration as code in Scala
to take the most of compile time type safety and compatibility with Scala or Java libraries.

Key features:

  • Configured completely via code which can be version controlled
  • Fully scalable
  • Highly Available
  • Extendable via any Scala/Java libraries

Quick start

Requirements

Installation

project/plugins.sbt:

  1. addSbtPlugin("tech.orkestra" % "sbt-orkestra" % "<latest version>")

build.sbt:

  1. lazy val orkestra = orkestraProject("orkestra", file("orkestra"))
  2. .settings(
  3. libraryDependencies ++= Seq(
  4. "tech.orkestra" %%% "orkestra-github" % orkestraVersion, // Optional Github plugin
  5. "tech.orkestra" %%% "orkestra-cron" % orkestraVersion, // Optional Cron plugin
  6. "tech.orkestra" %% "orkestra-lock" % orkestraVersion // Optional Lock plugin
  7. )
  8. )

Simple example

Given the above installation, here is a minimal project with one job:

orkestra/src/main/scala/orkestra.scala:

  1. import tech.orkestra._
  2. import tech.orkestra.Dsl._
  3. import tech.orkestra.board._
  4. import tech.orkestra.job._
  5. import tech.orkestra.model._
  6. // We extend OrkestraServer to create the web server
  7. object Orkestra extends OrkestraServer {
  8. // Configuring the UI
  9. lazy val board = deployFrontendJobBoard
  10. // Configuring the jobs
  11. lazy val jobs = Set(deployFrontendJob)
  12. // Creating the job and configuring UI related settings
  13. lazy val deployFrontendJobBoard = JobBoard[() => Unit](JobId("deployFrontend"), "Deploy Frontend")()
  14. // Creating the job from the above definition (this will be compiled to JVM)
  15. lazy val deployFrontendJob = Job(deployFrontendJobBoard) { implicit workDir => () =>
  16. println("Deploying Frontend")
  17. }
  18. }

This example is described in Jobs & Boards.

See example projects

Deployment on Kubernetes with Minikube

We provide some basic Kubernetes Deployment in kubernetes-dev
that you can use to deploy on a dev environment.
Assuming that you are in one of the example projects
(or in your own project), here is how to deploy on Kubernetes with Minikube:

  1. minikube start --memory 4096 # Start Minikube
  2. eval `minikube docker-env` # Make docker use the docker engine of Minikube
  3. sbt orkestraJVM/Docker/publishLocal # Publish the docker artifact
  4. kubectl apply -f ../kubernetes-dev # Apply the deployment to Kubernetes
  5. kubectl proxy # Proxy the Kubernetes api

Visit Orkestra on http://127.0.0.1:8001/api/v1/namespaces/orkestra/services/orkestra:http/proxy.
You can troubleshoot any deployment issue with minikube dashboard.

More on how to configure the deployment in Config.

Documentation

Find all the documentation on https://orkestra.tech:

Talks and articles:

Origins of Orkestra

DriveTribe

Orkestra has been created at DriveTribe by its Scala backend team that had to do DevOps. Obsessed by functional programming they decided to apply the same paradigm to their DevOps.

Related projects

Contributing

Contributions to Orkestra are more than welcomed!
See CONTRIBUTING.md for all the information and getting help.