Skip to content

podSpecPatch for init container #9203

Closed Answered by BhavikaSharma
BhavikaSharma asked this question in Q&A
Discussion options

You must be logged in to vote

Init container live under initContainers not containers.

Working spec:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: pod-spec-patch-
spec:
  entrypoint: whalesay
  arguments:
    parameters:
      - name: cpu-limit
        value: 100m
  templates:
  - name: whalesay
    podSpecPatch: '{"initContainers":[{"name":"init", "resources":{"limits":{"cpu": "{{workflow.parameters.cpu-limit}}" }}}]}'
    container:
      image: docker/whalesay:latest
      command: [cowsay]
      args: ["hello world"]
      resources:
        limits:
          cpu: 200m
          memory: 200Mi

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BhavikaSharma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area/executor area/spec Changes to the workflow specification. type/support User support issue - likely not a bug
1 participant