首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在kubernetes中部署monstache

在kubernetes中部署monstache
EN

Stack Overflow用户
提问于 2021-10-06 20:15:20
回答 1查看 157关注 0票数 0

我已经使用docker-compose部署了monstache,如下所示:

代码语言:javascript
复制
  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中部署它时,我得到了一个错误:

代码语言:javascript
复制
ERROR 2021/10/06 20:07:56 open ./config.toml: no such file or directory

以下是我的规范:

代码语言:javascript
复制
   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 

如何指定文件?

EN

回答 1

Stack Overflow用户

发布于 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规范中:

代码语言:javascript
复制
spec:
  volumes:
  - name: monstache-claim
    configMap:
      name: monstache-claim
  containers:
  - args:
  ...

您将能够访问pod中的/monstache/dev/config.toml。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69472191

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档