diff --git a/docs/api-references/docs.html b/docs/api-references/docs.html index fba2417167..ada50d8c62 100644 --- a/docs/api-references/docs.html +++ b/docs/api-references/docs.html @@ -201,6 +201,28 @@

Backup

Affinity of backup Pods

+ + +useKMS
+ +bool + + + +

Use KMS to decrypt the secrets

+ + + + +serviceAccount
+ +string + + + +

Specify service account of backup

+ + @@ -551,6 +573,28 @@

Restore

Affinity of restore Pods

+ + +useKMS
+ +bool + + + +

Use KMS to decrypt the secrets

+ + + + +serviceAccount
+ +string + + + +

Specify service account of restore

+ + @@ -2024,6 +2068,28 @@

BackupSpec

Affinity of backup Pods

+ + +useKMS
+ +bool + + + +

Use KMS to decrypt the secrets

+ + + + +serviceAccount
+ +string + + + +

Specify service account of backup

+ +

BackupStatus @@ -5975,6 +6041,28 @@

RestoreSpec

Affinity of restore Pods

+ + +useKMS
+ +bool + + + +

Use KMS to decrypt the secrets

+ + + + +serviceAccount
+ +string + + + +

Specify service account of restore

+ +

RestoreStatus @@ -8492,8 +8580,8 @@

TiKVCoprocessorConfig -

