Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.
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
53 changes: 31 additions & 22 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ required = [

[[override]]
name = "knative.dev/pkg"
branch = "release-0.12"
branch = "release-0.13"

[[override]]
name = "knative.dev/test-infra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ func main() {
if err != nil {
log.Fatal("Error building kubeconfig", err)
}
sharedmain.MainWithConfig(signals.NewContext(), "serving_operator", cfg, knativeserving.NewController)
sharedmain.MainWithConfig(signals.NewContext(), "serving-operator", cfg, knativeserving.NewController)
}
64 changes: 64 additions & 0 deletions config/config-leader-election.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: config-leader-election
labels:
serving.knative.dev/release: devel
data:
# An inactive but valid configuration follows; see example.
resourceLock: "leases"
leaseDuration: "15s"
renewDeadline: "10s"
retryPeriod: "2s"
_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.

# resourceLock controls which API resource is used as the basis for the
# leader election lock. Valid values are:
#
# - leases -> use the coordination API
# - configmaps -> use configmaps
# - endpoints -> use endpoints
resourceLock: "leases"

# leaseDuration is how long non-leaders will wait to try to acquire the
# lock; 15 seconds is the value used by core kubernetes controllers.
leaseDuration: "15s"
# renewDeadline is how long a leader will try to renew the lease before
# giving up; 10 seconds is the value used by core kubernetes controllers.
renewDeadline: "10s"
# retryPeriod is how long the leader election client waits between tries of
# actions; 2 seconds is the value used by core kubernetes controllers.
retryPeriod: "2s"
# enabledComponents is a comma-delimited list of component names for which
# leader election is enabled. Valid values are:
#
# - serving-operator
enabledComponents: "serving-operator"
6 changes: 6 additions & 0 deletions config/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ rules:
- '*'
verbs:
- '*'
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
Loading