我已经使用docker-compose部署了monstache,如下所示:
blascal_tasks_monstache:
image: rwynn/monstache:6.7.6
container_name: dev_monstache
working_dir: /monstache
command: -f ./config.toml
volumes:
- ./monstache/dev:/monstache/
ports:
- "5556:8080"
restart: always它工作得很好,但是尝试在kubernetes中部署它时,我得到了一个错误:
ERROR 2021/10/06 20:07:56 open ./config.toml: no such file or directory以下是我的规范:
spec:
containers:
- args:
- -f
- ./config.toml
image: rwynn/monstache:6.7.6
name: dev-monstache
ports:
- containerPort: 8080
resources: {}
volumeMounts:
- mountPath: /monstache/dev
name: monstache-claim
workingDir: /monstache 如何指定文件?
发布于 2021-10-07 02:04:10
./config.toml: no such file or directory
要使配置对pod可用,请首先使用配置文件创建一个ConfigMap资源:
kubectl create configmap monstache-claim --from-file=config.toml
然后将配置挂载到pod规范中:
spec:
volumes:
- name: monstache-claim
configMap:
name: monstache-claim
containers:
- args:
...您将能够访问pod中的/monstache/dev/config.toml。
https://stackoverflow.com/questions/69472191
复制相似问题