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

chore: refactor roles #1428

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions addons/apecloud-mysql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,14 @@ tls:
keyFile: key.pem
roles:
- name: leader
serviceable: true
writable: true
votable: true
updatePriority: 3
participatesInQuorum: true
- name: follower
serviceable: true
writable: false
votable: true
updatePriority: 2
participatesInQuorum: true
- name: learner
serviceable: false
writable: false
votable: false
updatePriority: 1
participatesInQuorum: false
lifecycleActions:
roleProbe:
periodSeconds: {{ .Values.roleProbe.periodSeconds }}
Expand Down
15 changes: 6 additions & 9 deletions addons/apecloud-postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,14 @@ volumes:
needSnapshot: false
roles:
- name: leader
serviceable: true
writable: true
votable: true
updatePriority: 3
participatesInQuorum: true
- name: follower
serviceable: true
writable: false
votable: true
updatePriority: 2
participatesInQuorum: true
- name: learner
serviceable: false
writable: false
votable: false
updatePriority: 1
participatesInQuorum: false
vars:
## the postgres leader pod name which is dynamically selected, caution to use it
- name: POSTGRES_LEADER_POD_NAME
Expand Down
10 changes: 4 additions & 6 deletions addons/etcd/templates/cmpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ spec:
updateStrategy: Serial
roles:
- name: leader
serviceable: true
writable: true
votable: true
updatePriority: 2
participatesInQuorum: true
- name: follower
serviceable: true
writable: false
votable: true
updatePriority: 1
participatesInQuorum: true
lifecycleActions:
roleProbe:
exec:
Expand Down
5 changes: 2 additions & 3 deletions addons/minio/templates/cmpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ spec:

roles:
- name: readwrite
serviceable: true
votable: false
writable: true
updatePriority: 1
participatesInQuorum: false

lifecycleActions:
roleProbe:
Expand Down
8 changes: 4 additions & 4 deletions addons/mogdb/templates/cmpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ spec:
{{- end }}
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
systemAccounts:
- name: root
initAccount: true
Expand Down
10 changes: 4 additions & 6 deletions addons/mongodb/templates/componentdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ spec:
letterCase: MixedCases
roles:
- name: primary
serviceable: true
writable: true
votable: true
updatePriority: 2
participatesInQuorum: true
- name: secondary
serviceable: true
writable: false
votable: true
updatePriority: 1
participatesInQuorum: true
lifecycleActions:
roleProbe:
periodSeconds: {{ .Values.roleProbe.periodSeconds }}
Expand Down
16 changes: 8 additions & 8 deletions addons/mysql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ lifecycleActions:
/tools/syncerctl switchover --primary "$KB_SWITCHOVER_CURRENT_NAME" ${KB_SWITCHOVER_CANDIDATE_NAME:+--candidate "$KB_SWITCHOVER_CANDIDATE_NAME"}
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: true
writable: false
updatePriority: 1
participatesInQuorum: false
{{- end }}

