Skip to content

Commit

Permalink
Document leader-election configuration
Browse files Browse the repository at this point in the history
The leader-election config did not describe what the options did and were set to the default values. See https://github.com/knative/pkg/blob/e60d250dc6378c387c8c9d149774ee21e9a827ab/leaderelection/config.go#L121-L127
This commit adds block of commented out example config (like we do in config-defaults). The actual content was taken from https://github.com/knative/serving/blob/f9951ecf37709bb160fd513591e84b6e6f50f6f8/config/core/configmaps/leader-election.yaml
  • Loading branch information
dibyom authored and tekton-robot committed Jul 12, 2022
1 parent 3f01be0 commit 0bf2111
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions config/config-leader-election.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,32 @@ metadata:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
data:
# An inactive but valid configuration follows; see example.
lease-duration: "60s"
renew-deadline: "40s"
retry-period: "10s"
_example: |
################################
# #
# EXAMPLE CONFIGURATION #
# #
################################
# This block is not actually functional configuration,
# but serves to illustrate the available configuration
# options and document them in a way that is accessible
# to users that `kubectl edit` this config map.
#
# These sample configuration options may be copied out of
# this example block and unindented to be in the data block
# to actually change the configuration.
# lease-duration is how long non-leaders will wait to try to acquire the
# lock; 15 seconds is the value used by core kubernetes controllers.
lease-duration: "60s"
# renew-deadline is how long a leader will try to renew the lease before
# giving up; 10 seconds is the value used by core kubernetes controllers.
renew-deadline: "40s"
# retry-period is how long the leader election client waits between tries of
# actions; 2 seconds is the value used by core kubernetes controllers.
retry-period: "10s"
# buckets is the number of buckets used to partition key space of each
# Reconciler. If this number is M and the replica number of the controller
# is N, the N replicas will compete for the M buckets. The owner of a
# bucket will take care of the reconciling for the keys partitioned into
# that bucket.
buckets: "1"

0 comments on commit 0bf2111

Please sign in to comment.