From 9a5a57cbcda429aca33d9591cf8ad3e0a8310a32 Mon Sep 17 00:00:00 2001 From: MegaByte875 Date: Mon, 11 Mar 2024 15:53:16 +0800 Subject: [PATCH] update controller-manager flags (#472) --- apis/go.mod | 8 +++---- apis/go.sum | 22 +++++++++---------- .../controller-manager-deployment.yaml | 2 ++ charts/nebula-operator/values.yaml | 6 +++++ pkg/kube/deployment.go | 1 - pkg/kube/pv.go | 5 ----- pkg/kube/pvc.go | 5 ----- pkg/kube/service.go | 1 - pkg/kube/workload.go | 1 - pkg/remote/remote.go | 2 +- 10 files changed, 24 insertions(+), 29 deletions(-) diff --git a/apis/go.mod b/apis/go.mod index 69eb163e..6607456f 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -5,8 +5,8 @@ go 1.20 require ( github.com/openkruise/kruise-api v1.3.0 github.com/vesoft-inc/nebula-go/v3 v3.6.0 - k8s.io/api v0.27.4 - k8s.io/apimachinery v0.27.4 + k8s.io/api v0.27.10 + k8s.io/apimachinery v0.27.10 k8s.io/utils v0.0.0-20230209194617-a36077c30491 sigs.k8s.io/controller-runtime v0.15.2 ) @@ -19,8 +19,8 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/vesoft-inc/fbthrift v0.0.0-20230214024353-fa2f34755b28 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.90.1 // indirect diff --git a/apis/go.sum b/apis/go.sum index 6a708f4e..06030139 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -29,7 +29,7 @@ github.com/openkruise/kruise-api v1.3.0 h1:yfEy64uXgSuX/5RwePLbwUK/uX8RRM8fHJkcc github.com/openkruise/kruise-api v1.3.0/go.mod h1:9ZX+ycdHKNzcA5ezAf35xOa2Mwfa2BYagWr0lKgi5dU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -56,8 +56,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -70,7 +70,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= @@ -78,14 +78,14 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -99,10 +99,10 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -k8s.io/api v0.27.4 h1:0pCo/AN9hONazBKlNUdhQymmnfLRbSZjd5H5H3f0bSs= -k8s.io/api v0.27.4/go.mod h1:O3smaaX15NfxjzILfiln1D8Z3+gEYpjEpiNA/1EVK1Y= -k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= -k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/api v0.27.10 h1:VFvsFZxiG3qeKyMvSOlO6hzrB7CGk6CC0XI1hniBI28= +k8s.io/api v0.27.10/go.mod h1:cDmAF4GtSVRO0+5hOY/Vo3lLCQMOp6FfrXZ94/gQwC0= +k8s.io/apimachinery v0.27.10 h1:AlOhsgdtNPMYDMJyUDsj2HZDLKOf1qPfvbbo5O9m4jg= +k8s.io/apimachinery v0.27.10/go.mod h1:IHu2ovJ60RqxyPSLmTel7KDLdOCRbpOxwtUBmwBnT/E= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= diff --git a/charts/nebula-operator/templates/controller-manager-deployment.yaml b/charts/nebula-operator/templates/controller-manager-deployment.yaml index 66540e95..7a9932b7 100644 --- a/charts/nebula-operator/templates/controller-manager-deployment.yaml +++ b/charts/nebula-operator/templates/controller-manager-deployment.yaml @@ -39,6 +39,8 @@ spec: - --sync-period={{ .Values.syncPeriod }} - --concurrent-nebulacluster-syncs={{ .Values.concurrentNebulaClusterSyncs }} - --concurrent-nebularestore-syncs={{ .Values.concurrentNebulaRestoreSyncs }} + - --concurrent-nebulacronbackup-syncs={{ .Values.concurrentNebulaCronBackupSyncs }} + - --concurrent-nebulabackup-sync={{ .Values.concurrentNebulaBackupSyncs }} - --leader-elect - --leader-elect-resource-namespace={{ template "nebula-operator.namespace" . }} - --enable-admission-webhook={{ .Values.admissionWebhook.create }} diff --git a/charts/nebula-operator/values.yaml b/charts/nebula-operator/values.yaml index c34fdefa..87f2a073 100644 --- a/charts/nebula-operator/values.yaml +++ b/charts/nebula-operator/values.yaml @@ -108,6 +108,12 @@ concurrentNebulaClusterSyncs: 5 # The number of NebulaRestore objects that are allowed to sync concurrently. (default 5) concurrentNebulaRestoreSyncs: 5 +# The number of NebulaBackup objects that are allowed to sync concurrently. (default 5) +concurrentNebulaBackupSyncs: 5 + +# The number of NebulaCronBackup objects that are allowed to sync concurrently. (default 5) +concurrentNebulaCronBackupSyncs: 5 + # The number of nebula autoscaler objects that are allowed to sync concurrently. (default 5) concurrentAutoscalerSyncs: 5 diff --git a/pkg/kube/deployment.go b/pkg/kube/deployment.go index 4fe01d01..10b3ed27 100644 --- a/pkg/kube/deployment.go +++ b/pkg/kube/deployment.go @@ -32,7 +32,6 @@ func NewDeployment(kubecli client.Client) Deployment { func (d *deployClient) CreateDeployment(deploy *appsv1.Deployment) error { if err := d.kubecli.Create(context.TODO(), deploy); err != nil { if apierrors.IsAlreadyExists(err) { - klog.Infof("deployment [%s/%s] already exists", deploy.Namespace, deploy.Name) return nil } return err diff --git a/pkg/kube/pv.go b/pkg/kube/pv.go index 54c528ce..ddffae5d 100644 --- a/pkg/kube/pv.go +++ b/pkg/kube/pv.go @@ -36,7 +36,6 @@ import ( ) type PersistentVolume interface { - CreatePersistentVolume(pv *corev1.PersistentVolume) error GetPersistentVolume(name string) (*corev1.PersistentVolume, error) PatchPVReclaimPolicy(pv *corev1.PersistentVolume, policy corev1.PersistentVolumeReclaimPolicy) error UpdateMetaInfo(obj runtime.Object, pv *corev1.PersistentVolume) error @@ -51,10 +50,6 @@ func NewPV(kubecli client.Client) PersistentVolume { return &pvClient{kubecli: kubecli} } -func (p *pvClient) CreatePersistentVolume(pv *corev1.PersistentVolume) error { - return p.kubecli.Create(context.TODO(), pv) -} - func (p *pvClient) GetPersistentVolume(name string) (*corev1.PersistentVolume, error) { pv := &corev1.PersistentVolume{} err := p.kubecli.Get(context.TODO(), types.NamespacedName{ diff --git a/pkg/kube/pvc.go b/pkg/kube/pvc.go index af7c52e7..696f6a55 100644 --- a/pkg/kube/pvc.go +++ b/pkg/kube/pvc.go @@ -35,7 +35,6 @@ import ( ) type PersistentVolumeClaim interface { - CreatePVC(pvc *corev1.PersistentVolumeClaim) error GetPVC(namespace, name string) (*corev1.PersistentVolumeClaim, error) UpdateMetaInfo(pvc *corev1.PersistentVolumeClaim, pod *corev1.Pod, isReclaimEnabled bool) error UpdatePVC(pvc *corev1.PersistentVolumeClaim) error @@ -51,10 +50,6 @@ func NewPVC(kubecli client.Client) PersistentVolumeClaim { return &pvcClient{kubecli: kubecli} } -func (p *pvcClient) CreatePVC(pvc *corev1.PersistentVolumeClaim) error { - return p.kubecli.Create(context.TODO(), pvc) -} - func (p *pvcClient) GetPVC(namespace, name string) (*corev1.PersistentVolumeClaim, error) { pvc := &corev1.PersistentVolumeClaim{} err := p.kubecli.Get(context.TODO(), types.NamespacedName{ diff --git a/pkg/kube/service.go b/pkg/kube/service.go index c5341667..4d965fab 100644 --- a/pkg/kube/service.go +++ b/pkg/kube/service.go @@ -47,7 +47,6 @@ func NewService(kubecli client.Client) Service { func (s *serviceClient) CreateService(service *corev1.Service) error { if err := s.kubecli.Create(context.TODO(), service); err != nil { if apierrors.IsAlreadyExists(err) { - klog.Infof("service [%s/%s] already exists", service.Namespace, service.Name) return nil } return err diff --git a/pkg/kube/workload.go b/pkg/kube/workload.go index e85f9d82..a22231f2 100644 --- a/pkg/kube/workload.go +++ b/pkg/kube/workload.go @@ -66,7 +66,6 @@ func (w *workloadClient) GetWorkload(namespace, name string, gvk schema.GroupVer func (w *workloadClient) CreateWorkload(obj *unstructured.Unstructured) error { if err := w.kubecli.Create(context.TODO(), obj); err != nil { if apierrors.IsAlreadyExists(err) { - klog.Error(err, "workload already exists") return nil } return err diff --git a/pkg/remote/remote.go b/pkg/remote/remote.go index 020239d0..9bc1b4b3 100644 --- a/pkg/remote/remote.go +++ b/pkg/remote/remote.go @@ -32,7 +32,7 @@ const ( AWSSecretKeyEnv = "AWS_SECRET_ACCESS_KEY" GSCredentialsKey = "credentials" - GSCredentialsEnv = "GS_CREDENTIALS" + GSCredentialsEnv = "GOOGLE_APPLICATION_CREDENTIALS_JSON" ) func GetStorageType(provider v1alpha1.StorageProvider) v1alpha1.ObjectStorageType {