Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Auto-scaling status #2182

Merged
merged 15 commits into from
Apr 15, 2020
229 changes: 228 additions & 1 deletion docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,75 @@ 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>
string
</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 @@ -3984,6 +4053,58 @@ optional</p>
<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 @@ -12888,6 +13009,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 @@ -12983,8 +13138,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 @@ -13876,6 +14069,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"
95 changes: 94 additions & 1 deletion manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10768,6 +10768,99 @@ 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: LastAutoScalingTimestamp describes the last auto-scaling
timestamp for the component(tidb/tikv)
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: LastAutoScalingTimestamp describes the last auto-scaling
timestamp for the component(tidb/tikv)
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