Guess etcd replicas number function

Đang mở
#239 6 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go, kubernetes
Lĩnh vực
backend, databases

Hướng nghiên cứu

Read the proposal in this issue and the linked design reference in pull request #181, then locate the operator code that handles StatefulSets, cluster state ConfigMaps, etcd membership, endpoints, PVCs, and pods. Map how those sources determine the replica count and where scaling or recovery consumes it. Done means a function returns the highest discovered replica index plus one across the listed sources.

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

Mô tả

According to the latest meeting 2024-06-18 MINUTES we decided that we need a function that guesses the needed amount of etcd replicas.

It can be used for recovering non-exising STS object and also for scaling from 0
Design ref: https://github.com/aenix-io/etcd-operator/pull/181

Proposal:

  • Create variable guessed=0
  • Check cluster-state configmap
    • if configmap exists and initial-cluster-members defined
      • if there are any hostnames defined in initial-cluster-members
        • take the hostname of pod with highest number and +1
          • save value into guessed variable
  • Check endpoins for etcd-headless service
    • if there are any endpoints
      • connect to the cluster using endpoint and collect information from member list
        • if there are any members in output from etcd
          • take the hostname with highest number and +1
            • if value is greater then value in guessed, save value into guessed variable
      • read endpoints from kubernetes object:
        • take the hostname of the pod for endpoint with highest number and +1
          • if value is greater then value in guessed, save value into guessed variable
  • read persistent volume claims that falls under StatefulSet label selector
    • if there are any pvcs
      • take the name of the pvc with highest number and +1
        • if value is greater then value in guessed, save value into guessed variable
  • read pods pods that falls under StatefulSet label selector
    • if there are any pods
      • take the pod name with highest number and +1
        • if value is greater then value in guessed, save value into guessed variable
  • return guessed
Ngôn ngữ chính
Go
Star
154
Fork
31
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 cozystack/etcd-operator

Tất cả issue của cozystack/etcd-operator

Issue tương tự

Thêm issue về Go

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.