{{- define "mysql.spec.runtime.common" -}}
Expand Down Expand Up @@ -248,11 +248,11 @@ systemAccounts:
statement: CREATE USER IF NOT EXISTS '${KB_ACCOUNT_NAME}' IDENTIFIED BY '${KB_ACCOUNT_PASSWORD}'; GRANT SELECT ON performance_schema.* TO '${KB_ACCOUNT_NAME}'; GRANT SELECT ON sys.* TO '${KB_ACCOUNT_NAME}';
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: true
writable: false
updatePriority: 1
participatesInQuorum: false
vars:
- name: CLUSTER_NAME
valueFrom:
Expand Down
10 changes: 4 additions & 6 deletions addons/orchestrator/templates/cmpd-raft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ spec:
{{- include "orchestrator.cmpd.spec.common" . | nindent 2 }}
roles:
- name: primary
serviceable: true
writable: true
votable: true
updatePriority: 2
participatesInQuorum: true
- name: secondary
serviceable: true
writable: false
votable: true
updatePriority: 1
participatesInQuorum: true
vars:
- name: COMPONENT_NAME
valueFrom:
Expand Down
10 changes: 4 additions & 6 deletions addons/polardbx/templates/cmpd-dn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ spec:
updateStrategy: Serial
roles:
- name: leader
serviceable: true
writable: true
votable: true
updatePriority: 2
participatesInQuorum: true
- name: follower
serviceable: true
writable: false
votable: true
updatePriority: 1
participatesInQuorum: true
volumes:
- name: data
vars:
Expand Down
10 changes: 4 additions & 6 deletions addons/polardbx/templates/cmpd-gms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ spec:
updateStrategy: Serial
roles:
- name: leader
serviceable: true
writable: true
votable: true
updatePriority: 2
participatesInQuorum: true
- name: follower
serviceable: true
writable: false
votable: true
updatePriority: 1
participatesInQuorum: true
volumes:
- name: data
vars:
Expand Down
8 changes: 4 additions & 4 deletions addons/postgresql/templates/componentdefinition-12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ spec:
needSnapshot: true
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
logConfigs:
{{- range $name,$pattern := .Values.logConfigs }}
- name: {{ $name }}
Expand Down
8 changes: 4 additions & 4 deletions addons/postgresql/templates/componentdefinition-14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ spec:
needSnapshot: true
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
logConfigs:
{{- range $name,$pattern := .Values.logConfigs }}
- name: {{ $name }}
Expand Down
8 changes: 4 additions & 4 deletions addons/postgresql/templates/componentdefinition-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ spec:
needSnapshot: true
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
logConfigs:
{{- range $name,$pattern := .Values.logConfigs }}
- name: {{ $name }}
Expand Down
8 changes: 4 additions & 4 deletions addons/postgresql/templates/componentdefinition-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ spec:
needSnapshot: true
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
logConfigs:
{{- range $name,$pattern := .Values.logConfigs }}
- name: {{ $name }}
Expand Down
8 changes: 4 additions & 4 deletions addons/redis/templates/cmpd-redis-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ spec:
needSnapshot: true
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
logConfigs:
{{- range $name,$pattern := .Values.logConfigs }}
- name: {{ $name }}
Expand Down
8 changes: 4 additions & 4 deletions addons/redis/templates/cmpd-redis-cluster-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ spec:
needSnapshot: true
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: false
writable: false
updatePriority: 1
participatesInQuorum: false
logConfigs:
{{- range $name,$pattern := .Values.logConfigs }}
- name: {{ $name }}
Expand Down
10 changes: 4 additions & 6 deletions addons/tidb/templates/componentdefinition-pd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ spec:
volumeName: config
roles:
- name: leader
serviceable: true
votable: true
writable: true
updatePriority: 2
participatesInQuorum: true
- name: follower
serviceable: true
votable: true
writable: false
updatePriority: 1
participatesInQuorum: true
lifecycleActions:
roleProbe:
exec:
Expand Down
8 changes: 4 additions & 4 deletions addons/vanilla-postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ services:
roleSelector: primary
roles:
- name: primary
serviceable: true
writable: true
updatePriority: 2
participatesInQuorum: false
- name: secondary
serviceable: true
writable: false
updatePriority: 1
participatesInQuorum: false
volumes:
- name: data
needSnapshot: true
Expand Down
15 changes: 6 additions & 9 deletions addons/zookeeper/templates/cmpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ spec:
port: 8080
roles:
- name: leader
serviceable: true
writable: true
votable: true
updatePriority: 3
participatesInQuorum: true
- name: follower
serviceable: true
writable: false
votable: true
updatePriority: 2
participatesInQuorum: true
- name: observer
serviceable: false
writable: false
votable: false
updatePriority: 1
participatesInQuorum: false
updateStrategy: BestEffortParallel
vars:
- name: ZOOKEEPER_POD_FQDN_LIST
Expand Down
Loading