When Region [a,e) size exceeds region_max_size, it will be split into several Regions [a,b), -[b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be region_split_size (or a +

When Region [a,e) size exceeds region-max-size, it will be split into several Regions [a,b), +[b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be region-split-size (or a little larger). See also: region-split-size Optional: Defaults to 144MB optional

@@ -8507,8 +8595,8 @@

TiKVCoprocessorConfig -

When Region [a,e) size exceeds region_max_size, it will be split into several Regions [a,b), -[b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be region_split_size (or a +

When Region [a,e) size exceeds region-max-size, it will be split into several Regions [a,b), +[b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be region-split-size (or a little larger). See also: region-max-size Optional: Defaults to 96MB optional

@@ -8522,9 +8610,9 @@

TiKVCoprocessorConfig -

When the number of keys in Region [a,e) exceeds the region_max_keys, it will be split into +

When the number of keys in Region [a,e) exceeds the region-max-keys, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be -region_split_keys. See also: region-split-keys +region-split-keys. See also: region-split-keys Optional: Defaults to 1440000 optional

@@ -8537,9 +8625,9 @@

TiKVCoprocessorConfig -

When the number of keys in Region [a,e) exceeds the region_max_keys, it will be split into +

When the number of keys in Region [a,e) exceeds the region-max-keys, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be -region_split_keys. See also: region-max-keys +region-split-keys. See also: region-max-keys Optional: Defaults to 960000 optional

@@ -8564,7 +8652,7 @@

TiKVCoprocessorReadP -high_concurrency
+high-concurrency
int64 @@ -8576,7 +8664,7 @@

TiKVCoprocessorReadP -normal_concurrency
+normal-concurrency
int64 @@ -8588,7 +8676,7 @@

TiKVCoprocessorReadP -low_concurrency
+low-concurrency
int64 @@ -8600,7 +8688,7 @@

TiKVCoprocessorReadP -max_tasks_per_worker_high
+max-tasks-per-worker-high
int64 @@ -8612,7 +8700,7 @@

TiKVCoprocessorReadP -max_tasks_per_worker_normal
+max-tasks-per-worker-normal
int64 @@ -8624,7 +8712,7 @@

TiKVCoprocessorReadP -max_tasks_per_worker_low
+max-tasks-per-worker-low
int64 @@ -8636,7 +8724,7 @@

TiKVCoprocessorReadP -stack_size
+stack-size
string @@ -9075,7 +9163,7 @@

TiKVGCConfig - batch_keys
+ batch-keys
int64 @@ -9087,7 +9175,7 @@

TiKVGCConfig - max_write_bytes_per_sec
+ max-write-bytes-per-sec
string @@ -9116,7 +9204,7 @@

TiKVImportConfig -import_dir
+import-dir
string @@ -9127,7 +9215,7 @@

TiKVImportConfig -num_threads
+num-threads
int64 @@ -9138,7 +9226,7 @@

TiKVImportConfig -num_import_jobs
+num-import-jobs
int64 @@ -9149,7 +9237,7 @@

TiKVImportConfig -num_import_sst_jobs
+num-import-sst-jobs
int64 @@ -9160,7 +9248,7 @@

TiKVImportConfig -max_prepare_duration
+max-prepare-duration
string @@ -9171,7 +9259,7 @@

TiKVImportConfig -region_split_size
+region-split-size
string @@ -9182,7 +9270,7 @@

TiKVImportConfig -stream_channel_window
+stream-channel-window
int64 @@ -9193,7 +9281,7 @@

TiKVImportConfig -max_open_engines
+max-open-engines
int64 @@ -9204,7 +9292,7 @@

TiKVImportConfig -upload_speed_limit
+upload-speed-limit
string @@ -9246,7 +9334,7 @@

TiKVPDConfig -retry_interval
+retry-interval
string @@ -9260,7 +9348,7 @@

TiKVPDConfig -retry_max_count
+retry-max-count
int64 @@ -9274,7 +9362,7 @@

TiKVPDConfig -retry_log_every
+retry-log-every
int64 @@ -9307,7 +9395,7 @@

TiKVRaftDBConfig -wal_recovery_mode
+wal-recovery-mode
string @@ -9318,7 +9406,7 @@

TiKVRaftDBConfig -wal_dir
+wal-dir
string @@ -9329,7 +9417,7 @@

TiKVRaftDBConfig -wal_ttl_seconds
+wal-ttl-seconds
int64 @@ -9340,7 +9428,7 @@

TiKVRaftDBConfig -wal_size_limit
+wal-size-limit
string @@ -9351,7 +9439,7 @@

TiKVRaftDBConfig -max_total_wal_size
+max-total-wal-size
string @@ -9362,7 +9450,7 @@

TiKVRaftDBConfig -max_background_jobs
+max-background-jobs
int64 @@ -9373,7 +9461,7 @@

TiKVRaftDBConfig -max_manifest_file_size
+max-manifest-file-size
string @@ -9384,7 +9472,7 @@

TiKVRaftDBConfig -create_if_missing
+create-if-missing
bool @@ -9395,7 +9483,7 @@

TiKVRaftDBConfig -max_open_files
+max-open-files
int64 @@ -9406,7 +9494,7 @@

TiKVRaftDBConfig -enable_statistics
+enable-statistics
bool @@ -9417,7 +9505,7 @@

TiKVRaftDBConfig -stats_dump_period
+stats-dump-period
string @@ -9428,7 +9516,7 @@

TiKVRaftDBConfig -compaction_readahead_size
+compaction-readahead-size
string @@ -9439,7 +9527,7 @@

TiKVRaftDBConfig -info_log_max_size
+info-log-max-size
string @@ -9450,7 +9538,7 @@

TiKVRaftDBConfig -info_log_roll_time
+info-log-roll-time
string @@ -9461,7 +9549,7 @@

TiKVRaftDBConfig -info_log_keep_log_file_num
+info-log-keep-log-file-num
int64 @@ -9472,7 +9560,7 @@

TiKVRaftDBConfig -info_log_dir
+info-log-dir
string @@ -9483,7 +9571,7 @@

TiKVRaftDBConfig -max_sub_compactions
+max-sub-compactions
int64 @@ -9494,7 +9582,7 @@

TiKVRaftDBConfig -writable_file_max_buffer_size
+writable-file-max-buffer-size
string @@ -9505,7 +9593,7 @@

TiKVRaftDBConfig -use_direct_io_for_flush_and_compaction
+use-direct-io-for-flush-and-compaction
bool @@ -9516,7 +9604,7 @@

TiKVRaftDBConfig -enable_pipelined_write
+enable-pipelined-write
bool @@ -9527,7 +9615,7 @@

TiKVRaftDBConfig -allow_concurrent_memtable_write
+allow-concurrent-memtable-write
bool @@ -9538,7 +9626,7 @@

TiKVRaftDBConfig -bytes_per_sync
+bytes-per-sync
string @@ -9549,7 +9637,7 @@

TiKVRaftDBConfig -wal_bytes_per_sync
+wal-bytes-per-sync
string @@ -10258,7 +10346,7 @@

TiKVSecurityConfig -override_ssl_target
+override-ssl-target
string @@ -10269,7 +10357,7 @@

TiKVSecurityConfig -cipher_file
+cipher-file
string @@ -10347,7 +10435,7 @@

TiKVServerConfig -grpc_memory_pool_quota
+grpc-memory-pool-quota
string @@ -10615,6 +10703,17 @@

TiKVSpec +serviceAccount
+ +string + + + +

Specify a Service Account for tikv

+ + + + replicas
int32 @@ -10890,7 +10989,7 @@

TiKVStorageReadPoolConfi -high_concurrency
+high-concurrency
int64 @@ -10902,7 +11001,7 @@

TiKVStorageReadPoolConfi -normal_concurrency
+normal-concurrency
int64 @@ -10914,7 +11013,7 @@

TiKVStorageReadPoolConfi -low_concurrency
+low-concurrency
int64 @@ -10926,7 +11025,7 @@

TiKVStorageReadPoolConfi -max_tasks_per_worker_high
+max-tasks-per-worker-high
int64 @@ -10938,7 +11037,7 @@

TiKVStorageReadPoolConfi -max_tasks_per_worker_normal
+max-tasks-per-worker-normal
int64 @@ -10950,7 +11049,7 @@

TiKVStorageReadPoolConfi -max_tasks_per_worker_low
+max-tasks-per-worker-low
int64 @@ -10962,7 +11061,7 @@

TiKVStorageReadPoolConfi -stack_size
+stack-size
string diff --git a/hack/e2e.sh b/hack/e2e.sh index 881102dac8..478974c09f 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -53,6 +53,7 @@ Environments: KUBECONFIG path to the kubeconfig file, defaults: ~/.kube/config SKIP_BUILD skip building binaries SKIP_IMAGE_BUILD skip build and push images + SKIP_IMAGE_LOAD skip load images SKIP_UP skip starting the cluster SKIP_DOWN skip shutting down the cluster SKIP_TEST skip running the test @@ -76,6 +77,7 @@ Environments: GINKGO_PARALLEL if set to `y`, will run specs in parallel, the number of nodes will be the number of cpus GINKGO_NO_COLOR if set to `y`, suppress color output in default reporter RUNNER_SUITE_NAME the suite name of runner + SKIP_GINKGO if set to `y`, skip ginkgo Examples: @@ -179,6 +181,7 @@ CLUSTER=${CLUSTER:-tidb-operator} KUBECONFIG=${KUBECONFIG:-~/.kube/config} SKIP_BUILD=${SKIP_BUILD:-} SKIP_IMAGE_BUILD=${SKIP_IMAGE_BUILD:-} +SKIP_IMAGE_LOAD=${SKIP_IMAGE_LOAD:-} SKIP_UP=${SKIP_UP:-} SKIP_DOWN=${SKIP_DOWN:-} SKIP_TEST=${SKIP_TEST:-} @@ -199,6 +202,7 @@ KUBE_WORKERS=${KUBE_WORKERS:-3} DOCKER_IO_MIRROR=${DOCKER_IO_MIRROR:-} GCR_IO_MIRROR=${GCR_IO_MIRROR:-} QUAY_IO_MIRROR=${QUAY_IO_MIRROR:-} +SKIP_GINKGO=${SKIP_GINKGO:-} RUNNER_SUITE_NAME=${RUNNER_SUITE_NAME:-} echo "PROVIDER: $PROVIDER" @@ -485,6 +489,14 @@ else exit 1 fi +if [ "${HOSTNAME:-}" == "tidb-operator-dev" -a ! -f /usr/local/bin/helm ]; then + ln -s $OUTPUT_BIN/helm /usr/local/bin/helm +fi + +if [ "${HOSTNAME:-}" == "tidb-operator-dev" -a ! -f /usr/local/bin/kind ]; then + ln -s $KIND_BIN /usr/local/bin/kind +fi + # Environments for hack/run-e2e.sh export PROVIDER export CLUSTER @@ -494,6 +506,8 @@ export GCP_REGION export GCP_ZONE export GCP_CREDENTIALS export IMAGE_TAG +export SKIP_GINKGO +export SKIP_IMAGE_LOAD export TIDB_OPERATOR_IMAGE=$DOCKER_REGISTRY/pingcap/tidb-operator:${IMAGE_TAG} export E2E_IMAGE=$DOCKER_REGISTRY/pingcap/tidb-operator-e2e:${IMAGE_TAG} export PATH=$OUTPUT_BIN:$PATH diff --git a/hack/run-e2e.sh b/hack/run-e2e.sh index bc78ccf3ad..3f207093e0 100755 --- a/hack/run-e2e.sh +++ b/hack/run-e2e.sh @@ -29,6 +29,7 @@ GCP_REGION=${GCP_REGION:-} GCP_ZONE=${GCP_ZONE:-} GCP_CREDENTIALS=${GCP_CREDENTIALS:-} IMAGE_TAG=${IMAGE_TAG:-} +SKIP_IMAGE_LOAD=${SKIP_IMAGE_LOAD:-} TIDB_OPERATOR_IMAGE=${TIDB_OPERATOR_IMAGE:-localhost:5000/pingcap/tidb-operator:latest} E2E_IMAGE=${E2E_IMAGE:-localhost:5000/pingcap/tidb-operator-e2e:latest} KUBECONFIG=${KUBECONFIG:-$HOME/.kube/config} @@ -41,6 +42,7 @@ GINKGO_PARALLEL=${GINKGO_PARALLEL:-n} # set to 'y' to run tests in parallel # in parallel GINKGO_NO_COLOR=${GINKGO_NO_COLOR:-n} GINKGO_STREAM=${GINKGO_STREAM:-y} +SKIP_GINKGO=${SKIP_GINKGO:-} if [ -z "$KUBECONFIG" ]; then echo "error: KUBECONFIG is required" @@ -284,10 +286,18 @@ if [ -z "$KUBECONTEXT" ]; then echo "info: current kubeconfig context is '$KUBECONTEXT'" fi -e2e::image_load +if [ -z "$SKIP_IMAGE_LOAD" ]; then + e2e::image_load +fi + e2e::setup_local_pvs e2e::setup_helm_server +if [ -n "$SKIP_GINKGO" ]; then + echo "info: skipping ginkgo" + exit 0 +fi + echo "info: start to run e2e process" ginkgo_args=() diff --git a/images/tidb-backup-manager/Dockerfile b/images/tidb-backup-manager/Dockerfile index 861490bb88..17fdc3e216 100644 --- a/images/tidb-backup-manager/Dockerfile +++ b/images/tidb-backup-manager/Dockerfile @@ -1,6 +1,6 @@ FROM pingcap/tidb-enterprise-tools:latest - -ARG VERSION=v1.48.0 +ARG VERSION=v1.51.0 +ARG SHUSH_VERSION=v1.4.0 RUN apk update && apk add ca-certificates RUN wget -nv https://github.com/ncw/rclone/releases/download/${VERSION}/rclone-${VERSION}-linux-amd64.zip \ @@ -15,6 +15,10 @@ RUN wget -nv http://download.pingcap.org/br-latest-linux-amd64.tar.gz \ && chmod 755 /usr/local/bin/br \ && rm -rf br-latest-linux-amd64.tar.gz +RUN wget -nv https://github.com/realestate-com-au/shush/releases/download/${SHUSH_VERSION}/shush_linux_amd64 \ + && mv shush_linux_amd64 /usr/local/bin/shush \ + && chmod 755 /usr/local/bin/shush + COPY bin/tidb-backup-manager /tidb-backup-manager COPY entrypoint.sh /entrypoint.sh diff --git a/images/tidb-backup-manager/entrypoint.sh b/images/tidb-backup-manager/entrypoint.sh index 85c889147d..fc11dc02f2 100755 --- a/images/tidb-backup-manager/entrypoint.sh +++ b/images/tidb-backup-manager/entrypoint.sh @@ -19,7 +19,7 @@ echo "Create rclone.conf file." cat < /tmp/rclone.conf [s3] type = s3 -env_auth = false +env_auth = true provider = ${S3_PROVIDER} access_key_id = ${AWS_ACCESS_KEY_ID} secret_access_key = ${AWS_SECRET_ACCESS_KEY:-$AWS_SECRET_KEY} @@ -51,33 +51,40 @@ else fi BACKUP_BIN=/tidb-backup-manager +if [[ -n "${AWS_DEFAULT_REGION}"]]; then + EXEC_COMMAND="exec" +else + EXEC_COMMAND="/usr/local/bin/shush exec --" +fi + +cat /tmp/rclone.conf # exec command case "$1" in backup) shift 1 echo "$BACKUP_BIN backup $@" - exec $BACKUP_BIN backup "$@" + $EXEC_COMMAND $BACKUP_BIN backup "$@" ;; export) shift 1 echo "$BACKUP_BIN export $@" - exec $BACKUP_BIN export "$@" + $EXEC_COMMAND $BACKUP_BIN export "$@" ;; restore) shift 1 echo "$BACKUP_BIN restore $@" - exec $BACKUP_BIN restore "$@" + $EXEC_COMMAND $BACKUP_BIN restore "$@" ;; import) shift 1 echo "$BACKUP_BIN import $@" - exec $BACKUP_BIN import "$@" + $EXEC_COMMAND $BACKUP_BIN import "$@" ;; clean) shift 1 echo "$BACKUP_BIN clean $@" - exec $BACKUP_BIN clean "$@" + $EXEC_COMMAND $BACKUP_BIN clean "$@" ;; *) echo "Usage: $0 {backup|restore|clean}" diff --git a/manifests/backup/backup-aws-s3-br.yaml b/manifests/backup/backup-aws-s3-br.yaml new file mode 100644 index 0000000000..1efec57a76 --- /dev/null +++ b/manifests/backup/backup-aws-s3-br.yaml @@ -0,0 +1,34 @@ +--- +apiVersion: pingcap.com/v1alpha1 +kind: Backup +metadata: + name: demo1-backup-s3 + namespace: test1 + # annotations: + # iam.amazonaws.com/role: "arn:aws:iam::123456789:role" +spec: + # backupType: full + # useKMS: false + # serviceAccount: myServiceAccount + br: + cluster: myCluster + # clusterNamespce: + # enableTLSClient: true + # logLevel: info + # statusAddr: + # concurrency: 4 + # rateLimit: 0 + # timeAgo: