From b4557ff2103be47369d47d2a823839462315670a Mon Sep 17 00:00:00 2001 From: busu Date: Mon, 22 Apr 2024 17:36:34 +0800 Subject: [PATCH] Release v1.6.0 --- build/images/polardbx-clinic/diagnose.sh | 51 +++++++++---------- build/images/polardbx-clinic/install_tool.sh | 3 +- charts/polardbx-logcollector/Chart.yaml | 4 +- charts/polardbx-monitor/Chart.yaml | 4 +- charts/polardbx-operator/Chart.yaml | 4 +- charts/polardbx-operator/values.yaml | 4 +- hack/copy_image.sh | 4 +- .../controllers/xstore_backup_controller.go | 14 ++--- .../reconcilers/galaxy_backup_reconciler.go | 12 +++-- 9 files changed, 53 insertions(+), 47 deletions(-) diff --git a/build/images/polardbx-clinic/diagnose.sh b/build/images/polardbx-clinic/diagnose.sh index fa704a2..cb7e6c9 100644 --- a/build/images/polardbx-clinic/diagnose.sh +++ b/build/images/polardbx-clinic/diagnose.sh @@ -114,11 +114,10 @@ dump_obj(){ kubectl -n "$current_ns" logs "$line" "$container" --since=24h > $base_dir/"$line"_"$container".log done if [ "$log_type" == "cn" ]; then -# echo "collect /home/drds-server/logs/tddl/ logs ... for "$line kubectl -n "$current_ns" exec -it "$line" -- bash -c "cd /home/admin/drds-server/logs/tddl && tar zcvf tddllog.tar.gz *.log" kubectl -n "$current_ns" cp "$line":/home/admin/drds-server/logs/tddl/tddllog.tar.gz $base_dir/"$line"-tddlog.tar.gz kubectl -n "$current_ns" exec -it "$line" -- rm -f /home/admin/drds-server/logs/tddl/tddllog.tar.gz - if ! [ -f cn.sql ]; then + if ! [ -f diagnose_cn.sql ]; then echo " select 'select version()'; select version(); @@ -130,11 +129,11 @@ dump_obj(){ show full processlist; select 'show variables'; show variables; - " > cn.sql + " > diagnose_cn.sql fi - echo "exec cn.sql in "$line - kubectl -n "$current_ns" cp cn.sql "$line":cn.sql - kubectl -n "$current_ns" exec -it "$line" -- bash -c "myc -e 'source cn.sql'" > $base_dir/"$line"-cmdresponse.log + echo "exec diagnose_cn.sql in "$line + kubectl -n "$current_ns" cp diagnose_cn.sql "$line":diagnose_cn.sql + kubectl -n "$current_ns" exec -it "$line" -- bash -c "myc -e 'source diagnose_cn.sql'" > $base_dir/"$line"-cmdresponse.log common_dump "$current_ns" "$line" $base_dir/"$line"-cmdresponse.log fi if [ "$log_type" == "dn" ]; then @@ -145,7 +144,7 @@ dump_obj(){ echo "exec mysql -V in "$line echo "mysql -V" >> $base_dir/"$line"-cmdresponse.log kubectl -n "$current_ns" exec -it $line -- mysqld -V >> $base_dir/"$line"-cmdresponse.log - if ! [ -f dn.sql ]; then + if ! [ -f diagnose_dn.sql ]; then echo " select version(); select 'show processlist'; @@ -162,11 +161,11 @@ dump_obj(){ show consensus logs \G; select 'show slave status'; show slave status \G; - " > dn.sql + " > diagnose_dn.sql fi - echo "exec dn.sql in ""$line" - kubectl -n "$current_ns" cp dn.sql "$line":dn.sql - kubectl -n "$current_ns" exec -it "$line" -- myc -e 'source dn.sql' >> $base_dir/"$line"-cmdresponse.log + echo "exec diagnose_dn.sql in ""$line" + kubectl -n "$current_ns" cp diagnose_dn.sql "$line":diagnose_dn.sql + kubectl -n "$current_ns" exec -it "$line" -- myc -e 'source diagnose_dn.sql' >> $base_dir/"$line"-cmdresponse.log common_dump "$current_ns" "$line" $base_dir/"$line"-cmdresponse.log fi if [ "$log_type" == "cdc" ]; then @@ -191,37 +190,37 @@ dump_obj(){ desensitize(){ - sed -i -E 's/(password: ).*/\1******/' $operator_ns/configmap/*.yaml - sed -i -E 's/(minioAccessKey: ).*/\1******/' $operator_ns/configmap/*.yaml - sed -i -E 's/(minioSecretKey: ).*/\1******/' $operator_ns/configmap/*.yaml - sed -i -E 's/(accessKey: ).*/\1******/' $operator_ns/configmap/*.yaml - sed -i -E 's/(accessSecret: ).*/\1******/' $operator_ns/configmap/*.yaml - sed -i -E 's/(oss_access_key: ).*/\1******/' $operator_ns/configmap/*.yaml - sed -i -E 's/(oss_access_secret: ).*/\1******/' $operator_ns/configmap/*.yaml + sed -i -E 's/(password: ).*/\1******/' $operator_ns/ConfigMap/*.yaml + sed -i -E 's/(minioAccessKey: ).*/\1******/' $operator_ns/ConfigMap/*.yaml + sed -i -E 's/(minioSecretKey: ).*/\1******/' $operator_ns/ConfigMap/*.yaml + sed -i -E 's/(accessKey: ).*/\1******/' $operator_ns/ConfigMap/*.yaml + sed -i -E 's/(accessSecret: ).*/\1******/' $operator_ns/ConfigMap/*.yaml + sed -i -E 's/(oss_access_key: ).*/\1******/' $operator_ns/ConfigMap/*.yaml + sed -i -E 's/(oss_access_secret: ).*/\1******/' $operator_ns/ConfigMap/*.yaml } main(){ - res_types=("pxc" "xstore" "pxcblog" "pxb" "pbs" "pxcknobs" "pxlc" "pxm" "pxp" "pxpt" "st" "xsblog" "xsbackup" "xf" "deployment" "node") + res_types=("PolarDBXCluster" "XStore" "PolarDBXBackupBinlog" "PolarDBXBackup" "PolarDBXBackupSchedule" "PolarDBXLogCollector" "PolarDBXMonitor" "PolarDBXParameter" "PolarDBXParameterTemplate" "SystemTask" "XStoreBackupBinlog" "XStoreBackup" "XStoreFollower" "Deployment" "Node") for res_type in "${res_types[@]}" do dump_obj $namespace $res_type & done wait - dump_obj "$namespace" pod "polardbx/role=cn" 1 1 cn & - dump_obj "$namespace" pod "xstore/node-role" 1 1 dn & - dump_obj "$namespace" pod "polardbx/role=cdc" 1 1 cdc & - dump_obj "$namespace" configmap "polardbx/name" && dump_obj "$namespace" configmap "xstore/name" & + dump_obj "$namespace" Pod "polardbx/role=cn" 1 1 cn & + dump_obj "$namespace" Pod "xstore/node-role" 1 1 dn & + dump_obj "$namespace" Pod "polardbx/role=cdc" 1 1 cdc & + dump_obj "$namespace" ConfigMap "polardbx/name" && dump_obj "$namespace" ConfigMap "xstore/name" & wait - res_types_for_operator=("deployment" "ds") + res_types_for_operator=("Deployment" "DaemonSet") for res_type_for_operator in "${res_types_for_operator[@]}" do dump_obj $operator_ns $res_type_for_operator & done - dump_obj $operator_ns configmap "" 0 0 "" polardbx & - dump_obj $operator_ns pod "" 1 1 "" & + dump_obj $operator_ns ConfigMap "" 0 0 "" polardbx & + dump_obj $operator_ns Pod "" 1 1 "" & wait kubectl get nodes -o custom-columns=NAME:.metadata.name,CPU:.status.capacity.cpu,MEMORY:.status.capacity.memory,ALLOCATABLE_CPU:.status.allocatable.cpu,ALLOCATABLE_MEMORY:.status.allocatable.memory > noderesourcelist.txt desensitize diff --git a/build/images/polardbx-clinic/install_tool.sh b/build/images/polardbx-clinic/install_tool.sh index 43a5246..ed6dc63 100644 --- a/build/images/polardbx-clinic/install_tool.sh +++ b/build/images/polardbx-clinic/install_tool.sh @@ -24,4 +24,5 @@ gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key EOF yum install -y kubectl -yum install -y which \ No newline at end of file +yum install -y which +yum install -y tree \ No newline at end of file diff --git a/charts/polardbx-logcollector/Chart.yaml b/charts/polardbx-logcollector/Chart.yaml index a7ab412..b6c67b5 100644 --- a/charts/polardbx-logcollector/Chart.yaml +++ b/charts/polardbx-logcollector/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: polardbx-logcollector description: Helm chart of polardbx-operator logcollector plugin type: application -version: 1.6.0-beta -appVersion: v1.6.0-beta +version: 1.6.0 +appVersion: v1.6.0 keywords: - polardb-x - operator diff --git a/charts/polardbx-monitor/Chart.yaml b/charts/polardbx-monitor/Chart.yaml index 95707b3..8665455 100644 --- a/charts/polardbx-monitor/Chart.yaml +++ b/charts/polardbx-monitor/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: polardbx-monitor description: Helm chart of polardbx-operator monitor plugin type: application -version: 1.6.0-beta -appVersion: v1.6.0-beta +version: 1.6.0 +appVersion: v1.6.0 keywords: - polardb-x - operator diff --git a/charts/polardbx-operator/Chart.yaml b/charts/polardbx-operator/Chart.yaml index 662b6e8..425d5e1 100644 --- a/charts/polardbx-operator/Chart.yaml +++ b/charts/polardbx-operator/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: polardbx-operator description: Helm chart of polardbx-operator type: application -version: 1.6.0-beta -appVersion: v1.6.0-beta +version: 1.6.0 +appVersion: v1.6.0 keywords: - polardb-x - operator diff --git a/charts/polardbx-operator/values.yaml b/charts/polardbx-operator/values.yaml index d30682c..61443e4 100644 --- a/charts/polardbx-operator/values.yaml +++ b/charts/polardbx-operator/values.yaml @@ -15,10 +15,10 @@ images: polardbxClinic: polardbx-clinic # Default image tag. Use app version if not specified or 'latest' if useLatestImage is true. -imageTag: v1.6.0-beta +imageTag: v1.6.0 # version will be written to pxc and xstore annotation -version: v1.6.0-beta +version: v1.6.0 # Uses the latest images for operator components. useLatestImage: false diff --git a/hack/copy_image.sh b/hack/copy_image.sh index c014f68..f502a16 100755 --- a/hack/copy_image.sh +++ b/hack/copy_image.sh @@ -16,9 +16,9 @@ SOURCE_REPO=polarximages-registry.cn-zhangjiakou.cr.aliyuncs.com/daixingpolarximages -SOURCE_VERSION=v1.6.0-beta-2 +SOURCE_VERSION=v1.6.0 DEST_REPO=polardbx -DEST_VERSION=v1.6.0-beta +DEST_VERSION=v1.6.0 TARGETS="xstore-tools polardbx-operator probe-proxy polardbx-exporter polardbx-init polardbx-hpfs polardbx-job polardbx-clinic polardbx-logstash" #pull from source image and tag it diff --git a/pkg/operator/v1/xstore/controllers/xstore_backup_controller.go b/pkg/operator/v1/xstore/controllers/xstore_backup_controller.go index 4bd3364..e0652d0 100644 --- a/pkg/operator/v1/xstore/controllers/xstore_backup_controller.go +++ b/pkg/operator/v1/xstore/controllers/xstore_backup_controller.go @@ -70,13 +70,15 @@ func (r *XStoreBackupReconciler) Reconcile(ctx context.Context, request reconcil } // Record the context of the corresponding xstore - xstore, err := rc.GetXStore() - if err != nil { - log.Error(err, "Unable to get corresponding xstore") - return reconcile.Result{}, err - } xstoreRequest := request - xstoreRequest.Name = xstore.Name + if xstoreBackup.GetDeletionTimestamp().IsZero() { // If request to delete, no need to care about xstore + xstore, err := rc.GetXStore() + if err != nil { + log.Error(err, "Unable to get corresponding xstore") + return reconcile.Result{}, err + } + xstoreRequest.Name = xstore.Name + } xstoreRc := xstorev1reconcile.NewContext( control.NewBaseReconcileContextFrom(r.BaseRc, ctx, xstoreRequest), r.LoaderFactory(), diff --git a/pkg/operator/v1/xstore/plugin/galaxy/reconcilers/galaxy_backup_reconciler.go b/pkg/operator/v1/xstore/plugin/galaxy/reconcilers/galaxy_backup_reconciler.go index 1e4ea81..1cb92ee 100644 --- a/pkg/operator/v1/xstore/plugin/galaxy/reconcilers/galaxy_backup_reconciler.go +++ b/pkg/operator/v1/xstore/plugin/galaxy/reconcilers/galaxy_backup_reconciler.go @@ -33,10 +33,14 @@ func (r *GalaxyBackupReconciler) Reconcile(rc *xstorev1reconcile.BackupContext, backup := rc.MustGetXStoreBackup() log = log.WithValues("phase", backup.Status.Phase) - isStandard, err := rc.GetXStoreIsStandard() - if err != nil { - log.Error(err, "Unable to get corresponding xstore") - return reconcile.Result{}, err + isStandard := true + var err error + if backup.GetDeletionTimestamp().IsZero() { + isStandard, err = rc.GetXStoreIsStandard() + if err != nil { + log.Error(err, "Unable to get corresponding xstore") + return reconcile.Result{}, err + } } task, err := r.newReconcileTask(rc, backup, log, isStandard) if err != nil {