Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Helm配置错误 #1158

Open
boomboomxx opened this issue Apr 9, 2024 · 2 comments
Open

bug: Helm配置错误 #1158

boomboomxx opened this issue Apr 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@boomboomxx
Copy link

boomboomxx commented Apr 9, 2024

Describe the bug
Helm 包中, templates/deployment.yaml 文件配置多了一段, 导致 pod 无法启动
以下为精简配置文件, 多出一段 command 命令
该命令会在 docker 镜像启动的时候,自动执行,无需手动在这里加上
且该段命令无任何指定参数,会一直输出 usage 信息

apiVersion: apps/v1
kind: Deployment
metadata:
spec:
  template:
    spec:
      containers:
        - name: {{ .Chart.Name }}
          command:
            - /bin/sh
            - -c
            - ./bin/clickvisual

ClickVisual Running Environment

  • Kubernetes 1.24.12
  • Helm v3.12.1
  • ClickVisual version:
    1.0.1-rc1
  • ClickVisual.LOG:
Usage:
  clickvisual [command]

Available Commands:
  agent       启动 clickvisual agent 服务端
  command     启动 clickvisual 命令行
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  server      启动 clickvisual server 服务端
  upload      启动 clickvisual 命令行

Flags:
  -c, --config string   指定配置文件,默认 config/default.toml (default "config/default.toml")
  -h, --help            help for clickvisual

Use "clickvisual [command] --help" for more information about a command.

解决方案
删除上述 command 部分配置即可

@boomboomxx boomboomxx added the bug Something isn't working label Apr 9, 2024
@kailongapple
Copy link

我的是latest 调整启动命令和配置文件的环境变量

kubectl patch deployment clickvisual -n ilogtail -p '{"spec":{"template":{"spec":{"containers":[{"name":"clickvisual","env":[{"name":"EGO_CONFIG_PATH","value":"configs/default.toml"}]}]}}}}'

kubectl patch deployment clickvisual -n ilogtail -p '{"spec":{"template":{"spec":{"containers":[{"name":"clickvisual","command":["./bin/clickvisual", "server"]}]}}}}'

kubectl patch deployment clickvisual -n ilogtail -p '{"spec":{"ports":[{"containerPort":9021,"name":prom2click,"protocol":"TCP"}]}}'
kubectl patch service clickvisual -n ilogtail -p '{"spec":{"ports":[{"name":prom2click,"port":9021,"targetPort":prom2click,"protocol":"TCP"}]}}'

kubectl rollout restart deployment clickvisual -n ilogtail

@boomboomxx
Copy link
Author

我的是latest 调整启动命令和配置文件的环境变量

kubectl patch deployment clickvisual -n ilogtail -p '{"spec":{"template":{"spec":{"containers":[{"name":"clickvisual","env":[{"name":"EGO_CONFIG_PATH","value":"configs/default.toml"}]}]}}}}'

kubectl patch deployment clickvisual -n ilogtail -p '{"spec":{"template":{"spec":{"containers":[{"name":"clickvisual","command":["./bin/clickvisual", "server"]}]}}}}'

kubectl patch deployment clickvisual -n ilogtail -p '{"spec":{"ports":[{"containerPort":9021,"name":prom2click,"protocol":"TCP"}]}}' kubectl patch service clickvisual -n ilogtail -p '{"spec":{"ports":[{"name":prom2click,"port":9021,"targetPort":prom2click,"protocol":"TCP"}]}}'

kubectl rollout restart deployment clickvisual -n ilogtail

如果使用 helm , 不建议使用 patch, 你的这部分配置在 helm 包的 values.yaml 中应该要包含的, 配置自己的 values.yaml 文件定制就可以
主要是 官方的 Dockerfile 文件最后会执行 ./bin/clickvisual server 这个命令,不需要在容器中使用 command 命令再去启动
而且官方提供的 helm 包没有把环境变量提取到values.yaml 中,导致用户需要用自己的方式去做这个事情

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants