mirror of
https://github.com/dhall-lang/dhall-kubernetes.git
synced 2024-11-03 21:05:47 +03:00
79 lines
3.3 KiB
Plaintext
79 lines
3.3 KiB
Plaintext
let types =
|
|
../types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed
|
|
|
|
let defaults =
|
|
../defaults.dhall sha256:4450e23dc81975d111650e06c0238862944bf699537af6cbacac9c7e471dfabe
|
|
|
|
let kv =
|
|
( ../Prelude.dhall).JSON.keyText
|
|
|
|
let deployment
|
|
: types.Deployment
|
|
= defaults.Deployment
|
|
// { metadata =
|
|
defaults.ObjectMeta // { name = "nginx" }
|
|
, spec =
|
|
Some
|
|
( defaults.DeploymentSpec
|
|
// { replicas =
|
|
Some 2
|
|
, revisionHistoryLimit =
|
|
Some 10
|
|
, selector =
|
|
defaults.LabelSelector
|
|
// { matchLabels = [ kv "app" "nginx" ] }
|
|
, strategy =
|
|
Some
|
|
( defaults.DeploymentStrategy
|
|
// { type =
|
|
Some "RollingUpdate"
|
|
, rollingUpdate =
|
|
{ maxSurge =
|
|
Some (types.IntOrString.Int 5)
|
|
, maxUnavailable =
|
|
Some (types.IntOrString.Int 0)
|
|
}
|
|
}
|
|
)
|
|
, template =
|
|
defaults.PodTemplateSpec
|
|
// { metadata =
|
|
defaults.ObjectMeta
|
|
// { name =
|
|
"nginx"
|
|
, labels =
|
|
[ kv "app" "nginx" ]
|
|
}
|
|
, spec =
|
|
Some
|
|
( defaults.PodSpec
|
|
// { containers =
|
|
[ defaults.Container
|
|
// { name =
|
|
"nginx"
|
|
, image =
|
|
Some "nginx:1.15.3"
|
|
, imagePullPolicy =
|
|
Some "Always"
|
|
, ports =
|
|
[ defaults.ContainerPort
|
|
// { containerPort = 80 }
|
|
]
|
|
, resources =
|
|
Some
|
|
{ limits =
|
|
[ kv "cpu" "500m" ]
|
|
, requests =
|
|
[ kv "cpu" "10m" ]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
)
|
|
}
|
|
}
|
|
)
|
|
}
|
|
|
|
in deployment
|