<p>Here we have a <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/jobs" rel="nofollow noreferrer">sample of the job</a> </p>

<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  # Unique key of the Job instance
  name: example-job
spec:
  template:
    metadata:
      name: example-job
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl"]
        args: ["-Mbignum=bpi", "-wle", "print bpi(2000)"]
      # Do not restart containers after they exit
      restartPolicy: Never
</code></pre>

<p>I want to run a MySQL script as a command:
<code>mysql  -hlocalhost -u1234 -p1234 --database=customer &lt; script.sql</code></p>

<p>But Kubernetes documentation is silent about piping a file to stdin. How can I specify that in Kubernetes job config?</p>

egor10_4
<p>Would set your command to something like <code>[bash, -c, "mysql  -hlocalhost -u1234 -p1234 --database=customer &lt; script.sql"]</code>, since input redirection like that is actually a feature of your shell.</p>
