Pod isn't restarted when configMaps or secrets change

Đang mở Phù hợp với người mới
#202 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
helm, kubernetes
Lĩnh vực
devops

Hướng nghiên cứu

Payload nêu tên các template ConfigMap và Secret (configmap.yaml, secret.yaml) cùng với pod template trong Deployment của chart, nơi sẽ thêm các annotation. Hãy đọc cách metadata của pod template trong Deployment được render và cách configMaps và secrets được mount với subPath. Hoàn thành khi render chart với giá trị configMaps hoặc secrets đã thay đổi sẽ tạo ra một annotation khác trên pod template, khiến pod được khởi động lại khi upgrade.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Changing only a configMaps (or secrets) entry in values doesn't restart the pod. The deployment's pod template doesn't change, so helm upgrade updates the ConfigMap but leaves the old pod running. Since the chart mounts these with subPath, the running pod never sees the new content either: it keeps the old file until something else restarts it.

For example, changing an Rspamd override in configMaps and upgrading leaves Rspamd on the old config until a manual kubectl rollout restart.

The usual fix is a checksum annotation on the pod template, so any config change rolls the pod:

template:
  metadata:
    annotations:
      checksum/configmaps: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
      checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
Ngôn ngữ chính
Mustache
Star
157
Fork
82
Merge trung bình
22 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của docker-mailserver/docker-mailserver-helm

Tất cả issue của docker-mailserver/docker-mailserver-helm

Issue tương tự

Thêm issue về DevOps

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.