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

Make an option to create PDB for cluster #61

Closed
sircthulhu opened this issue Mar 22, 2024 · 6 comments · Fixed by #93
Closed

Make an option to create PDB for cluster #61

sircthulhu opened this issue Mar 22, 2024 · 6 comments · Fixed by #93
Milestone

Comments

@sircthulhu
Copy link
Member

I think we should add an option to create PDB for cluster.

 ---
 apiVersion: etcd.aenix.io/v1alpha1
 kind: EtcdCluster
 metadata:
   name: test
   namespace: ns1
 spec:
   image: "quay.io/coreos/etcd:v3.5.12"
   replicas: 3
  storage:
    persistence: true # default: true, immutable
    storageClass: local-path
    size: 10Gi
+ enablePDB:  true
 status:
   conditions:
   - lastProbeTime: null
 	lastTransitionTime: "2024-03-06T18:39:45Z"
 	status: "True"
 	type: Ready

By default it should be true meaning that PDB resource will be created with maxUnavailable field equal to the maximum number of members can die without losing quorum

@kvaps
Copy link
Member

kvaps commented Mar 22, 2024

Shouldn't it be created automatically?

@AlexGluck
Copy link
Collaborator

Should we focus on the alpha2 version of the specification and stop expanding alpha1? Writing and rewriting code can be uncomfortable for developers.

@kvaps
Copy link
Member

kvaps commented Mar 23, 2024

@AlexGluck We need to create next API version only in case if some field get removed or renamed

@sircthulhu
Copy link
Member Author

@AlexGluck Creating next api version will force us to update both old and new CRD leading to even more uncomfortable development :)

See kubebuilder docs

In Kubernetes, all versions must be safely round-tripable through each other. This means that if we convert from version 1 to version 2, and then back to version 1, we must not lose information. Thus, any change we make to our API must be compatible with whatever we supported in v1, and also need to make sure anything we add in v2 is supported in v1. In some cases, this means we need to add new fields to v1, but in our case, we won’t have to, since we’re not adding new functionality.

@AlexGluck
Copy link
Collaborator

While we don't accepted PR #63 we can be on time move key.

@sergeyshevch
Copy link
Member

For now we can use this specification #62 (comment) for PDB and extend it later if required

@sircthulhu sircthulhu self-assigned this Mar 28, 2024
@sircthulhu sircthulhu moved this to In review in etcd-operator Mar 29, 2024
sircthulhu added a commit that referenced this issue Apr 2, 2024
Added PDB to spec, implemented webhooks and tests.

Fixes #61
@github-project-automation github-project-automation bot moved this from In review to Done in etcd-operator Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants