-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Song Gao
committed
Mar 16, 2020
1 parent
a5078a4
commit 881eea3
Showing
7 changed files
with
113 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# The extra TiDB cluster Components | ||
|
||
> **Note:** | ||
> | ||
> This setup is for test or demo purpose only and **IS NOT** applicable for critical environment. Refer to the [Documents](https://pingcap.com/docs/stable/tidb-in-kubernetes/deploy/prerequisites/) for production setup. | ||
|
||
The following steps will create a TiDB cluster with monitoring and auto-scaler, the monitoring data is not persisted by default. | ||
|
||
**Prerequisites**: | ||
- Has TiDB operator `v1.1.0-beta.2` or higher version installed. [Doc](https://pingcap.com/docs/stable/tidb-in-kubernetes/deploy/tidb-operator/) | ||
|
||
|
||
## Auto-scaling | ||
|
||
> **Note:** | ||
> | ||
> The Auto-scaling feature is still in alpha, you should enable this feature in TiDB Operator by setting values.yaml: | ||
```yaml | ||
features: | ||
AutoScaling=true | ||
``` | ||
Auto-scale the cluster based on CPU load | ||
```bash | ||
> kubectl -n <namespace> apply -f ./ | ||
``` | ||
|
||
## Destroy | ||
|
||
```bash | ||
> kubectl -n <namespace> delete -f ./ | ||
``` |
6 changes: 3 additions & 3 deletions
6
examples/extra/tidb-cluster-auto-scaler.yaml → .../auto-scale/tidb-cluster-auto-scaler.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbCluster | ||
metadata: | ||
name: auto-scaling-demo | ||
spec: | ||
version: v3.0.8 | ||
timezone: UTC | ||
pvReclaimPolicy: Delete | ||
pd: | ||
baseImage: pingcap/pd | ||
replicas: 1 | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
tikv: | ||
baseImage: pingcap/tikv | ||
replicas: 1 | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
tidb: | ||
baseImage: pingcap/tidb | ||
replicas: 1 | ||
service: | ||
type: ClusterIP | ||
config: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbMonitor | ||
metadata: | ||
name: auto-scaling-demo | ||
spec: | ||
clusters: | ||
- name: auto-scaling-demo | ||
prometheus: | ||
baseImage: prom/prometheus | ||
version: v2.11.1 | ||
grafana: | ||
baseImage: grafana/grafana | ||
version: 6.0.1 | ||
initializer: | ||
baseImage: pingcap/tidb-monitor-initializer | ||
version: v3.0.5 | ||
reloader: | ||
baseImage: pingcap/tidb-monitor-reloader | ||
version: v1.0.1 | ||
imagePullPolicy: IfNotPresent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbCluster | ||
metadata: | ||
name: initialize-demo | ||
spec: | ||
version: v3.0.8 | ||
timezone: UTC | ||
pvReclaimPolicy: Delete | ||
pd: | ||
baseImage: pingcap/pd | ||
replicas: 1 | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
tikv: | ||
baseImage: pingcap/tikv | ||
replicas: 1 | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
tidb: | ||
baseImage: pingcap/tidb | ||
replicas: 1 | ||
service: | ||
type: ClusterIP | ||
config: {} |
4 changes: 2 additions & 2 deletions
4
examples/extra/tidb-initializer.yaml → examples/initialize/tidb-initializer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbInitializer | ||
metadata: | ||
name: basic | ||
name: initialize-demo | ||
spec: | ||
image: tnir/mysqlclient | ||
imagePullPolicy: IfNotPresent | ||
cluster: | ||
name: basic | ||
name: initialize-demo | ||
initSql: "create database hello;" | ||
passwordSecret: "tidb-secret" |