Skip to content

Commit

Permalink
cherry pick pingcap#2884 to release-1.1
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
Yisaer authored and ti-srebot committed Jul 13, 2020
1 parent 1d27625 commit fd0fbf8
Show file tree
Hide file tree
Showing 19 changed files with 1,026 additions and 185 deletions.
183 changes: 172 additions & 11 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2550,21 +2550,13 @@ If not set, the default ScaleOutIntervalSeconds will be set to 300</p>
<td>
<code>metrics</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#metricspec-v2beta2-autoscaling">
[]Kubernetes autoscaling/v2beta2.MetricSpec
<a href="#custommetric">
[]CustomMetric
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>metrics contains the specifications for which to use to calculate the
desired replica count (the maximum replica count across all metrics will
be used). The desired replica count is calculated multiplying the
ratio between the target value and the current value by the current
number of pods. Ergo, metrics used must decrease as the pod count is
increased, and vice-versa. See the individual metric source types for
more information about how each type of metric must respond.
If not set, the default metric will be set to 80% average CPU utilization.</p>
</td>
</tr>
<tr>
Expand All @@ -2576,7 +2568,7 @@ string
</td>
<td>
<em>(Optional)</em>
<p>MetricsTimeDuration describe the Time duration to be queried in the Prometheus</p>
<p>MetricsTimeDuration describes the Time duration to be queried in the Prometheus</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -3399,6 +3391,77 @@ CrdKind
</tr>
</tbody>
</table>
<h3 id="custommetric">CustomMetric</h3>
<p>
(<em>Appears on:</em>
<a href="#basicautoscalerspec">BasicAutoScalerSpec</a>)
</p>
<p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>MetricSpec</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#metricspec-v2beta2-autoscaling">
Kubernetes autoscaling/v2beta2.MetricSpec
</a>
</em>
</td>
<td>
<p>
(Members of <code>MetricSpec</code> are embedded into this type.)
</p>
<em>(Optional)</em>
<p>metrics contains the specifications for which to use to calculate the
desired replica count (the maximum replica count across all metrics will
be used). The desired replica count is calculated multiplying the
ratio between the target value and the current value by the current
number of pods. Ergo, metrics used must decrease as the pod count is
increased, and vice-versa. See the individual metric source types for
more information about how each type of metric must respond.
If not set, the auto-scaling won&rsquo;t happen.</p>
</td>
</tr>
<tr>
<td>
<code>leastStoragePressurePeriodSeconds</code></br>
<em>
int64
</em>
</td>
<td>
<em>(Optional)</em>
<p>LeastStoragePressurePeriodSeconds is only for the storage auto-scaling case when the resource name in the metricSpec
is <code>Storage</code>. When the Storage metrics meet the pressure, Operator would wait
LeastStoragePressurePeriodSeconds duration then able to scale out.
If not set, the default value is <code>300</code></p>
</td>
</tr>
<tr>
<td>
<code>leastRemainAvailableStoragePercent</code></br>
<em>
int64
</em>
</td>
<td>
<em>(Optional)</em>
<p>LeastRemainAvailableStoragePercent indicates the least remaining available storage percent compare to
the capacity storage. If the available storage is lower than the capacity storage * LeastRemainAvailableStoragePercent,
the storage status will become storage pressure and ready to be scaled out.
LeastRemainAvailableStoragePercent should between 5 and 90. If not set, the default value would be 10</p>
</td>
</tr>
</tbody>
</table>
<h3 id="dashboardconfig">DashboardConfig</h3>
<p>
(<em>Appears on:</em>
Expand Down Expand Up @@ -4725,6 +4788,7 @@ string
</em>
</td>
<td>
<em>(Optional)</em>
<p>CurrentValue indicates the value calculated in the last auto-scaling reconciliation</p>
</td>
</tr>
Expand All @@ -4736,9 +4800,26 @@ string
</em>
</td>
<td>
<em>(Optional)</em>
<p>TargetValue indicates the threshold value for this metrics in auto-scaling</p>
</td>
</tr>
<tr>
<td>
<code>StorageMetricsStatus</code></br>
<em>
<a href="#storagemetricsstatus">
StorageMetricsStatus
</a>
</em>
</td>
<td>
<p>
(Members of <code>StorageMetricsStatus</code> are embedded into this type.)
</p>
<em>(Optional)</em>
</td>
</tr>
</tbody>
</table>
<h3 id="monitorcomponentaccessor">MonitorComponentAccessor</h3>
Expand Down Expand Up @@ -8567,6 +8648,86 @@ More info: <a href="https://kubernetes.io/docs/concepts/storage/persistent-volum
</tr>
</tbody>
</table>
<h3 id="storagemetricsstatus">StorageMetricsStatus</h3>
<p>
(<em>Appears on:</em>
<a href="#metricsstatus">MetricsStatus</a>)
</p>
<p>
<p>StorageMetricsStatus describe the storage 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>storagePressure</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>StoragePressure indicates whether storage under pressure</p>
</td>
</tr>
<tr>
<td>
<code>storagePressureStartTime</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>StoragePressureStartTime indicates the timestamp of the StoragePressure fist become true from false or nil</p>
</td>
</tr>
<tr>
<td>
<code>availableStorage</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
<tr>
<td>
<code>capacityStorage</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
<tr>
<td>
<code>baselineAvailableStorage</code></br>
<em>
string
</em>
</td>
<td>
<p>BaselineAvailableStorage indicates the baseline for available storage size.
This is calculated by the capacity storage size * storage auto-scaling baseline percent value
If the AvailableStorage is less than the BaselineAvailableStorage, the database is under StoragePressure
optional</p>
</td>
</tr>
</tbody>
</table>
<h3 id="storageprovider">StorageProvider</h3>
<p>
(<em>Appears on:</em>
Expand Down
26 changes: 22 additions & 4 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13984,16 +13984,25 @@ spec:
metrics:
items:
properties:
availableStorage:
type: string
baselineAvailableStorage:
type: string
capacityStorage:
type: string
currentValue:
type: string
name:
type: string
storagePressure:
type: boolean
storagePressureStartTime:
format: date-time
type: string
thresholdValue:
type: string
required:
- name
- currentValue
- thresholdValue
type: object
type: array
recommendedReplicas:
Expand All @@ -14013,16 +14022,25 @@ spec:
metrics:
items:
properties:
availableStorage:
type: string
baselineAvailableStorage:
type: string
capacityStorage:
type: string
currentValue:
type: string
name:
type: string
storagePressure:
type: boolean
storagePressureStartTime:
format: date-time
type: string
thresholdValue:
type: string
required:
- name
- currentValue
- thresholdValue
type: object
type: array
recommendedReplicas:
Expand Down
Loading

0 comments on commit fd0fbf8

Please sign in to comment.