Skip to content

Cannot set "resources" on a container revision spec #2099

@berndtj

Description

@berndtj

/area API
/kind feature

Expected Behavior

You should be able to specify the resources on a function from the revision spec. This value would then override the default.

Actual Behavior

must not set the field(s): spec.runLatest.configuration.revisionTemplate.spec.container.resources

Steps to Reproduce the Problem

  1. Create a revision spec (the below is part of a service spec):
RevisionTemplate: knserve.RevisionTemplateSpec{
	Spec: knserve.RevisionSpec{
		Container: corev1.Container{
			Image:          function.FunctionImageURL,
			Env:            envVars,
			LivenessProbe:  probe,
			ReadinessProbe: probe,
			Resources: corev1.ResourceRequirements{
				Requests: corev1.ResourceList{
					corev1.ResourceCPU: resource.MustParse("100m"),
				},
			},
		},
		ContainerConcurrency: 1,
		// TODO define a service account per function
		ServiceAccountName: buildCfg.ServiceAccount,
	},
},
  1. Submit revision/service
  2. spec is rejected: must not set the field(s): spec.runLatest.configuration.revisionTemplate.spec.container.resources

Additional Info

related: #1998

Metadata

Metadata

Labels

area/APIAPI objects and controllerskind/docSomething isn't clearkind/featureWell-understood/specified features, ready for coding.kind/specDiscussion of how a feature should be exposed to customers.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions