-
Notifications
You must be signed in to change notification settings - Fork 743
Unable to specify container values in deployment template #1113
Description
Is this a BUG REPORT or FEATURE REQUEST?:
Depends if this ability is intended, it's certainly expected so perhaps a bug?
What happened:
I configured kubeless with a deployment template like so:
{
"spec": {
"template": {
"spec": {
"containers": [{
"resources": {
"requests": {
"cpu": "50m"
}
}
}]
}
}
}
}
but the resource values are not merged into the containers spec.
What you expected to happen:
I expected the values to be merged and for the container to be deployed with 50m cpu requests.
How to reproduce it (as minimally and precisely as possible):
As above.
Anything else we need to know?:
To avoid an XY problem, what I'm trying to achieve is to give a function container a specific cpu request value without a corresponding limit.
If I use cpu: 50m in serverless.yml, then both requests and limits get set.
I'd be happy to give all functions the same requests limit, so I turned to the deployment template.
I believe the relevant code is here: https://github.com/kubeless/kubeless/blob/ff0ba5bbe41b9bb8db5def7548451039eee2aa98/pkg/utils/k8sutil.go#L372
In addition to the VolumeMounts append, I think we could also merge the resources object.
I'd be happy to provide a pull request to do that if this solution sounds good to you.
Environment:
- Kubernetes version (use
kubectl version):
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.12-gke.25", GitCommit:"654de8cac69f1fc5db6f2de0b88d6d027bc15828", GitTreeState:"clean", BuildDate:"2020-01-14T06:01:20Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}
- Kubeless version (use
kubeless version):Kubeless version: v1.0.5-8-g59da64f8 - Cloud provider or physical cluster: GKE