Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into yinliang/add-pump…
Browse files Browse the repository at this point in the history
…-tls
  • Loading branch information
shuijing198799 committed Feb 23, 2020
2 parents 6eea9cd + c9e1d44 commit bc19164
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Close stale issues/prs"
on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days'
stale-pr-message: 'This pr is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days'
days-before-stale: 60
days-before-close: 15
stale-issue-label: 'lifecycle/stale'
stale-pr-label: 'lifecycle/stale'
exempt-issue-label: 'lifecycle/frozen'
exempt-pr-label: 'lifecycle/frozen'
2 changes: 2 additions & 0 deletions ci/deploy_tidb_operator_staging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ admissionWebhook:
# TODO: enable validating and defaulting after we ease the constrain
validating: false
defaulting: false
features:
- AutoScaling=true
'''

def call(BUILD_BRANCH) {
Expand Down
73 changes: 73 additions & 0 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# A Basic TiDB cluster with monitoring

> **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, the monitoring data is not persisted by default.

**Prerequisites**:
- Has TiDB operator `v1.1.0-beta.1` or higher version installed. [Doc](https://pingcap.com/docs/stable/tidb-in-kubernetes/deploy/tidb-operator/)
- Has default `StorageClass` configured, and there are enough PVs (by default, 6 PVs are required) of that storageClass:

This could by verified by the following command:

```bash
> kubectl get storageclass
```

The output is similar to this:

```bash
NAME PROVISIONER AGE
standard (default) kubernetes.io/gce-pd 1d
gold kubernetes.io/gce-pd 1d
```

Alternatively, you could specify the storageClass explicitly by modifying `tidb-cluster.yaml`.

## Install

The following commands is assumed to be executed in this directory.

Install the cluster:

```bash
> kubectl -n <namespace> apply -f ./
```

Wait for cluster Pods ready:

```bash
watch kubectl -n <namespace> get pod
```

## Explore

Explore the TiDB sql interface:

```bash
> kubectl -n <namespace> port-forward svc/basic-tidb 4000:4000 &>/tmp/pf-tidb.log &
> mysql -h 127.0.0.1 -P 4000 -u root
```

Explore the monitoring dashboards:

```bash
> kubectl -n <namespace> port-forward svc/basic-grafana 4000:4000 &>/tmp/pf-grafana.log &
```

Browse [localhost:4000](http://localhost:4000).

## Destroy

```bash
> kubectl -n <namespace> delete -f ./
```

The PVCs used by TiDB cluster will not be deleted in the above process, therefore, the PVs will be not be released neither. You can delete PVCs and release the PVs by the following command:

```bash
> kubectl -n <namespace> delete pvc app.kubernetes.io/instance=basic,app.kubernetes.io,app.kubernetes.io/managed-by=tidb-operator
```

26 changes: 26 additions & 0 deletions examples/basic/tidb-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
spec:
version: v3.0.8
timezone: UTC
pvReclaimPolicy: Delete
pd:
baseImage: pingcap/pd
replicas: 3
requests:
storage: "1Gi"
config: {}
tikv:
baseImage: pingcap/tikv
replicas: 3
requests:
storage: "50Gi"
config: {}
tidb:
baseImage: pingcap/tidb
replicas: 2
service:
type: ClusterIP
config: {}
20 changes: 20 additions & 0 deletions examples/basic/tidb-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: pingcap.com/v1alpha1
kind: TidbMonitor
metadata:
name: basic
spec:
clusters:
- name: basic
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

0 comments on commit bc19164

Please sign in to comment.