我们想在 k8s 中部署laravel项目。对于数据库,我们有一个data.sql文件。当我们为这个项目创建 docker 镜像时,data.sql很容易传入卷,例如:
卷:
- ./data.sql:/docker-entrypoint-initdb.d/data.sql
Run Code Online (Sandbox Code Playgroud)
但在 k8s 中我无法在数据库和 .sql 文件之间建立连接所以请告诉我,如何在 kubernetes 卷中传递 .sql 文件?
在.sql文件中我们有大量数据,当我们使用configmap时会出现错误
"command terminated with exit code 137"
Run Code Online (Sandbox Code Playgroud)