<p>I have an init container and am running a command in it which takes a ton of parameters so I have something like </p>

<pre><code>command: ['sh', '-c', 'tool input1 input2 output
-action param1 -action param2 -action param3 -action param4 -action param5 -action param6 -action param7 -action param7 -action param8 -action param9 -action param10 ']
</code></pre>

<p>This highly decreases the readability of the command. Is there someway I can improve this like passsing this a a separate array ?</p>

The_Lost_Avatar
<p>Another tip is to do it via command, so save your time that you needn't manually do that.</p>

<pre><code>kubectl run nginx --image=nginx --generator=run-pod/v1 --dry-run -o yaml  -- tool input1 input2 output -action param1 -action param2 -action param3 -action param4 -action param5 -action param6 -action param7 -action param7 -action param8 -action param9 -action param10
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - args:
    - tool
    - input1
    - input2
    - output
    - -action
    - param1
    - -action
    - param2
    - -action
    - param3
    - -action
    - param4
    - -action
    - param5
    - -action
    - param6
    - -action
    - param7
    - -action
    - param7
    - -action
    - param8
    - -action
    - param9
    - -action
    - param10
    image: nginx
    name: nginx
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}
</code></pre>

<p>Above <code>dry-run</code> command will generate the yaml for option <code>--args</code>, you copy &amp; paste it into the part of original init container, make it so simple and you can do it less in one munite</p>

<p>You still need keep the part of command, don't forget</p>

<pre><code>    command: ["/bin/sh","-c"]
</code></pre>
