Skip to content

Commit

Permalink
feat: support in-place update for pod (#7000)
Browse files Browse the repository at this point in the history
  • Loading branch information
free6om authored Apr 10, 2024
1 parent f96f464 commit 0ba22d5
Show file tree
Hide file tree
Showing 24 changed files with 951 additions and 405 deletions.
1 change: 1 addition & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func init() {
viper.SetDefault(rsm.FeatureGateRSMCompatibilityMode, true)
viper.SetDefault(rsm2.FeatureGateRSMReplicaProvider, string(rsm2.PodProvider))
viper.SetDefault(rsm2.MaxPlainRevisionCount, 1024)
viper.SetDefault(rsm2.FeatureGateIgnorePodVerticalScaling, false)
viper.SetDefault(constant.FeatureGateEnableRuntimeMetrics, false)
viper.SetDefault(constant.CfgKBReconcileWorkers, 8)
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/apps/systemaccount_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func getCreationStmtForAccount(key componentUniqueKey, passConfig appsv1alpha1.P
if strategy == inPlaceUpdate && len(statements.UpdateStatement) == 0 {
// if update statement is empty, use reCreate strategy, which will drop and create the account.
strategy = reCreate
klog.Warningf("account %s in cluster %s exists, but its update statement is not set, will use %s strategy to update account.", userName, key.clusterName, strategy)
klog.Warningf("account %s in cluster %s exists, but its update statement is not set, will use %d strategy to update account.", userName, key.clusterName, strategy)
}

if strategy == inPlaceUpdate {
Expand Down
89 changes: 58 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/docker/docker v24.0.9+incompatible
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/fasthttp/router v1.4.20
github.com/fsnotify/fsnotify v1.6.0
github.com/fsnotify/fsnotify v1.7.0
github.com/go-logr/logr v1.3.0
github.com/go-logr/zapr v1.2.4
github.com/go-sql-driver/mysql v1.7.1
Expand All @@ -33,7 +33,7 @@ require (
github.com/magiconair/properties v1.8.7
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.27.10
github.com/onsi/gomega v1.29.0
github.com/opencontainers/image-spec v1.1.0
github.com/pashagolub/pgxmock/v2 v2.11.0
github.com/pkg/errors v0.9.1
Expand All @@ -54,8 +54,8 @@ require (
github.com/sykesm/zap-logfmt v0.0.4
github.com/valyala/fasthttp v1.50.0
github.com/vmware-tanzu/velero v1.10.1
go.etcd.io/etcd/client/v3 v3.5.9
go.etcd.io/etcd/server/v3 v3.5.9
go.etcd.io/etcd/client/v3 v3.5.10
go.etcd.io/etcd/server/v3 v3.5.10
go.mongodb.org/mongo-driver v1.11.6
go.uber.org/automaxprocs v1.5.2
go.uber.org/zap v1.26.0
Expand All @@ -64,25 +64,27 @@ require (
golang.org/x/net v0.22.0
golang.org/x/text v0.14.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.33.0
gopkg.in/inf.v0 v0.9.1
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.12.3
k8s.io/api v0.28.3
k8s.io/api v0.28.8
k8s.io/apiextensions-apiserver v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/cli-runtime v0.28.2
k8s.io/client-go v0.28.3
k8s.io/apimachinery v0.28.8
k8s.io/apiserver v0.28.3
k8s.io/cli-runtime v0.28.3
k8s.io/client-go v0.28.8
k8s.io/code-generator v0.28.3
k8s.io/component-helpers v0.28.2
k8s.io/cri-api v0.27.1
k8s.io/component-helpers v0.28.3
k8s.io/cri-api v0.28.3
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.100.1
k8s.io/kube-openapi v0.0.0-20230918164632-68afd615200d
k8s.io/klog/v2 v2.110.1
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
k8s.io/kubectl v0.28.2
k8s.io/kubelet v0.26.1
k8s.io/kubernetes v1.28.3
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.16.5
sigs.k8s.io/yaml v1.3.0
Expand All @@ -92,16 +94,11 @@ require (
cloud.google.com/go/storage v1.29.0 // indirect
cuelabs.dev/go/oci/ociregistry v0.0.0-20240314152124-224736b49f2e // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.21 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
Expand Down Expand Up @@ -157,14 +154,13 @@ require (
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/cel-go v0.16.1 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect
Expand Down Expand Up @@ -203,7 +199,6 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
github.com/karrick/godirwalk v1.17.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kopia/kopia v0.10.7 // indirect
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 // indirect
Expand Down Expand Up @@ -272,12 +267,12 @@ require (
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940 // indirect
github.com/yvasiyarov/gorelic v0.0.7 // indirect
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20160601141957-9c099fbc30e9 // indirect
go.etcd.io/bbolt v1.3.7 // 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/v2 v2.305.9 // indirect
go.etcd.io/etcd/pkg/v3 v3.5.9 // indirect
go.etcd.io/etcd/raft/v3 v3.5.9 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/v2 v2.305.10 // indirect
go.etcd.io/etcd/pkg/v3 v3.5.10 // indirect
go.etcd.io/etcd/raft/v3 v3.5.10 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.20.0 // indirect
Expand Down Expand Up @@ -305,11 +300,43 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.0 // indirect
k8s.io/apiserver v0.28.3 // indirect
k8s.io/component-base v0.28.3 // indirect
k8s.io/component-base v0.28.8 // indirect
oras.land/oras-go v1.2.4 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

replace (
k8s.io/api => k8s.io/api v0.28.3
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.28.3
k8s.io/apimachinery => k8s.io/apimachinery v0.28.3
k8s.io/apiserver => k8s.io/apiserver v0.28.3
k8s.io/cli-runtime => k8s.io/cli-runtime v0.28.3
k8s.io/client-go => k8s.io/client-go v0.28.3
k8s.io/cloud-provider => k8s.io/cloud-provider v0.28.3
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.28.3
k8s.io/code-generator => k8s.io/code-generator v0.28.3
k8s.io/component-base => k8s.io/component-base v0.28.3
k8s.io/component-helpers => k8s.io/component-helpers v0.28.3
k8s.io/controller-manager => k8s.io/controller-manager v0.28.3
k8s.io/cri-api => k8s.io/cri-api v0.28.3
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.28.3
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.3
k8s.io/endpointslice => k8s.io/endpointslice v0.28.3
k8s.io/kms => k8s.io/kms v0.28.3
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.28.3
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.28.3
k8s.io/kube-proxy => k8s.io/kube-proxy v0.28.3
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.3
k8s.io/kubectl => k8s.io/kubectl v0.28.3
k8s.io/kubelet => k8s.io/kubelet v0.28.3
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.3
k8s.io/metrics => k8s.io/metrics v0.28.3
k8s.io/mount-utils => k8s.io/mount-utils v0.28.3
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.28.3
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.28.3
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.28.3
k8s.io/sample-controller => k8s.io/sample-controller v0.28.3
)
Loading

0 comments on commit 0ba22d5

Please sign in to comment.