Skip to content

Commit

Permalink
cp_2182 (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer committed Apr 15, 2020
1 parent 8fe548b commit 00e9dc8
Show file tree
Hide file tree
Showing 11 changed files with 761 additions and 7 deletions.
231 changes: 230 additions & 1 deletion docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,77 @@ If not set, the default value is 5.</p>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.BasicAutoScalerStatus">BasicAutoScalerStatus
</h3>
<p>
(<em>Appears on:</em>
<a href="#pingcap.com/v1alpha1.TidbAutoScalerStatus">TidbAutoScalerStatus</a>,
<a href="#pingcap.com/v1alpha1.TikvAutoScalerStatus">TikvAutoScalerStatus</a>)
</p>
<p>
<p>BasicAutoScalerStatus describe the basic auto-scaling status</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>metrics</code></br>
<em>
<a href="#pingcap.com/v1alpha1.MetricsStatus">
[]MetricsStatus
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>MetricsStatusList describes the metrics status in the last auto-scaling reconciliation</p>
</td>
</tr>
<tr>
<td>
<code>currentReplicas</code></br>
<em>
int32
</em>
</td>
<td>
<p>CurrentReplicas describes the current replicas for the component(tidb/tikv)</p>
</td>
</tr>
<tr>
<td>
<code>recommendedReplicas</code></br>
<em>
int32
</em>
</td>
<td>
<em>(Optional)</em>
<p>RecommendedReplicas describes the calculated replicas in the last auto-scaling reconciliation for the component(tidb/tikv)</p>
</td>
</tr>
<tr>
<td>
<code>lastAutoScalingTimestamp</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#time-v1-meta">
Kubernetes meta/v1.Time
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>LastAutoScalingTimestamp describes the last auto-scaling timestamp for the component(tidb/tikv)</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.Binlog">Binlog
</h3>
<p>
Expand Down Expand Up @@ -3873,6 +3944,58 @@ Kubernetes core/v1.ResourceRequirements
<p>
<p>MemberType represents member type</p>
</p>
<h3 id="pingcap.com/v1alpha1.MetricsStatus">MetricsStatus
</h3>
<p>
(<em>Appears on:</em>
<a href="#pingcap.com/v1alpha1.BasicAutoScalerStatus">BasicAutoScalerStatus</a>)
</p>
<p>
<p>MetricsStatus describe the basic metrics status in the last auto-scaling reconciliation</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>name</code></br>
<em>
string
</em>
</td>
<td>
<p>Name indicates the metrics name</p>
</td>
</tr>
<tr>
<td>
<code>currentValue</code></br>
<em>
string
</em>
</td>
<td>
<p>CurrentValue indicates the value calculated in the last auto-scaling reconciliation</p>
</td>
</tr>
<tr>
<td>
<code>thresholdValue</code></br>
<em>
string
</em>
</td>
<td>
<p>TargetValue indicates the threshold value for this metrics in auto-scaling</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.MonitorComponentAccessor">MonitorComponentAccessor
</h3>
<p>
Expand Down Expand Up @@ -12640,6 +12763,40 @@ BasicAutoScalerSpec
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.TidbAutoScalerStatus">TidbAutoScalerStatus
</h3>
<p>
(<em>Appears on:</em>
<a href="#pingcap.com/v1alpha1.TidbClusterAutoSclaerStatus">TidbClusterAutoSclaerStatus</a>)
</p>
<p>
<p>TidbAutoScalerStatus describe the auto-scaling status of tidb</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>BasicAutoScalerStatus</code></br>
<em>
<a href="#pingcap.com/v1alpha1.BasicAutoScalerStatus">
BasicAutoScalerStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>BasicAutoScalerStatus</code> are embedded into this type.)
</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.TidbClusterAutoScalerSpec">TidbClusterAutoScalerSpec
</h3>
<p>
Expand Down Expand Up @@ -12735,8 +12892,46 @@ TidbAutoScalerSpec
<a href="#pingcap.com/v1alpha1.TidbClusterAutoScaler">TidbClusterAutoScaler</a>)
</p>
<p>
<p>TODO: sync status</p>
<p>TidbClusterAutoSclaerStatus describe the whole status</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>tikv</code></br>
<em>
<a href="#pingcap.com/v1alpha1.TikvAutoScalerStatus">
TikvAutoScalerStatus
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Tikv describes the status for the tikv in the last auto-scaling reconciliation</p>
</td>
</tr>
<tr>
<td>
<code>tidb</code></br>
<em>
<a href="#pingcap.com/v1alpha1.TidbAutoScalerStatus">
TidbAutoScalerStatus
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Tidb describes the status for the tidb in the last auto-scaling reconciliation</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.TidbClusterRef">TidbClusterRef
</h3>
<p>
Expand Down Expand Up @@ -13628,6 +13823,40 @@ BasicAutoScalerSpec
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.TikvAutoScalerStatus">TikvAutoScalerStatus
</h3>
<p>
(<em>Appears on:</em>
<a href="#pingcap.com/v1alpha1.TidbClusterAutoSclaerStatus">TidbClusterAutoSclaerStatus</a>)
</p>
<p>
<p>TikvAutoScalerStatus describe the auto-scaling status of tikv</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>BasicAutoScalerStatus</code></br>
<em>
<a href="#pingcap.com/v1alpha1.BasicAutoScalerStatus">
BasicAutoScalerStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>BasicAutoScalerStatus</code> are embedded into this type.)
</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.TxnLocalLatches">TxnLocalLatches
</h3>
<p>
Expand Down
3 changes: 3 additions & 0 deletions examples/auto-scale/tidb-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
baseImage: pingcap/tikv
replicas: 3
requests:
cpu: "1"
storage: "1Gi"
config: {}
tidb:
Expand All @@ -24,3 +25,5 @@ spec:
service:
type: ClusterIP
config: {}
requests:
cpu: "1"
99 changes: 98 additions & 1 deletion manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10676,6 +10676,103 @@ spec:
required:
- cluster
type: object
status: {}
status:
description: TidbClusterAutoSclaerStatus describe the whole status
properties:
tidb:
description: TidbAutoScalerStatus describe the auto-scaling status of
tidb
properties:
currentReplicas:
description: CurrentReplicas describes the current replicas for
the component(tidb/tikv)
format: int32
type: integer
lastAutoScalingTimestamp:
description: Time is a wrapper around time.Time which supports correct
marshaling to YAML and JSON. Wrappers are provided for many of
the factory methods that the time package offers.
format: date-time
type: string
metrics:
description: MetricsStatusList describes the metrics status in the
last auto-scaling reconciliation
items:
description: MetricsStatus describe the basic metrics status in
the last auto-scaling reconciliation
properties:
currentValue:
description: CurrentValue indicates the value calculated in
the last auto-scaling reconciliation
type: string
name:
description: Name indicates the metrics name
type: string
thresholdValue:
description: TargetValue indicates the threshold value for
this metrics in auto-scaling
type: string
required:
- name
- currentValue
- thresholdValue
type: object
type: array
recommendedReplicas:
description: RecommendedReplicas describes the calculated replicas
in the last auto-scaling reconciliation for the component(tidb/tikv)
format: int32
type: integer
required:
- currentReplicas
type: object
tikv:
description: TikvAutoScalerStatus describe the auto-scaling status of
tikv
properties:
currentReplicas:
description: CurrentReplicas describes the current replicas for
the component(tidb/tikv)
format: int32
type: integer
lastAutoScalingTimestamp:
description: Time is a wrapper around time.Time which supports correct
marshaling to YAML and JSON. Wrappers are provided for many of
the factory methods that the time package offers.
format: date-time
type: string
metrics:
description: MetricsStatusList describes the metrics status in the
last auto-scaling reconciliation
items:
description: MetricsStatus describe the basic metrics status in
the last auto-scaling reconciliation
properties:
currentValue:
description: CurrentValue indicates the value calculated in
the last auto-scaling reconciliation
type: string
name:
description: Name indicates the metrics name
type: string
thresholdValue:
description: TargetValue indicates the threshold value for
this metrics in auto-scaling
type: string
required:
- name
- currentValue
- thresholdValue
type: object
type: array
recommendedReplicas:
description: RecommendedReplicas describes the calculated replicas
in the last auto-scaling reconciliation for the component(tidb/tikv)
format: int32
type: integer
required:
- currentReplicas
type: object
type: object
type: object
version: v1alpha1
Loading

0 comments on commit 00e9dc8

Please sign in to comment.