Skip to content

Commit 17d7b0d

Browse files
ahrtrnwnt
authored andcommitted
Replace StatefulSets with a customized controller
Based on the original [PR](etcd-io#363 (comment)) Signed-off-by: Nont <9658731+nwnt@users.noreply.github.com>
1 parent ddb834e commit 17d7b0d

15 files changed

Lines changed: 1601 additions & 2100 deletions

api/v1alpha1/etcdcluster_types.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,11 @@ type EtcdClusterStatus struct {
143143
// +optional
144144
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
145145

146-
// CurrentReplicas is the number of etcd pods managed by the StatefulSet for this cluster.
147-
// This reflects the .spec.replicas of the underlying StatefulSet.
146+
// CurrentReplicas is the number of etcd member pods currently owned by this cluster.
148147
// +optional
149148
CurrentReplicas int32 `json:"currentReplicas,omitempty"`
150149

151-
// ReadyReplicas is the number of etcd pods managed by the StatefulSet that are currently ready.
152-
// This reflects the .status.readyReplicas of the underlying StatefulSet.
150+
// ReadyReplicas is the number of etcd member pods that are currently Ready.
153151
// +optional
154152
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
155153

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/operator.etcd.io_etcdclusters.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.20.1
6+
controller-gen.kubebuilder.io/version: v0.21.0
77
name: etcdclusters.operator.etcd.io
88
spec:
99
group: operator.etcd.io
@@ -1256,9 +1256,8 @@ spec:
12561256
- type
12571257
x-kubernetes-list-type: map
12581258
currentReplicas:
1259-
description: |-
1260-
CurrentReplicas is the number of etcd pods managed by the StatefulSet for this cluster.
1261-
This reflects the .spec.replicas of the underlying StatefulSet.
1259+
description: CurrentReplicas is the number of etcd member pods currently
1260+
owned by this cluster.
12621261
format: int32
12631262
type: integer
12641263
currentVersion:
@@ -1327,9 +1326,8 @@ spec:
13271326
format: int64
13281327
type: integer
13291328
readyReplicas:
1330-
description: |-
1331-
ReadyReplicas is the number of etcd pods managed by the StatefulSet that are currently ready.
1332-
This reflects the .status.readyReplicas of the underlying StatefulSet.
1329+
description: ReadyReplicas is the number of etcd member pods that
1330+
are currently Ready.
13331331
format: int32
13341332
type: integer
13351333
type: object

config/rbac/role.yaml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ kind: ClusterRole
44
metadata:
55
name: manager-role
66
rules:
7-
- apiGroups:
8-
- ""
9-
resources:
10-
- configmaps
11-
- secrets
12-
- services
13-
verbs:
14-
- create
15-
- delete
16-
- get
17-
- list
18-
- patch
19-
- update
20-
- watch
217
- apiGroups:
228
- ""
239
resources:
@@ -29,9 +15,12 @@ rules:
2915
- patch
3016
- update
3117
- apiGroups:
32-
- apps
18+
- ""
3319
resources:
34-
- statefulsets
20+
- persistentvolumeclaims
21+
- pods
22+
- secrets
23+
- services
3524
verbs:
3625
- create
3726
- delete

0 commit comments

Comments
 (0)