Skip to content

Commit

Permalink
chart: set leader-elect-resource-lock when deploying asts controller (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored Dec 7, 2023
1 parent e222b4f commit 3863d3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ spec:
- --leader-elect
- --leader-elect-resource-name=advanced-statefulset-controller
- --leader-elect-resource-namespace=$(POD_NAMESPACE)
{{- if .Values.advancedStatefulset.resourceLock }}
- --leader-elect-resource-lock={{ .Values.advancedStatefulset.resourceLock }}
{{- end }}
env:
- name: POD_NAMESPACE
valueFrom:
Expand Down
6 changes: 6 additions & 0 deletions charts/tidb-operator/templates/advanced-statefulset-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ rules:
- 'endpoints'
verbs:
- '*'
- apiGroups:
- 'coordination.k8s.io'
resources:
- 'leases'
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
3 changes: 3 additions & 0 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ scheduler:
# kubectl apply -f manifests/advanced-statefulset-crd.v1.yaml
advancedStatefulset:
create: false
## resourceLock indicates the type of resource object that will be used for locking during leader election.
## If using "endpoints" before and want to migrate to "leases", you should migrate to "endpointsleases" first.
# resourceLock: "leases"
image: pingcap/advanced-statefulset:v0.4.0
imagePullPolicy: IfNotPresent
serviceAccount: advanced-statefulset-controller
Expand Down

0 comments on commit 3863d3e

Please sign in to comment.