Description of problem: Resource limits and requests specified in {.spec.stepTemplate} for ClusterTask are not applied to the init-containers but only to the step containers; Version-Release number of selected component (if applicable): 1.4 How reproducible: 100% Steps to Reproduce: 1. Create ClusterTask with stepTemplate resource limits. 2. Start the clusterTask 3. using oc describe <taskrun generated pod>, verify that the limits and requests are only applied to the step containers and not to the init-containers. Actual results: The limits and requests are only applied to the step containers and not to the init-containers. Expected results: The limits and requests should be also applied to init-containers. Additional info: In case the project has LimitRange with {.spec.limits.default} field setted, the init-container takes the limits/requests from the LimitRange and not from the stepTemplate defined in the clusterTask resource.
For what is worth, this should be handled by the following work-in-progress PR upstream : https://github.com/tektoncd/pipeline/pull/4176
I am seeing the same result when I move the resource limits from the specTemplate to the step as per the example below : kind: Task apiVersion: tekton.dev/v1beta1 metadata: name: test02 spec: steps: - name: test image: alpine script: | echo EXECUTED resources: limits: cpu: "2" memory: 1Gi requests: cpu: "1" memory: 500Mi My quota defintion applied to the project is : apiVersion: v1 items: - apiVersion: v1 kind: ResourceQuota metadata: name: cust-quota spec: hard: limits.cpu: "4" limits.memory: 8Gi pods: "20" requests.cpu: "4" requests.memory: 8Gi kind: List metadata: resourceVersion: "" selfLink: "" The only difference in this example is that the pod never appears for investigation and the taskrun result shows a message of : failed to create task run pod "test02": pods "test02-pod-nvrd4" is forbidden: failed quota: cust-quota: must specify limits.cpu,limits.memory,requests.cpu,requests.memory. Maybe missing or invalid Task liberty-rest-gogs/test02 The task is present and perfectly valid as it works fine when the quota is removed.
Ah you are right. What got fixed in 1.6 is the fact that LimitRange where not applied to init container. But StepTemplate is, indeed not applied to to init containers. I think this is by designed, as init containers are not steps. There have been evolution around this in the most recent version of Tekton Pipelines, mainly https://github.com/tektoncd/pipeline/pull/5059. This probably be something fixed in 1.9 (hopefully), but it's probably going to be very hard to backport it to 1.6 (as a lot of things changed since then).