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

Helm/k8s tệ hại #231

Open
xluffy opened this issue Feb 15, 2024 · 0 comments
Open

Helm/k8s tệ hại #231

xluffy opened this issue Feb 15, 2024 · 0 comments

Comments

@xluffy
Copy link
Owner

xluffy commented Feb 15, 2024

Có một kịch bản rất khó chịu khi deploy Prometheus (hoặc bất cứ dịch vụ gì) bằng Helm (hoặc một phương thức khác) trên k8s như sau:

  • Sửa values.yaml ví dụ Prometheus scrape config (để relabels, drop metrics, drop labels hoặc optimization config)
  • Chạy helm upgrade --install --atomic để deploy
  • Kiểm tra qua Prometheus UI ko thấy config mới được apply, metrics ko thay đổi
  • Loay hoay kiểm tra, check pod, check deployment -> pod vẫn running, log ko có bất cứ lỗi gì lạ
  • Không biết làm gì -> rollout restart pod/deploy
  • Vẫn ko thấy có gì thay đổi
  • Xóa pod, deploy lại, lỗi log ra
  • Hóa ra do sai prometheus.yml -> nhưng nếu config file 1K LOC thì biết nó ở chỗ nào
level=info ts=2024-02-15T03:43:24.59912062Z caller=main.go:137 msg="Starting prometheus-config-reloader" version="(version=0.71.2, branch=refs/tags/v0.71.2, revision=af2014407bdc25c4fc2b26cd99c9655235ebdf88)"
level=info ts=2024-02-15T03:43:24.599200799Z caller=main.go:138 build_context="(go=go1.21.6, platform=linux/amd64, user=Action-Run-ID-7656327832, date=20240125-14:58:54, tags=unknown)"
level=info ts=2024-02-15T03:43:24.59972805Z caller=reloader.go:246 msg="reloading via HTTP"
level=info ts=2024-02-15T03:43:24.59986762Z caller=reloader.go:282 msg="started watching config file and directories for changes" cfg= out= dirs=/etc/config
level=error ts=2024-02-15T03:44:06.630001283Z caller=runutil.go:100 msg="function failed. Retrying in next tick" err="trigger reload: reload request failed: Post \"http://127.0.0.1:9090/-/reload\": dial tcp 127.0.0.1:9090: connect: connection refused"
ts=2024-02-15T03:44:06.992Z caller=main.go:492 level=error msg="Error loading config (--config.file=/etc/config/prometheus.yml)" file=/etc/config/prometheus.yml err="parsing YAML file /etc/config/prometheus.yml: relabel configuration for replace action requires 'target_label' value"

Kịch bản lặp đi lặp lại, không hề dễ dàng để debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant