Skip to content

Commit

Permalink
Merge branch 'pd-dashboard-config' of https://github.com/weekface/tid…
Browse files Browse the repository at this point in the history
…b-operator into pd-dashboard-config
  • Loading branch information
weekface committed Apr 2, 2020
2 parents 966b99a + a14dbaa commit 60c7443
Show file tree
Hide file tree
Showing 48 changed files with 594 additions and 180 deletions.
59 changes: 59 additions & 0 deletions CHANGELOG-1.1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
# TiDB Operator v1.1.0-rc.1 Release Notes

This is a 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.

## Action Required

- `--advertise-address` will be configured for `tidb-server`, which would 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 ([#2076](https://github.com/pingcap/tidb-operator/pull/2076), [@cofyc](https://github.com/cofyc))
- Add the `tlsClient.tlsSecret` field in the backup and restore spec, which supports specifying a secret name that includes the cert ([#2003](https://github.com/pingcap/tidb-operator/pull/2003), [@shuijing198799](https://github.com/shuijing198799))


## Other Notable Changes

- Use `tidb-lightning` in `Restore` instead of `loader` ([#2068](https://github.com/pingcap/tidb-operator/pull/2068), [@Yisaer](https://github.com/Yisaer))
- Add `cert-allowed-cn` support to TiDB components ([#2061](https://github.com/pingcap/tidb-operator/pull/2061), [@weekface](https://github.com/weekface))
- Fix the PD `location-labels` configuration ([#1941](https://github.com/pingcap/tidb-operator/pull/1941), [@aylei](https://github.com/aylei))
- Able to pause and unpause tidb cluster deployment via `spec.paused` ([#2013](https://github.com/pingcap/tidb-operator/pull/2013), [@cofyc](https://github.com/cofyc))
- Default the `max-backups` for TiDB server configuration to `3` if the TiDB cluster is deployed by CR ([#2045](https://github.com/pingcap/tidb-operator/pull/2045), [@Yisaer](https://github.com/Yisaer))
- Able to configure custom environments for components ([#2052](https://github.com/pingcap/tidb-operator/pull/2052), [@cofyc](https://github.com/cofyc))
- Fix the error that `kubectl get tc` cannot show correct images ([#2031](https://github.com/pingcap/tidb-operator/pull/2031), [@Yisaer](https://github.com/Yisaer))
- 1. Default the `spec.tikv.maxFailoverCount` and `spec.tidb.maxFailoverCount` to `3` when they are not defined
2. Disable auto-failover when `maxFailoverCount` is set to `0` ([#2015](https://github.com/pingcap/tidb-operator/pull/2015), [@Yisaer](https://github.com/Yisaer))
- Support deploying TiDB clusters with TidbCluster and TidbMonitor CRs via Terraform on ACK ([#2012](https://github.com/pingcap/tidb-operator/pull/2012), [@DanielZhangQD](https://github.com/DanielZhangQD))
- Update PDConfig for TidbCluster to PD v3.1.0 ([#1928](https://github.com/pingcap/tidb-operator/pull/1928), [@Yisaer](https://github.com/Yisaer))
- Support deploying TiDB clusters with TidbCluster and TidbMonitor CRs via Terraform on AWS ([#2004](https://github.com/pingcap/tidb-operator/pull/2004), [@DanielZhangQD](https://github.com/DanielZhangQD))
- Update TidbConfig for TidbCluster to TiDB v3.1.0 ([#1906](https://github.com/pingcap/tidb-operator/pull/1906), [@Yisaer](https://github.com/Yisaer))
- Allow users to define resources for initContainers in TiDB initializer job ([#1938](https://github.com/pingcap/tidb-operator/pull/1938), [@tfulcrand](https://github.com/tfulcrand))
- Add TLS support for Pump and Drainer ([#1979](https://github.com/pingcap/tidb-operator/pull/1979), [@weekface](https://github.com/weekface))
- Add documents and examples for auto-scaler and initializer ([#1772](https://github.com/pingcap/tidb-operator/pull/1772), [@Yisaer](https://github.com/Yisaer))
- 1. Add check to guarantee the NodePort won't be changed if the serviceType of TidbMonitor is NodePort
2. Add EnvVar sort to avoid the monitor rendering different results from the same TidbMonitor spec
3. Fix the problem that the TidbMonitor LoadBalancer IP is not used ([#1962](https://github.com/pingcap/tidb-operator/pull/1962), [@Yisaer](https://github.com/Yisaer))
- Make tidb-initializer support TLS ([#1931](https://github.com/pingcap/tidb-operator/pull/1931), [@weekface](https://github.com/weekface))
- 1. Fix the problem that Advanced StatefulSet cannot work with webhook
2. Change the Reaction for the Down State TiKV pod during deleting request in webhook from admit to reject ([#1963](https://github.com/pingcap/tidb-operator/pull/1963), [@Yisaer](https://github.com/Yisaer))
- Fix the drainer installation error when `drainerName` is set ([#1961](https://github.com/pingcap/tidb-operator/pull/1961), [@DanielZhangQD](https://github.com/DanielZhangQD))
- Fix some TiKV configuration keys in toml ([#1887](https://github.com/pingcap/tidb-operator/pull/1887), [@aylei](https://github.com/aylei))
- Support using a remote directory as data source for tidb-lightning ([#1629](https://github.com/pingcap/tidb-operator/pull/1629), [@aylei](https://github.com/aylei))
- Add the API document and a script that generates documentation ([#1945](https://github.com/pingcap/tidb-operator/pull/1945), [@Yisaer](https://github.com/Yisaer))
- Add the tikv-importer chart ([#1910](https://github.com/pingcap/tidb-operator/pull/1910), [@shonge](https://github.com/shonge))
- Fix the Prometheus scrape config issue while TLS is enabled ([#1919](https://github.com/pingcap/tidb-operator/pull/1919), [@weekface](https://github.com/weekface))
- Enable TLS between TiDB components ([#1870](https://github.com/pingcap/tidb-operator/pull/1870), [@weekface](https://github.com/weekface))
- Fix the timeout error when `.Values.admission.validation.pods` is `true` during the TiKV upgrade ([#1875](https://github.com/pingcap/tidb-operator/pull/1875), [@Yisaer](https://github.com/Yisaer))
- Enable TLS for MySQL clients ([#1878](https://github.com/pingcap/tidb-operator/pull/1878), [@weekface](https://github.com/weekface))
- Fix the bug which would cause broken TiDB image property ([#1860](https://github.com/pingcap/tidb-operator/pull/1860), [@Yisaer](https://github.com/Yisaer))
- TidbMonitor would use its namespace for the targetRef if it is not defined ([#1834](https://github.com/pingcap/tidb-operator/pull/1834), [@Yisaer](https://github.com/Yisaer))
- Support starting tidb-server with `--advertise-address` parameter ([#1859](https://github.com/pingcap/tidb-operator/pull/1859), [@LinuxGit](https://github.com/LinuxGit))
- Backup/Restore: support configuring TiKV GC life time ([#1835](https://github.com/pingcap/tidb-operator/pull/1835), [@LinuxGit](https://github.com/LinuxGit))
- Support no secret for S3/Ceph when the OIDC authentication is used ([#1817](https://github.com/pingcap/tidb-operator/pull/1817), [@tirsen](https://github.com/tirsen))
- 1. Change the setting from the previous `admission.hookEnabled.pods` to the `admission.validation.pods`
2. Change the setting from the previous `admission.hookEnabled.statefulSets` to the `admission.validation.statefulSets`
3. Change the setting from the previous `admission.hookEnabled.validating` to the `admission.validation.pingcapResources`
4. Change the setting from the previous `admission.hookEnabled.defaulting` to the `admission.mutation.pingcapResources`
5. Change the setting from the previous `admission.failurePolicy.defaulting` to the `admission.failurePolicy.mutation`
6. Change the setting from the previous `admission.failurePolicy.*` to the `admission.failurePolicy.validation` ([#1832](https://github.com/pingcap/tidb-operator/pull/1832), [@Yisaer](https://github.com/Yisaer))
- Enable TidbCluster defaulting mutation by default which is recommended when admission webhook is used ([#1816](https://github.com/pingcap/tidb-operator/pull/1816), [@Yisaer](https://github.com/Yisaer))
- Fix a bug that TiKV fails to start while creating the cluster using CR with cluster TLS enabled ([#1808](https://github.com/pingcap/tidb-operator/pull/1808), [@weekface](https://github.com/weekface))
- Support using prefix in remote storage during backup/restore ([#1790](https://github.com/pingcap/tidb-operator/pull/1790), [@DanielZhangQD](https://github.com/DanielZhangQD))


# TiDB Operator v1.1.0-beta.2 Release Notes

This is a pre-release 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.
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ else
docker: build
endif
docker build --tag "${DOCKER_REGISTRY}/pingcap/tidb-operator:${IMAGE_TAG}" images/tidb-operator
docker build --tag "${DOCKER_REGISTRY}/pingcap/tidb-backup-manager:${IMAGE_TAG}" images/tidb-backup-manager

build: controller-manager scheduler discovery admission-webhook apiserver backup-manager

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ Read the [Roadmap](./ROADMAP.md).

Read the [Quick Start Guide](https://pingcap.com/docs/v3.0/tidb-in-kubernetes/tidb-operator-overview/), which includes all the guides for managing TiDB clusters in Kubernetes.


## Documentation

- [English](https://pingcap.com/docs/v3.0/tidb-in-kubernetes/tidb-operator-overview/)
- [简体中文](https://pingcap.com/docs-cn/v3.0/tidb-in-kubernetes/tidb-operator-overview/)
All the TiDB Operator documentation is maintained in the [docs-tidb-operator repository](https://github.com/pingcap/docs-tidb-operator). You can also see the documentation at PingCAP website:

- [English](https://pingcap.com/docs/tidb-in-kubernetes/stable/tidb-operator-overview/)
- [简体中文](https://pingcap.com/docs-cn/tidb-in-kubernetes/stable/tidb-operator-overview/)

## Contributing

Expand Down
2 changes: 0 additions & 2 deletions charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ fi
# Use HOSTNAME if POD_NAME is unset for backward compatibility.
POD_NAME=${POD_NAME:-$HOSTNAME}
ARGS="--store=tikv \
{{- if .Values.tidb.enableAdvertiseAddress | default false }}
--advertise-address=${POD_NAME}.${HEADLESS_SERVICE_NAME}.${NAMESPACE}.svc \
{{- end }}
--host=0.0.0.0 \
--path=${CLUSTER_NAME}-pd:2379 \
--config=/etc/tidb/tidb.toml
Expand Down
5 changes: 1 addition & 4 deletions charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
type: ClusterIP

discovery:
image: pingcap/tidb-operator:v1.1.0-beta.2
image: pingcap/tidb-operator:v1.1.0-rc.1
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down Expand Up @@ -433,9 +433,6 @@ tidb:
# cloud.google.com/load-balancer-type: Internal
separateSlowLog: true

# Add --advertise-address to TiDB's startup parameters
enableAdvertiseAddress: false

slowLogTailer:
image: busybox:1.26.2
resources:
Expand Down
4 changes: 2 additions & 2 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ rbac:
timezone: UTC

# operatorImage is TiDB Operator image
operatorImage: pingcap/tidb-operator:v1.1.0-beta.2
operatorImage: pingcap/tidb-operator:v1.1.0-rc.1
imagePullPolicy: IfNotPresent

# tidbBackupManagerImage is tidb backup manager image
tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.1.0-beta.2
tidbBackupManagerImage: pingcap/tidb-backup-manager:v1.1.0-rc.1

#
# Enable or disable tidb-operator features:
Expand Down
31 changes: 28 additions & 3 deletions cmd/backup-manager/app/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"io"
"os/exec"
"path"
"strings"

"github.com/gogo/protobuf/proto"
kvbackup "github.com/pingcap/kvproto/pkg/backup"
Expand Down Expand Up @@ -63,11 +64,35 @@ func (bo *Options) backupData(backup *v1alpha1.Backup) (string, error) {
}
fullArgs = append(fullArgs, args...)
klog.Infof("Running br command with args: %v", fullArgs)
output, err := exec.Command("br", fullArgs...).CombinedOutput()
cmd := exec.Command("br", fullArgs...)
cmd.Stderr = cmd.Stdout
stdOut, err := cmd.StdoutPipe()
if err != nil {
return remotePath, fmt.Errorf("cluster %s, execute br command %v failed, output: %s, err: %v", bo, fullArgs, string(output), err)
return remotePath, fmt.Errorf("cluster %s, create stdout pipe failed, err: %v", bo, err)
}
klog.Infof("Backup data for cluster %s successfully, output: %s", bo, string(output))
err = cmd.Start()
if err != nil {
return remotePath, fmt.Errorf("cluster %s, execute br command failed, args: %s, err: %v", bo, fullArgs, err)
}
var tmpOutput, errMsg string
for {
tmp := make([]byte, 1024)
_, err := stdOut.Read(tmp)
tmpOutput = string(tmp)
if strings.Contains(tmpOutput, "[ERROR]") {
errMsg += tmpOutput
}
klog.Infof(strings.Replace(tmpOutput, "\n", "", -1))
if err != nil {
break
}
}
err = cmd.Wait()
if err != nil {
return remotePath, fmt.Errorf("cluster %s, wait pipe message failed, errMsg %s, err: %v", bo, errMsg, err)
}

klog.Infof("Backup data for cluster %s successfully", bo)
return remotePath, nil
}

Expand Down
15 changes: 9 additions & 6 deletions cmd/backup-manager/app/import/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ func (ro *Options) loadTidbClusterData(restorePath string) error {
return fmt.Errorf("dir %s does not exist or is not a dir", restorePath)
}
args := []string{
fmt.Sprintf("-d=%s", restorePath),
fmt.Sprintf("-h=%s", ro.Host),
fmt.Sprintf("-P=%d", ro.Port),
fmt.Sprintf("-u=%s", ro.User),
fmt.Sprintf("-p=%s", ro.Password),
"--status-addr=0.0.0.0:8289",
"--backend=tidb",
"--server-mode=false",
"–-log-file=",
fmt.Sprintf("--tidb-user=%s", ro.User),
fmt.Sprintf("--tidb-password=%s", ro.Password),
fmt.Sprintf("--tidb-host=%s", ro.Host),
fmt.Sprintf("--d=%s", restorePath),
}

output, err := exec.Command("/loader", args...).CombinedOutput()
output, err := exec.Command("/tidb-lightning", args...).CombinedOutput()
if err != nil {
return fmt.Errorf("cluster %s, execute loader command %v failed, output: %s, err: %v", ro, args, string(output), err)
}
Expand Down
30 changes: 27 additions & 3 deletions cmd/backup-manager/app/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"fmt"
"os/exec"
"path"
"strings"

backupUtil "github.com/pingcap/tidb-operator/cmd/backup-manager/app/util"
"github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1"
Expand Down Expand Up @@ -57,11 +58,34 @@ func (ro *Options) restoreData(restore *v1alpha1.Restore) error {
}
fullArgs = append(fullArgs, args...)
klog.Infof("Running br command with args: %v", fullArgs)
output, err := exec.Command("br", fullArgs...).CombinedOutput()
cmd := exec.Command("br", fullArgs...)
cmd.Stderr = cmd.Stdout
stdOut, err := cmd.StdoutPipe()
if err != nil {
return fmt.Errorf("cluster %s, execute br command %v failed, output: %s, err: %v", ro, fullArgs, string(output), err)
return fmt.Errorf("cluster %s, create stdout pipe failed, err: %v", ro, err)
}
klog.Infof("Restore data for cluster %s successfully, output: %s", ro, string(output))
err = cmd.Start()
if err != nil {
return fmt.Errorf("cluster %s, execute br command failed, args: %s, err: %v", ro, fullArgs, err)
}
var tmpOutput, errMsg string
for {
tmp := make([]byte, 1024)
_, err := stdOut.Read(tmp)
tmpOutput = string(tmp)
if strings.Contains(tmpOutput, "[ERROR]") {
errMsg += tmpOutput
}
klog.Infof(strings.Replace(tmpOutput, "\n", "", -1))
if err != nil {
break
}
}
err = cmd.Wait()
if err != nil {
return fmt.Errorf("cluster %s, wait pipe message failed, errMsg %s, err: %v", ro, errMsg, err)
}
klog.Infof("Restore data for cluster %s successfully", ro)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion deploy/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ variable "tidb_version" {
}

variable "tidb_operator_version" {
default = "v1.1.0-beta.2"
default = "v1.1.0-rc.1"
}

variable "tidb_operator_chart_version" {
Expand Down
3 changes: 0 additions & 3 deletions docs/aliyun-tutorial.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api-references/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -7989,19 +7989,6 @@ <h3 id="pingcap.com/v1alpha1.TiDBSpec">TiDBSpec
</tr>
<tr>
<td>
<code>enableAdvertiseAddress</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>Add &ndash;advertise-address to TiDB&rsquo;s startup parameters
Optional: Defaults to false</p>
</td>
</tr>
<tr>
<td>
<code>maxFailoverCount</code></br>
<em>
int32
Expand Down
3 changes: 0 additions & 3 deletions docs/aws-eks-tutorial.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/backup-restore.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/cli-manual.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/google-kubernetes-tutorial.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/minikube-tutorial.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/operation-guide.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/references/tidb-backup-configuration.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/setup.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/troubleshooting.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/user-guide.md

This file was deleted.

1 change: 1 addition & 0 deletions hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ export IMAGE_TAG
export SKIP_GINKGO
export SKIP_IMAGE_LOAD
export TIDB_OPERATOR_IMAGE=$DOCKER_REGISTRY/pingcap/tidb-operator:${IMAGE_TAG}
export TIDB_BACKUP_MANAGER_IMAGE=$DOCKER_REGISTRY/pingcap/tidb-backup-manager:${IMAGE_TAG}
export E2E_IMAGE=$DOCKER_REGISTRY/pingcap/tidb-operator-e2e:${IMAGE_TAG}
export PATH=$OUTPUT_BIN:$PATH

Expand Down
Loading

0 comments on commit 60c7443

Please sign in to comment.