Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Kubernetes and controller-runtime dependencies #516

Merged
merged 8 commits into from
Jan 3, 2024
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ compatible with certain Vitess and Kubernetes versions, as shown in this table:
| `v2.9.*` | `v16.0.*` | `v1.22.*`, `v1.23.*`, or `v1.24.*` |
| `v2.10.*` | `v17.0.*` | `v1.22.*`, `v1.23.*`, `v1.24.*`, or `v1.25.*` |
| `v2.11.*` | `v18.0.*` | `v1.22.*`, `v1.23.*`, `v1.24.*`, or `v1.25.*` |
| `latest` | `latest` | `v1.22.*`, `v1.23.*`, `v1.24.*`, or `v1.25.*` |
| `latest` | `latest` | `v1.25.*`, `v1.26.*`, `v1.27.*`, or `v1.28.*` |

If for some reason you must attempt to use versions outside the recommend
window, we still welcome bug reports since a workaround might be possible.
Expand Down
24 changes: 14 additions & 10 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand Down Expand Up @@ -94,17 +95,20 @@ func main() {
}

options := manager.Options{
Namespace: namespace,
SyncPeriod: cacheInvalidateInterval,
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Cache: cache.Options{
SyncPeriod: cacheInvalidateInterval,
},
Metrics: server.Options{
BindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
},
}
// Add support for MultiNamespace set in WATCH_NAMESPACE (e.g ns1,ns2)
// Note that this is not intended to be used for excluding namespaces, this is better done via a Predicate
// Also note that you may face performance issues when using this with a high number of namespaces.
// More Info: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/cache#MultiNamespacedCacheBuilder
if strings.Contains(namespace, ",") {
options.Namespace = ""
options.NewCache = cache.MultiNamespacedCacheBuilder(strings.Split(namespace, ","))

if namespace != "" {
cacheConfigMap := map[string]cache.Config{}
for _, ns := range strings.Split(namespace, ",") {
cacheConfigMap[ns] = cache.Config{}
}
options.Cache.DefaultNamespaces = cacheConfigMap
}
mgr, err := controllermanager.New(forkPath, cfg, options)
if err != nil {
Expand Down
105 changes: 53 additions & 52 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ require (
github.com/ahmetb/gen-crd-api-reference-docs v0.1.5-0.20190629210212-52e137b8d003
github.com/google/uuid v1.3.1
github.com/planetscale/operator-sdk-libs v0.0.0-20220216002626-1af183733234
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/client_golang v1.16.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.2
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
k8s.io/api v0.28.5
k8s.io/apimachinery v0.28.5
k8s.io/client-go v0.28.5
k8s.io/klog v1.0.0
k8s.io/kubectl v0.21.9
k8s.io/kubernetes v1.26.5
k8s.io/utils v0.0.0-20230115233650-391b47cb4029
sigs.k8s.io/controller-runtime v0.14.3
k8s.io/kubernetes v1.28.5
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/controller-tools v0.11.3
sigs.k8s.io/kustomize v2.0.3+incompatible
vitess.io/vitess v0.10.3-0.20231222054134-d807985131ed
Expand Down Expand Up @@ -53,14 +53,14 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.19.5 // indirect
Expand All @@ -71,7 +71,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
Expand Down Expand Up @@ -123,14 +123,14 @@ require (
github.com/planetscale/pargzip v0.0.0-20201116224723-90c7fc03ea8a // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.43.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.5.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
Expand All @@ -139,13 +139,13 @@ require (
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/z-division/go-zookeeper v1.0.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.8 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.8 // indirect
go.etcd.io/etcd/client/v3 v3.5.8 // indirect
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/v3 v3.5.9 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
go.uber.org/zap v1.25.0 // indirect
go4.org/intern v0.0.0-20230205224052-192e9f60865c // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230426161633-7e06285ff160 // indirect
golang.org/x/crypto v0.17.0 // indirect
Expand All @@ -160,7 +160,7 @@ require (
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.128.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
Expand All @@ -173,12 +173,12 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
inet.af/netaddr v0.0.0-20220811202034-502d2d690317 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/apiextensions-apiserver v0.28.5 // indirect
k8s.io/apiserver v0.28.5 // indirect
k8s.io/component-base v0.28.5 // indirect
k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect
k8s.io/klog/v2 v2.90.0 // indirect
k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand All @@ -189,32 +189,33 @@ replace github.com/skeema/tengo => github.com/planetscale/tengo v0.10.1-ps.v4 //
// NOTE: Make sure controller-runtime's k8s minor version matches below
// Pinned to kubernetes-1.26.1
replace (
k8s.io/api => k8s.io/api v0.26.1
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.1
k8s.io/apimachinery => k8s.io/apimachinery v0.26.1
k8s.io/apiserver => k8s.io/apiserver v0.26.1
k8s.io/cli-runtime => k8s.io/cli-runtime v0.26.1
k8s.io/client-go => k8s.io/client-go v0.26.1
k8s.io/cloud-provider => k8s.io/cloud-provider v0.26.1
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.26.1
k8s.io/code-generator => k8s.io/code-generator v0.26.1
k8s.io/component-base => k8s.io/component-base v0.26.1
k8s.io/component-helpers => k8s.io/component-helpers v0.26.1
k8s.io/controller-manager => k8s.io/controller-manager v0.26.1
k8s.io/cri-api => k8s.io/cri-api v0.26.1
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.26.1
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.26.1
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.26.1
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.26.1
k8s.io/kube-proxy => k8s.io/kube-proxy v0.26.1
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.26.1
k8s.io/kubectl => k8s.io/kubectl v0.26.1
k8s.io/kubelet => k8s.io/kubelet v0.26.1
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.26.1
k8s.io/metrics => k8s.io/metrics v0.26.1
k8s.io/mount-utils => k8s.io/mount-utils v0.26.1
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.26.1
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.26.1
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.26.1
k8s.io/sample-controller => k8s.io/sample-controller v0.26.1
k8s.io/api => k8s.io/api v0.28.5
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.28.5
k8s.io/apimachinery => k8s.io/apimachinery v0.28.5
k8s.io/apiserver => k8s.io/apiserver v0.28.5
k8s.io/cli-runtime => k8s.io/cli-runtime v0.28.5
k8s.io/client-go => k8s.io/client-go v0.28.5
k8s.io/cloud-provider => k8s.io/cloud-provider v0.28.5
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.28.5
k8s.io/code-generator => k8s.io/code-generator v0.28.5
k8s.io/component-base => k8s.io/component-base v0.28.5
k8s.io/component-helpers => k8s.io/component-helpers v0.28.5
k8s.io/controller-manager => k8s.io/controller-manager v0.28.5
k8s.io/cri-api => k8s.io/cri-api v0.28.5
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.28.5
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.5
k8s.io/endpointslice => k8s.io/endpointslice v0.28.5
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.28.5
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.28.5
k8s.io/kube-proxy => k8s.io/kube-proxy v0.28.5
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.5
k8s.io/kubectl => k8s.io/kubectl v0.28.5
k8s.io/kubelet => k8s.io/kubelet v0.28.5
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.5
k8s.io/metrics => k8s.io/metrics v0.28.5
k8s.io/mount-utils => k8s.io/mount-utils v0.28.5
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.28.5
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.28.5
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.28.5
k8s.io/sample-controller => k8s.io/sample-controller v0.28.5
)
Loading
Loading