Overboard is a library providing strongly typed builders over kubernetes configuration. It allows you to retain a declarative style to your configuration while putting the full power of the F# programming language in your hands.
Overboard outputs plain Kubernetes YAML or JSON resource config files, so no need to change what you already have.
Defining infrastructure as code can get complicated. Infrastructure code can run up to thousands of lines of configuration files. We then add layer upon layer of tools on top of this to manage the complexity while trying to keep our structured text correct and understandable.
The problems being solved by layers of tooling on top of mountains of yaml are the following:
These are all problems that mature languages have solved decades ago. Instead of layering new tools on top of YAML files, what if we instead used a declarative programming language to define our configuration? Overboard enables this approach for Kubernetes.
Show me the code!
Of course. Say we have a file called infra.fsx
.
// infra.fsx
// include the Overboard package from Nuget
#r "nuget:Overboard"
// open the namespaces for the resources you need
open Overboard.Common
open Overboard.Workloads
// define the deployment Kubernetes resource
let theDeployment = k8s {
deployment {
"my-overboard-deployment"
replicas 2
add_matchLabel ("app", "nginx")
pod {
_labels [("app", "nginx")]
container {
name "nginx"
image "nginx:latest"
}
}
}
}
// write your YAML file to disk
KubeCtlWriter.toYamlFile theDeployment "deployment.yaml"
That's it! You now have a kubernetes config file for a deployment.
|
Ready to try it yourself? Try the hello-world tutorial. To explore more examples, check out the How-to or Tutorials section.
The docs follow the guidance from The documentation system.
Generation is done using FSharp.Formatting.
To run the docs locally, navigate to this /overboard root folder and run the following command:
|
Ship by Aleksandr Vector from Noun Project