dhall-kubernetes/examples/deployment.dhall
James Guthrie 2fb32a453c Set Cron* types and defaults to v1beta1 (#88)
According to the Kubernetes documentation [1]:

Note: CronJob resource in batch/v2alpha1 API group has been deprecated
starting from cluster version 1.8. You should switch to using
batch/v1beta1, instead, which is enabled by default in the API server.
Examples in this document use batch/v1beta1 in all examples.

[1]: https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/
2019-11-16 18:18:44 -08:00

79 lines
3.3 KiB
Plaintext

let types =
../types.dhall sha256:e48e21b807dad217a6c3e631fcaf3e950062310bfb4a8bbcecc330eb7b2f60ed
let defaults =
../defaults.dhall sha256:98bf62170e7785da6f627a06980c5788a5b8bdd0d1e61bb7c141beef18a3129c
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