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