Skip to content

Commit 266b483

Browse files
Bump CAPI to v1.8.4
Signed-off-by: Furkat Gofurov <[email protected]>
1 parent 2d23589 commit 266b483

16 files changed

+3352
-1514
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ GO_INSTALL := ./scripts/go_install.sh
5353
export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
5454

5555
# Kubebuilder
56-
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.26.1
56+
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.310
5757
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?= 60s
5858
export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?= 60s
5959

@@ -66,7 +66,7 @@ IMAGE_REVIEWERS ?= $(shell ./hack/get-project-maintainers.sh)
6666

6767
# Binaries.
6868
# Need to use abspath so we can invoke these from subdirectories
69-
CONTROLLER_GEN_VER := v0.14.0
69+
CONTROLLER_GEN_VER := v0.15.0
7070
CONTROLLER_GEN_BIN := controller-gen
7171
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
7272

@@ -78,15 +78,19 @@ KUSTOMIZE_VER := v5.0.1
7878
KUSTOMIZE_BIN := kustomize
7979
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)
8080

81-
SETUP_ENVTEST_VER := v0.0.0-20240215143116-d0396a3d6f9f
81+
# This is a commit from CR main (22.05.2024).
82+
# Intentionally using a commit from main to use a setup-envtest version
83+
# that uses binaries from controller-tools, not GCS.
84+
# CR PR: https://github.com/kubernetes-sigs/controller-runtime/pull/2811
85+
SETUP_ENVTEST_VER := v0.0.0-20240522175850-2e9781e9fc60
8286
SETUP_ENVTEST_BIN := setup-envtest
8387
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER)
8488

8589
GOTESTSUM_VER := v1.11.0
8690
GOTESTSUM_BIN := gotestsum
8791
GOTESTSUM := $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER)
8892

89-
GINKGO_VER := v2.17.1
93+
GINKGO_VER := v2.20.1
9094
GINKGO_BIN := ginkgo
9195
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)
9296

cmd/main.go

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,23 @@ var (
5454
setupLog = ctrl.Log.WithName("setup")
5555

5656
// flags.
57-
enableLeaderElection bool
58-
leaderElectionLeaseDuration time.Duration
59-
leaderElectionRenewDeadline time.Duration
60-
leaderElectionRetryPeriod time.Duration
61-
watchFilterValue string
62-
watchNamespace string
63-
profilerAddress string
64-
enableContentionProfiling bool
65-
concurrencyNumber int
66-
syncPeriod time.Duration
67-
webhookPort int
68-
webhookCertDir string
69-
healthAddr string
70-
watchConfigSecretChanges bool
71-
diagnosticsOptions = flags.DiagnosticsOptions{}
57+
enableLeaderElection bool
58+
leaderElectionLeaseDuration time.Duration
59+
leaderElectionRenewDeadline time.Duration
60+
leaderElectionRetryPeriod time.Duration
61+
watchFilterValue string
62+
watchNamespace string
63+
profilerAddress string
64+
enableContentionProfiling bool
65+
concurrencyNumber int
66+
syncPeriod time.Duration
67+
clusterCacheTrackerClientQPS float32
68+
clusterCacheTrackerClientBurst int
69+
webhookPort int
70+
webhookCertDir string
71+
healthAddr string
72+
watchConfigSecretChanges bool
73+
managerOptions = flags.ManagerOptions{}
7274
)
7375

7476
func init() {
@@ -117,6 +119,12 @@ func InitFlags(fs *pflag.FlagSet) {
117119
fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute,
118120
"The minimum interval at which watched resources are reconciled (e.g. 15m)")
119121

122+
fs.Float32Var(&clusterCacheTrackerClientQPS, "clustercachetracker-client-qps", 20,
123+
"Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters.")
124+
125+
fs.IntVar(&clusterCacheTrackerClientBurst, "clustercachetracker-client-burst", 30,
126+
"Maximum number of queries that should be allowed in one burst from the cluster cache tracker clients to the Kubernetes API server of workload clusters.")
127+
120128
fs.IntVar(&webhookPort, "webhook-port", 9443, "Webhook Server port")
121129

122130
fs.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/",
@@ -125,7 +133,7 @@ func InitFlags(fs *pflag.FlagSet) {
125133
fs.StringVar(&healthAddr, "health-addr", ":9440",
126134
"The address the health endpoint binds to.")
127135

128-
flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
136+
flags.AddManagerOptions(fs, &managerOptions)
129137
}
130138

131139
func main() {
@@ -136,7 +144,11 @@ func main() {
136144
ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig()))
137145
restConfig := ctrl.GetConfigOrDie()
138146

139-
diagnosticsOpts := flags.GetDiagnosticsOptions(diagnosticsOptions)
147+
tlsOptions, metricsOptions, err := flags.GetManagerOptions(managerOptions)
148+
if err != nil {
149+
setupLog.Error(err, "Unable to start manager: invalid flags")
150+
os.Exit(1)
151+
}
140152

141153
var watchNamespaces map[string]cache.Config
142154
if watchNamespace != "" {
@@ -158,7 +170,7 @@ func main() {
158170
RetryPeriod: &leaderElectionRetryPeriod,
159171
HealthProbeBindAddress: healthAddr,
160172
PprofBindAddress: profilerAddress,
161-
Metrics: diagnosticsOpts,
173+
Metrics: *metricsOptions,
162174
Cache: cache.Options{
163175
DefaultNamespaces: watchNamespaces,
164176
SyncPeriod: &syncPeriod,
@@ -175,6 +187,7 @@ func main() {
175187
ctrlwebhook.Options{
176188
Port: webhookPort,
177189
CertDir: webhookCertDir,
190+
TLSOpts: tlsOptions,
178191
},
179192
),
180193
}

0 commit comments

Comments
 (0)