Skip to content

Commit

Permalink
add storage api
Browse files Browse the repository at this point in the history
fix

fix

fix

Update tikv_autoscaler.go

fix

fix

fix lint

add doc

fix error

fix error

fix unit test

fix error

remove useless code

fux unit test

fix error

Update docs.md

fix api

fix status
  • Loading branch information
Yisaer committed Jul 8, 2020
1 parent 863fb80 commit 75ead5d
Show file tree
Hide file tree
Showing 17 changed files with 862 additions and 157 deletions.
181 changes: 171 additions & 10 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 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 note 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 @@ -4931,6 +4994,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 @@ -4942,9 +5006,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 @@ -13485,16 +13485,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 @@ -13514,16 +13523,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 75ead5d

Please sign in to comment.