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 TiKV auto scaling-out by Storage #2884

Merged
merged 17 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 172 additions & 11 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2756,21 +2756,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 @@ -2782,7 +2774,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 @@ -3613,6 +3605,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 @@ -4971,6 +5034,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 @@ -4982,9 +5046,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 @@ -8813,6 +8894,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 @@ -13489,16 +13489,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 @@ -13518,16 +13527,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