Open
Description
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: #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
- save value into
- take the hostname of pod with highest number and +1
- if there are any hostnames defined in
- if configmap exists and
- 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 intoguessed
variable
- if value is greater then value in
- take the hostname with highest number and +1
- if there are any members in output from etcd
- 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 intoguessed
variable
- if value is greater then value in
- take the hostname of the pod for endpoint with highest number and +1
- connect to the cluster using endpoint and collect information from
- if there are any endpoints
- 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 intoguessed
variable
- if value is greater then value in
- take the name of the pvc with highest number and +1
- if there are any pvcs
- 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 intoguessed
variable
- if value is greater then value in
- take the pod name with highest number and +1
- if there are any pods
- return
guessed
Metadata
Metadata
Assignees
Labels
No labels