Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 在Kubernetes作业中将文件传送到stdin_Mysql_Bash_Kubernetes - Fatal编程技术网

Mysql 在Kubernetes作业中将文件传送到stdin

Mysql 在Kubernetes作业中将文件传送到stdin,mysql,bash,kubernetes,Mysql,Bash,Kubernetes,这里我们有一个 我想将MySQL脚本作为命令运行: mysql-hlocalhost-u1234-p1234--database=customer

这里我们有一个

我想将MySQL脚本作为命令运行:
mysql-hlocalhost-u1234-p1234--database=customer


但Kubernetes的文档对将文件传输到stdin的问题却保持沉默。如何在Kubernetes作业配置中指定它?

会将您的命令设置为类似于
[bash,-c,“mysql-hlocalhost-u1234-p1234--database=customer
,因为这样的输入重定向实际上是shell的一个功能。

会将您的命令设置为类似于
[bash,-c,“mysql-hlocalhost-u1234-p1234--database=customer
,因为这样的输入重定向实际上是shell的一个功能

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