<p>I'm invoking Kaniko (I Docker image that can build Docker images) successfully in this way (EKS environment):</p>
<pre><code>cat build.tar.gz | kubectl run kaniko-httpd-ex --quiet --stdin --rm --restart=Never --image=748960220740.dkr.ecr.eu-west-1.amazonaws.com/kaniko:0 --env=AWS_SDK_LOAD_CONFIG=true -- --destination=748960220740.dkr.ecr.eu-west-1.amazonaws.com/httpd-ex:23-04-26_08-54-DV-6525-kube --context tar://stdin --label commit=8e3a236f702c689891a50a60acf7e05658fa3939 --label build_url=Sin-Jenkins
</code></pre>
<p>This works ok, except when there is no enough ephemeral storage available.</p>
<p>Now I want to specify limits, like <code>ephemereal-storage</code>.
As the <code>--limits</code> option has been removed in recent versions of Kubernetes, I have to use the <code>--overrides</code>, and I have to change many things.</p>
<p>Here is how I do it:</p>
<pre><code>cat build.tar.gz | kubectl run kaniko-httpd-ex --quiet --restart=Never -i --rm --image=748960220740.dkr.ecr.eu-west-1.amazonaws.com/kaniko:0 --overrides='{&quot;apiVersion&quot;:&quot;v1&quot;,
&quot;spec&quot;:
{&quot;containers&quot;:[{
  &quot;name&quot;:&quot;kaniko&quot;,
  &quot;stdin&quot;: true,
  &quot;restartPolicy&quot;:&quot;Never&quot;,
  &quot;image&quot;:&quot;748960220740.dkr.ecr.eu-west-1.amazonaws.com/kaniko:0&quot;,
  &quot;env&quot;:[{&quot;name&quot;:&quot;AWS_SDK_LOAD_CONFIG&quot;,&quot;value&quot;:&quot;true&quot;}],
  &quot;resources&quot;:{&quot;requests&quot;:{
    &quot;ephemeral-storage&quot;:&quot;116Mi&quot;,
    &quot;memory&quot;: &quot;50Mi&quot;,
    &quot;cpu&quot;: &quot;50m&quot;
  }},
  &quot;args&quot;:[
    &quot;--destination=748960220740.dkr.ecr.eu-west-1.amazonaws.com/httpd-ex:23-04-26_08-57-DV-6525-kube&quot;,
    &quot;--context&quot;,&quot;tar://stdin&quot;
    ,&quot;--label&quot;,&quot;commit=8e3a236f702c689891a50a60acf7e05658fa3939&quot;,&quot;--label&quot;,&quot;build_url=Sin-Jenkins&quot;]
}]}'
</code></pre>
<p>It launches correctly kaniko, but after 65 seconds, kaniko is killed and the only error message is:</p>
<pre><code>error: timed out waiting for the condition
</code></pre>
<pre><code>$ kubectl get ev | grep kaniko
19m         Normal   Scheduled   pod/kaniko-httpd-ex   Successfully assigned sbt-david/kaniko-httpd-ex to ip-10-120-134-171.eu-west-1.compute.internal
19m         Normal   Pulled      pod/kaniko-httpd-ex   Container image &quot;748960220740.dkr.ecr.eu-west-1.amazonaws.com/kaniko:0&quot; already present on machine
19m         Normal   Created     pod/kaniko-httpd-ex   Created container kaniko
19m         Normal   Started     pod/kaniko-httpd-ex   Started container kaniko
17m         Normal   Killing     pod/kaniko-httpd-ex   Stopping container kaniko
</code></pre>
<p>How to specify limits on resources when using <code>stdin</code>?</p>
<p>Related info:</p>
<ul>
<li><a href="https://github.com/kubernetes/kubectl/issues/1101" rel="nofollow noreferrer">https://github.com/kubernetes/kubectl/issues/1101</a></li>
</ul>
<p>Notes:</p>
<ul>
<li>I cannot use the <code>--limits</code> flag from <code>kubectl run</code> as it has been removed recently.</li>
</ul>

<p>Your sample:</p>
<pre><code>...
&quot;resources&quot;:{&quot;requests&quot;:{
    &quot;ephemeral-storage&quot;:&quot;116Mi&quot;},  # &lt;-- incorrect
...
</code></pre>
<p>Try:</p>
<pre><code>...
&quot;resources&quot;:{
  &quot;requests&quot;:{
    &quot;ephemeral-storage&quot;: &quot;116Mi&quot;,
    &quot;memory&quot;: &quot;50Mi&quot;,
    &quot;cpu&quot;: &quot;50m&quot;
  },
...
</code></pre>
<p>Here's a working example that runs a pod for 5m. Do <code>kubectl describe pod busybox</code> and check the <code>Requests</code> section:</p>
<pre><code>kubectl run busybox --image busybox --overrides '
{
  &quot;apiVersion&quot;: &quot;v1&quot;,
  &quot;spec&quot;: {
     &quot;restartPolicy&quot;: &quot;Never&quot;,
     &quot;containers&quot;: [
      {
        &quot;name&quot;: &quot;busybox&quot;,
        &quot;image&quot;: &quot;busybox&quot;,
        &quot;command&quot;: [&quot;ash&quot;, &quot;-c&quot;, &quot;sleep 300&quot;],
        &quot;resources&quot;: {
          &quot;requests&quot;:{
            &quot;ephemeral-storage&quot;: &quot;116Mi&quot;,
            &quot;memory&quot;: &quot;50Mi&quot;,
            &quot;cpu&quot;: &quot;50m&quot;
 }}}]}}'
</code></pre>
