runtime: resource limits (kubernetes implementation) (#1931)

* runtime: add resource limit CreateOptions

* util/kubernetes/client: implement support for resource limits

* runtime/kubernetes: set resource limits for k8s deployments

* util/kubernetes: remove template check for ints

* util/kubernetes: fix incorrect yaml syntax

* runtime/kubernetes: fix incorrect units

* runtime: update create options to use Resources struct
This commit is contained in:
ben-toogood
2020-08-14 11:47:28 +01:00
committed by GitHub
parent 374aae1490
commit 5a88ea7247
5 changed files with 95 additions and 9 deletions

View File

@@ -104,3 +104,16 @@ type Service struct {
// Metadata stores metadata
Metadata map[string]string
}
// Resources which are allocated to a serivce
type Resources struct {
// CPU is the maximum amount of CPU the service will be allocated (unit millicpu)
// e.g. 0.25CPU would be passed as 250
CPU int
// Mem is the maximum amount of memory the service will be allocated (unit mebibyte)
// e.g. 128 MiB of memory would be passed as 128
Mem int
// Disk is the maximum amount of disk space the service will be allocated (unit mebibyte)
// e.g. 128 MiB of memory would be passed as 128
Disk int
}