dhall-kubernetes/examples/deployment.dhall
Gabriel Gonzalez eb001e6683
Groundwork for supporting multiple releases (#103)
Related to https://github.com/dhall-lang/dhall-kubernetes/issues/75

This generalizes the machinery for fetching the Kubernetes OpenAPI spec to
support fetching multiple versions.  In particular, the Kubernetes version
is no longer tied to the version of Nixpkgs that we use.
2020-01-10 21:40:36 -08:00

61 lines
2.2 KiB
Plaintext

let Prelude =
../Prelude.dhall sha256:771c7131fc87e13eb18f770a27c59f9418879f7e230ba2a50e46f4461f43ec69
let kubernetes =
../package.dhall sha256:ab1c971ddeb178c1cfc5e749b211b4fe6fdb6fa1b68b10de62aeb543efcd60b3
let kv = Prelude.JSON.keyText
let deployment =
kubernetes.Deployment::{
, metadata = kubernetes.ObjectMeta::{ name = "nginx" }
, spec =
Some
kubernetes.DeploymentSpec::{
, replicas = Some 2
, revisionHistoryLimit = Some 10
, selector =
kubernetes.LabelSelector::{ matchLabels = [ kv "app" "nginx" ] }
, strategy =
Some
kubernetes.DeploymentStrategy::{
, type = Some "RollingUpdate"
, rollingUpdate =
{ maxSurge = Some (kubernetes.IntOrString.Int 5)
, maxUnavailable = Some (kubernetes.IntOrString.Int 0)
}
}
, template =
kubernetes.PodTemplateSpec::{
, metadata =
kubernetes.ObjectMeta::{
, name = "nginx"
, labels = [ kv "app" "nginx" ]
}
, spec =
Some
kubernetes.PodSpec::{
, containers =
[ kubernetes.Container::{
, name = "nginx"
, image = Some "nginx:1.15.3"
, imagePullPolicy = Some "Always"
, ports =
[ kubernetes.ContainerPort::{
, containerPort = 80
}
]
, resources =
Some
{ limits = [ kv "cpu" "500m" ]
, requests = [ kv "cpu" "10m" ]
}
}
]
}
}
}
}
in deployment