Skip to content

Commit

Permalink
Bump CAPI to v1.8.4
Browse files Browse the repository at this point in the history
Signed-off-by: Furkat Gofurov <[email protected]>
  • Loading branch information
furkatgofurov7 committed Nov 5, 2024
1 parent 2d23589 commit 266b483
Show file tree
Hide file tree
Showing 16 changed files with 3,352 additions and 1,514 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GO_INSTALL := ./scripts/go_install.sh
export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)

# Kubebuilder
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.26.1
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.310
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?= 60s
export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?= 60s

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

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

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

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

GOTESTSUM_VER := v1.11.0
GOTESTSUM_BIN := gotestsum
GOTESTSUM := $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER)

GINKGO_VER := v2.17.1
GINKGO_VER := v2.20.1
GINKGO_BIN := ginkgo
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)

Expand Down
49 changes: 31 additions & 18 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,23 @@ var (
setupLog = ctrl.Log.WithName("setup")

// flags.
enableLeaderElection bool
leaderElectionLeaseDuration time.Duration
leaderElectionRenewDeadline time.Duration
leaderElectionRetryPeriod time.Duration
watchFilterValue string
watchNamespace string
profilerAddress string
enableContentionProfiling bool
concurrencyNumber int
syncPeriod time.Duration
webhookPort int
webhookCertDir string
healthAddr string
watchConfigSecretChanges bool
diagnosticsOptions = flags.DiagnosticsOptions{}
enableLeaderElection bool
leaderElectionLeaseDuration time.Duration
leaderElectionRenewDeadline time.Duration
leaderElectionRetryPeriod time.Duration
watchFilterValue string
watchNamespace string
profilerAddress string
enableContentionProfiling bool
concurrencyNumber int
syncPeriod time.Duration
clusterCacheTrackerClientQPS float32
clusterCacheTrackerClientBurst int
webhookPort int
webhookCertDir string
healthAddr string
watchConfigSecretChanges bool
managerOptions = flags.ManagerOptions{}
)

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

fs.Float32Var(&clusterCacheTrackerClientQPS, "clustercachetracker-client-qps", 20,
"Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters.")

fs.IntVar(&clusterCacheTrackerClientBurst, "clustercachetracker-client-burst", 30,
"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.")

fs.IntVar(&webhookPort, "webhook-port", 9443, "Webhook Server port")

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

flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
flags.AddManagerOptions(fs, &managerOptions)
}

func main() {
Expand All @@ -136,7 +144,11 @@ func main() {
ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig()))
restConfig := ctrl.GetConfigOrDie()

diagnosticsOpts := flags.GetDiagnosticsOptions(diagnosticsOptions)
tlsOptions, metricsOptions, err := flags.GetManagerOptions(managerOptions)
if err != nil {
setupLog.Error(err, "Unable to start manager: invalid flags")
os.Exit(1)
}

var watchNamespaces map[string]cache.Config
if watchNamespace != "" {
Expand All @@ -158,7 +170,7 @@ func main() {
RetryPeriod: &leaderElectionRetryPeriod,
HealthProbeBindAddress: healthAddr,
PprofBindAddress: profilerAddress,
Metrics: diagnosticsOpts,
Metrics: *metricsOptions,
Cache: cache.Options{
DefaultNamespaces: watchNamespaces,
SyncPeriod: &syncPeriod,
Expand All @@ -175,6 +187,7 @@ func main() {
ctrlwebhook.Options{
Port: webhookPort,
CertDir: webhookCertDir,
TLSOpts: tlsOptions,
},
),
}
Expand Down
Loading

0 comments on commit 266b483

Please sign in to comment.