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:
@@ -84,6 +84,8 @@ type CreateOptions struct {
|
||||
Context context.Context
|
||||
// Secrets to use
|
||||
Secrets map[string]string
|
||||
// Resources to allocate the service
|
||||
Resources *Resources
|
||||
}
|
||||
|
||||
// ReadOptions queries runtime services
|
||||
@@ -176,6 +178,13 @@ func WithOutput(out io.Writer) CreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// ResourceLimits sets the resources for the service to use
|
||||
func ResourceLimits(r *Resources) CreateOption {
|
||||
return func(o *CreateOptions) {
|
||||
o.Resources = r
|
||||
}
|
||||
}
|
||||
|
||||
// ReadService returns services with the given name
|
||||
func ReadService(service string) ReadOption {
|
||||
return func(o *ReadOptions) {
|
||||
|
Reference in New Issue
Block a user