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

Write basic etcd-operator spec #9

Closed
kvaps opened this issue Mar 12, 2024 · 5 comments · Fixed by #16 or #15
Closed

Write basic etcd-operator spec #9

kvaps opened this issue Mar 12, 2024 · 5 comments · Fixed by #16 or #15
Milestone

Comments

@kvaps
Copy link
Member

kvaps commented Mar 12, 2024

We agreed on the next spec:

---
apiVersion: etcd.aenix.io/v1alpha1
kind: EtcdCluster
metadata:
  name: test
  namespace: ns1
spec:
  replicas: 3
  storage:
    storageClass: local-path
    size: 10Gi
status:
  conditions:
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:39Z"
     status: "True"
     type: Initialized
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:45Z"
     status: "True"
     type: Ready
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:45Z"
     status: "True"
     type: Synchronized
@AlexGluck
Copy link
Collaborator

AlexGluck commented Mar 12, 2024

  1. Before we implement PodTemplate, i suggest add opt-in image in spec
  2. Solution for storage persistent: false use emptyDir, if not set default value true
  3. Solution for storage value storageClass opt-in, if not set use default storage class
---
apiVersion: etcd.aenix.io/v1alpha1
kind: EtcdCluster
metadata:
  name: test
  namespace: ns1
spec:
  replicas: 3
  image: ""
  persistent: false
  storage:
    size: 10Gi
status:
  conditions:
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:39Z"
     status: "True"
     type: Initialized
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:45Z"
     status: "True"
     type: Ready
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:45Z"
     status: "True"
     type: Synchronized
...

@sedovandrew
Copy link

  1. I would suggest specifying the Etc version of the cluster in the spec. By default, the operator will use the latest version of Etc known to him, for example, v3.5.12 at the moment. Also specify the version in status, so that the operator understands which cluster he is servicing.
  2. I didn't see the field for the storage class.

I suggest adding the following fields:

spec:
  storage:
    class: storage-class-name  # optional #2
  version: v3.5.12  # optional #1
status:
  version: v3.5.12  # #1

Final manifest:

apiVersion: etcd.aenix.io/v1alpha1
kind: EtcdCluster
metadata:
  name: test
  namespace: ns1
spec:
  replicas: 3
  image: ""
  persistent: false
  storage:
    class: storage-class-name  # optional #2
    size: 10Gi
  version: v3.5.12  # optional #1
status:
  conditions:
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:39Z"
     status: "True"
     type: Initialized
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:45Z"
     status: "True"
     type: Ready
  - lastProbeTime: null
     lastTransitionTime: "2024-03-06T18:39:45Z"
     status: "True"
     type: Synchronized
  version: v3.5.12  # #1

It is also worth considering the list of Etcd versions supported by the operator.

@sircthulhu
Copy link
Member

@AlexGluck thanks for your suggestions.
I think I will include them in my implementation.

Is there a reason for persistence field to be not in the .spec.storage but .spec?

gecube pushed a commit that referenced this issue Mar 13, 2024
Generated and wrote the most basic EtcdCluster custom resource.
See #9
@kvaps kvaps added this to the v0.0.1 milestone Mar 13, 2024
@kvaps
Copy link
Member Author

kvaps commented Mar 13, 2024

Fixed by #15 and #16

@AlexGluck
Copy link
Collaborator

AlexGluck commented Mar 14, 2024

Is there a reason for persistence field to be not in the .spec.storage but .spec?

Nope

This was linked to pull requests Mar 15, 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
4 participants