diff --git a/CHANGELOG-1.1.md b/CHANGELOG-1.1.md index 3d8258595d..5e834fc125 100644 --- a/CHANGELOG-1.1.md +++ b/CHANGELOG-1.1.md @@ -1,3 +1,48 @@ +# TiDB Operator v1.1.0 Release Notes + +This is the GA release of TiDB Operator 1.1, which focuses on the usability, extensibility and security. + +See our official [documentation site](https://pingcap.com/docs/tidb-in-kubernetes/stable/) for new features, guides, and instructions in production, etc. + +## Upgrade from v1.0.x + +For v1.0.x users, refer to [Upgrade TiDB Operator](https://pingcap.com/docs/tidb-in-kubernetes/stable/upgrade-tidb-operator/) to upgrade TiDB Operator in your cluster. Note that you should read the release notes (especially breaking changes and action required items) before the upgrade. + +## Breaking changes since v1.0.0 + +- Change TiDB pod `readiness` probe from `HTTPGet` to `TCPSocket` 4000 port. This will trigger rolling-upgrade for the `tidb-server` component. You can set `spec.paused` to `true` before upgrading tidb-operator to avoid the rolling upgrade, and set it back to `false` when you are ready to upgrade your TiDB server ([#2139](https://github.com/pingcap/tidb-operator/pull/2139), [@weekface](https://github.com/weekface)) +- `--advertise-address` is configured for `tidb-server`, which would trigger rolling-upgrade for the TiDB server. You can set `spec.paused` to `true` before upgrading TiDB Operator to avoid the rolling upgrade, and set it back to `false` when you are ready to upgrade your TiDB server ([#2076](https://github.com/pingcap/tidb-operator/pull/2076), [@cofyc](https://github.com/cofyc)) +- `--default-storage-class-name` and `--default-backup-storage-class-name` flags are abandoned, and the storage class defaults to Kubernetes default storage class right now. If you have set default storage class different than Kubernetes default storage class, set them explicitly in your TiDB cluster Helm or YAML files. ([#1581](https://github.com/pingcap/tidb-operator/pull/1581), [@cofyc](https://github.com/cofyc)) +- Add the `timezone` support for [all charts](https://github.com/pingcap/tidb-operator/tree/master/charts) ([#1122](https://github.com/pingcap/tidb-operator/pull/1122), [@weekface](https://github.com/weekface)). + + For the `tidb-cluster` chart, we already have the `timezone` option (`UTC` by default). If the user does not change it to a different value (for example, `Asia/Shanghai`), none of the Pods will be recreated. + If the user changes it to another value (for example, `Aisa/Shanghai`), all the related Pods (add a `TZ` env) will be recreated, namely rolling updated. + + The related Pods include `pump`, `drainer`, `dicovery`, `monitor`, `scheduled backup`, `tidb-initializer`, and `tikv-importer`. + + All images' time zone maintained by TiDB Operator is `UTC`. If you use your own images, you need to make sure that the time zone inside your images is `UTC`. + +## Other Notable changes + +- Fix `TidbCluster` upgrade bug when `PodWebhook` and `Advancend StatefulSet` are both enabled ([#2507](https://github.com/pingcap/tidb-operator/pull/2507), [@Yisaer](https://github.com/Yisaer)) +- Support preemption in `tidb-scheduler` ([#2510](https://github.com/pingcap/tidb-operator/pull/2510), [@cofyc](https://github.com/cofyc)) +- Update BR to v4.0.0-rc.2 to include the `auto_random` fix ([#2508](https://github.com/pingcap/tidb-operator/pull/2508), [@DanielZhangQD](https://github.com/DanielZhangQD)) +- Supports advanced statefulset for TiFlash ([#2469](https://github.com/pingcap/tidb-operator/pull/2469), [@DanielZhangQD](https://github.com/DanielZhangQD)) +- Sync Pump before TiDB ([#2515](https://github.com/pingcap/tidb-operator/pull/2515), [@DanielZhangQD](https://github.com/DanielZhangQD)) +- Improve performance by removing `TidbControl` lock ([#2489](https://github.com/pingcap/tidb-operator/pull/2489), [@weekface](https://github.com/weekface)) +- Support TiCDC in `TidbCluster` ([#2362](https://github.com/pingcap/tidb-operator/pull/2362), [@weekface](https://github.com/weekface)) +- Update TiDB/TiKV/PD configuration to 4.0.0 GA version ([#2571](https://github.com/pingcap/tidb-operator/pull/2571), [@Yisaer](https://github.com/Yisaer)) +- TiDB Operator will not do failover for PD pods which are not desired ([#2570](https://github.com/pingcap/tidb-operator/pull/2570), [@Yisaer](https://github.com/Yisaer)) + +## Previous releases + +- [v1.1.0-rc.4](#tidb-operator-v110-rc4-release-notes) +- [v1.1.0-rc.3](#tidb-operator-v110-rc3-release-notes) +- [v1.1.0-rc.2](#tidb-operator-v110-rc2-release-notes) +- [v1.1.0-rc.1](#tidb-operator-v110-rc1-release-notes) +- [v1.1.0-beta.2](#tidb-operator-v110-beta2-release-notes) +- [v1.1.0-beta.1](#tidb-operator-v110-beta1-release-notes) + # TiDB Operator v1.1.0-rc.4 Release Notes This is the fourth release candidate of `v1.1.0`, which focuses on the usability, extensibility and security of TiDB Operator. While we encourage usage in non-critical environments, it is **NOT** recommended to use this version in critical environments. @@ -180,15 +225,15 @@ This is a pre-release of `v1.1.0`, which focuses on the usability, extensibility ### Action Required - ACTION REQUIRED: Add the `timezone` support for [all charts](https://github.com/pingcap/tidb-operator/tree/master/charts) ([#1122](https://github.com/pingcap/tidb-operator/pull/1122), [@weekface](https://github.com/weekface)). - + For the `tidb-cluster` chart, we already have the `timezone` option (`UTC` by default). If the user does not change it to a different value (for example: `Aisa/Shanghai`), all Pods will not be recreated. If the user changes it to another value (for example: `Aisa/Shanghai`), all the related Pods (add a `TZ` env) will be recreated (rolling update). - + Regarding other charts, we don't have a `timezone` option in their `values.yaml`. We add the `timezone` option in this PR. No matter whether the user uses the old `values.yaml` or the new `values.yaml`, all the related Pods (add a `TZ` env) will not be recreated (rolling update). - + The related Pods include `pump`, `drainer`, `dicovery`, `monitor`, `scheduled backup`, `tidb-initializer`, and `tikv-importer`. - - All images' time zone maintained by `tidb-operator` is `UTC`. If you use your own images, you need to make sure that the time zone inside your images is `UTC`. + + All images' time zone maintained by `tidb-operator` is `UTC`. If you use your own images, you need to make sure that the time zone inside your images is `UTC`. ### Other Notable Changes diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 3c14fff314..72e3cee6eb 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -38,7 +38,7 @@ services: type: ClusterIP discovery: - image: pingcap/tidb-operator:v1.1.0-rc.3 + image: pingcap/tidb-operator:v1.1.0 imagePullPolicy: IfNotPresent resources: limits: diff --git a/charts/tidb-operator/values.yaml b/charts/tidb-operator/values.yaml index 68a976eaa5..ed4023b146 100644 --- a/charts/tidb-operator/values.yaml +++ b/charts/tidb-operator/values.yaml @@ -12,11 +12,11 @@ rbac: timezone: UTC # operatorImage is TiDB Operator image -operatorImage: pingcap/tidb-operator:v1.1.0-rc.3 +operatorImage: pingcap/tidb-operator:v1.1.0 imagePullPolicy: IfNotPresent # tidbBackupManagerImage is tidb backup manager image -tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.1.0-rc.3 +tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.1.0 # # Enable or disable tidb-operator features: diff --git a/deploy/aws/variables.tf b/deploy/aws/variables.tf index aa396143c4..e4daef1fbb 100644 --- a/deploy/aws/variables.tf +++ b/deploy/aws/variables.tf @@ -19,7 +19,7 @@ variable "eks_version" { variable "operator_version" { description = "TiDB operator version" - default = "v1.1.0-rc.3" + default = "v1.1.0" } variable "operator_values" { diff --git a/deploy/gcp/variables.tf b/deploy/gcp/variables.tf index ae21d631dc..cbed4f3a74 100644 --- a/deploy/gcp/variables.tf +++ b/deploy/gcp/variables.tf @@ -28,7 +28,7 @@ variable "tidb_version" { } variable "tidb_operator_version" { - default = "v1.1.0-rc.3" + default = "v1.1.0" } variable "tidb_operator_chart_version" { diff --git a/tests/e2e/util/image/image.go b/tests/e2e/util/image/image.go index cef2f48c45..5b3ca6ea1c 100644 --- a/tests/e2e/util/image/image.go +++ b/tests/e2e/util/image/image.go @@ -59,12 +59,13 @@ func ListImages() []string { images = append(images, fmt.Sprintf("%s:%s", TiDBMonitorReloaderImage, TiDBMonitorReloaderVersion)) images = append(images, fmt.Sprintf("%s:%s", TiDBMonitorInitializerImage, TiDBMonitorInitializerVersion)) images = append(images, fmt.Sprintf("%s:%s", GrafanaImage, GrafanaVersion)) - imagesFromOperator, err := readImagesFromValues(filepath.Join(framework.TestContext.RepoRoot, "charts/tidb-operator/values.yaml")) + imagesFromOperator, err := readImagesFromValues(filepath.Join(framework.TestContext.RepoRoot, "charts/tidb-operator/values.yaml"), sets.NewString(".advancedStatefulset.image", ".admissionWebhook.jobImage")) if err != nil { framework.ExpectNoError(err) } images = append(images, imagesFromOperator...) - imagesFromTiDBCluster, err := readImagesFromValues(filepath.Join(framework.TestContext.RepoRoot, "charts/tidb-cluster/values.yaml")) + imageKeysFromTiDBCluster := sets.NewString(".pd.image", ".tikv.image", ".tidb.image") + imagesFromTiDBCluster, err := readImagesFromValues(filepath.Join(framework.TestContext.RepoRoot, "charts/tidb-cluster/values.yaml"), imageKeysFromTiDBCluster) if err != nil { framework.ExpectNoError(err) } @@ -75,17 +76,17 @@ func ListImages() []string { // values represents a collection of chart values. type values map[string]interface{} -func walkValues(vals values, fn func(k string, v interface{})) { +func walkValues(vals values, parentKey string, fn func(k string, v interface{})) { for k, v := range vals { - fn(k, v) + fn(parentKey+"."+k, v) valsMap, ok := v.(map[string]interface{}) if ok { - walkValues(valsMap, fn) + walkValues(valsMap, parentKey+"."+k, fn) } } } -func readImagesFromValues(f string) ([]string, error) { +func readImagesFromValues(f string, keys sets.String) ([]string, error) { var vals values data, err := ioutil.ReadFile(f) if err != nil { @@ -99,8 +100,8 @@ func readImagesFromValues(f string) ([]string, error) { vals = values{} } images := []string{} - walkValues(vals, func(k string, v interface{}) { - if k != "image" { + walkValues(vals, "", func(k string, v interface{}) { + if keys != nil && !keys.Has(k) { return } if image, ok := v.(string); ok { diff --git a/tests/e2e/util/image/image_test.go b/tests/e2e/util/image/image_test.go index 3d9eca83b0..33ad32d256 100644 --- a/tests/e2e/util/image/image_test.go +++ b/tests/e2e/util/image/image_test.go @@ -20,12 +20,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "k8s.io/apimachinery/pkg/util/sets" ) func TestReadImagesFromValues(t *testing.T) { tests := []struct { name string values string + keys sets.String wantImages []string }{ { @@ -37,12 +39,28 @@ foo: mysql: image: pingcap/tidb-monitor-reloader:v1.0.1 `, + keys: nil, wantImages: []string{ "pingcap/tidb-monitor-reloader:v1.0.1", "pingcap/tidb:v3.0.4", "busybox:latest", }, }, + { + name: "basic", + values: ` +image: pingcap/tidb:v3.0.4 +foo: + image: busybox:latest + mysql: + image: pingcap/tidb-monitor-reloader:v1.0.1 +`, + keys: sets.NewString(".image", ".foo.image"), + wantImages: []string{ + "pingcap/tidb:v3.0.4", + "busybox:latest", + }, + }, } for _, tt := range tests { @@ -56,13 +74,13 @@ foo: if err != nil { t.Fatal(err) } - got, err := readImagesFromValues(tmpfile.Name()) + got, err := readImagesFromValues(tmpfile.Name(), tt.keys) if err != nil { t.Error(err) } sort.Strings(got) sort.Strings(tt.wantImages) - if diff := cmp.Diff(got, tt.wantImages); diff != "" { + if diff := cmp.Diff(tt.wantImages, got); diff != "" { t.Errorf("unexpected (-want, +got): %s", diff) } })