Skip to content

Commit 6d2e83a

Browse files
feat: watch-based route reconciliation (#970)
Switch to manually created dependencies for `cloud-provider` and `controller-manager`. These patches contain a feature gate, which enables watch-based reconciliation in the routes' controller of cloud-controller-manager, reducing API calls. Previously the routes where reconciled every ten seconds. This feature is for an upcoming preview release, which is used to test our current upstream contribution at Kubernetes. Two forks of `cloud-provider` and `controller-manager` are used. The tag `v0.33.2` is used as a base, with the necessary patches applied manually. This feature will be revered upon completing our tests. Upstream WIP PR: kubernetes/kubernetes#131220 Kubernetes Enhancement Proposal: kubernetes/enhancements#5289 Fork of `cloud-provider`: https://github.com/lukasmetzner/cloud-provider Fork of `controller-manager`: https://github.com/lukasmetzner/controller-manager --------- Co-authored-by: Julian Tölle <julian.toelle@hetzner-cloud.de>
1 parent 2c263f6 commit 6d2e83a

File tree

7 files changed

+50
-397
lines changed

7 files changed

+50
-397
lines changed

chart/.snapshots/default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ spec:
6464
args:
6565
- "--allow-untagged-cloud"
6666
- "--cloud-provider=hcloud"
67+
- "--feature-gates=CloudControllerManagerWatchBasedRoutesReconciliation=false"
6768
- "--route-reconciliation-period=30s"
6869
- "--webhook-secure-port=0"
6970
- "--leader-elect=false"

chart/.snapshots/full.daemonset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ spec:
7474
- "/bin/hcloud-cloud-controller-manager"
7575
- "--allow-untagged-cloud"
7676
- "--cloud-provider=hcloud"
77+
- "--feature-gates=CloudControllerManagerWatchBasedRoutesReconciliation=false"
7778
- "--route-reconciliation-period=30s"
7879
- "--webhook-secure-port=0"
7980
env:

chart/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ args:
1616
# https://github.com/hetznercloud/hcloud-cloud-controller-manager/issues/492
1717
webhook-secure-port: "0"
1818

19+
# Experimental feature, which enables route reconciliation based on the following Kubernetes events:
20+
# - Node added
21+
# - Node deleted
22+
# - Node PodCIDRs, or Addresses updated
23+
# This replaces the fixed route reconcile interval of 30s
24+
feature-gates: "CloudControllerManagerWatchBasedRoutesReconciliation=false"
25+
1926
# Change deployment kind from "Deployment" to "DaemonSet"
2027
kind: Deployment
2128

deploy/ccm-networks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ spec:
6363
args:
6464
- "--allow-untagged-cloud"
6565
- "--cloud-provider=hcloud"
66+
- "--feature-gates=CloudControllerManagerWatchBasedRoutesReconciliation=false"
6667
- "--route-reconciliation-period=30s"
6768
- "--webhook-secure-port=0"
6869
- "--allocate-node-cidrs=true"

deploy/ccm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ spec:
6262
args:
6363
- "--allow-untagged-cloud"
6464
- "--cloud-provider=hcloud"
65+
- "--feature-gates=CloudControllerManagerWatchBasedRoutesReconciliation=false"
6566
- "--route-reconciliation-period=30s"
6667
- "--webhook-secure-port=0"
6768
- "--leader-elect=false"

go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ require (
2424
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
2525
github.com/NYTimes/gziphandler v1.1.1 // indirect
2626
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
27-
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
2827
github.com/beorn7/perks v1.0.1 // indirect
2928
github.com/blang/semver/v4 v4.0.0 // indirect
3029
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
@@ -42,21 +41,17 @@ require (
4241
github.com/go-openapi/jsonreference v0.20.2 // indirect
4342
github.com/go-openapi/swag v0.23.0 // indirect
4443
github.com/gogo/protobuf v1.3.2 // indirect
45-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4644
github.com/golang/protobuf v1.5.4 // indirect
4745
github.com/google/btree v1.1.3 // indirect
4846
github.com/google/cel-go v0.23.2 // indirect
4947
github.com/google/gnostic-models v0.6.9 // indirect
5048
github.com/google/go-cmp v0.7.0 // indirect
51-
github.com/google/gofuzz v1.2.0 // indirect
5249
github.com/google/uuid v1.6.0 // indirect
5350
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
5451
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
55-
github.com/imdario/mergo v0.3.16 // indirect
5652
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5753
github.com/josharian/intern v1.0.0 // indirect
5854
github.com/json-iterator/go v1.1.12 // indirect
59-
github.com/klauspost/compress v1.18.0 // indirect
6055
github.com/kylelemons/godebug v1.1.0 // indirect
6156
github.com/mailru/easyjson v0.7.7 // indirect
6257
github.com/moby/term v0.5.0 // indirect
@@ -102,7 +97,6 @@ require (
10297
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
10398
gopkg.in/inf.v0 v0.9.1 // indirect
10499
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
105-
gopkg.in/yaml.v2 v2.4.0 // indirect
106100
gopkg.in/yaml.v3 v3.0.1 // indirect
107101
k8s.io/apiserver v0.33.2 // indirect
108102
k8s.io/component-helpers v0.33.2 // indirect
@@ -116,3 +110,7 @@ require (
116110
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
117111
sigs.k8s.io/yaml v1.4.0 // indirect
118112
)
113+
114+
replace k8s.io/cloud-provider v0.33.2 => github.com/lukasmetzner/cloud-provider v1.33.2-watch-based-route-reconcile
115+
116+
replace k8s.io/controller-manager v0.33.2 => github.com/lukasmetzner/controller-manager v1.33.2-watch-based-route-reconcile

0 commit comments

Comments
 (0)