|
| 1 | +--- |
| 2 | +title: Kubernetes 自定义指标 (v1beta2) |
| 3 | +content_type: tool-reference |
| 4 | +package: custom.metrics.k8s.io/v1beta2 |
| 5 | +--- |
| 6 | +<!-- |
| 7 | +title: Kubernetes Custom Metrics (v1beta2) |
| 8 | +content_type: tool-reference |
| 9 | +package: custom.metrics.k8s.io/v1beta2 |
| 10 | +auto_generated: true |
| 11 | +--> |
| 12 | + |
| 13 | +<!-- |
| 14 | +<p>Package v1beta2 is the v1beta2 version of the custom_metrics API.</p> |
| 15 | +--> |
| 16 | +<p>v1beta2 包是 v1beta2 版本的 custom_metrics API。</p> |
| 17 | + |
| 18 | +## 资源类型 {#resource-types} |
| 19 | + |
| 20 | +- [MetricListOptions](#custom-metrics-k8s-io-v1beta2-MetricListOptions) |
| 21 | +- [MetricValue](#custom-metrics-k8s-io-v1beta2-MetricValue) |
| 22 | +- [MetricValueList](#custom-metrics-k8s-io-v1beta2-MetricValueList) |
| 23 | + |
| 24 | +## `MetricListOptions` {#custom-metrics-k8s-io-v1beta2-MetricListOptions} |
| 25 | + |
| 26 | +<p> |
| 27 | +<!-- |
| 28 | +<p>MetricListOptions is used to select metrics by their label selectors</p> |
| 29 | +--> |
| 30 | +<p>MetricListOptions 用于按其标签选择算符来选择指标。</p> |
| 31 | + |
| 32 | +<table class="table"> |
| 33 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 34 | +<tbody> |
| 35 | + |
| 36 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr> |
| 37 | +<tr><td><code>kind</code><br/>string</td><td><code>MetricListOptions</code></td></tr> |
| 38 | + |
| 39 | + |
| 40 | +<tr><td><code>labelSelector</code><br/> |
| 41 | +<code>string</code> |
| 42 | +</td> |
| 43 | +<td> |
| 44 | + <!-- |
| 45 | + <p>A selector to restrict the list of returned objects by their labels. |
| 46 | +Defaults to everything.</p> |
| 47 | + --> |
| 48 | + <p>这个选择算符通过标签来限制所返回对象的列表。 |
| 49 | +默认为任意值。</p> |
| 50 | +</td> |
| 51 | +</tr> |
| 52 | +<tr><td><code>metricLabelSelector</code><br/> |
| 53 | +<code>string</code> |
| 54 | +</td> |
| 55 | +<td> |
| 56 | + <!-- |
| 57 | + <p>A selector to restrict the list of returned metrics by their labels</p> |
| 58 | + --> |
| 59 | + <p>这个选择算符通过标签来限制所返回指标的列表。</p> |
| 60 | +</td> |
| 61 | +</tr> |
| 62 | +</tbody> |
| 63 | +</table> |
| 64 | + |
| 65 | +## `MetricValue` {#custom-metrics-k8s-io-v1beta2-MetricValue} |
| 66 | + |
| 67 | +<!-- |
| 68 | +**Appears in:** |
| 69 | +--> |
| 70 | +**出现在:** |
| 71 | + |
| 72 | +- [MetricValueList](#custom-metrics-k8s-io-v1beta2-MetricValueList) |
| 73 | + |
| 74 | +<!-- |
| 75 | +<p>MetricValue is the metric value for some object</p> |
| 76 | +--> |
| 77 | +<p>MetricValue 是某些对象的指标值。</p> |
| 78 | + |
| 79 | +<table class="table"> |
| 80 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 81 | +<tbody> |
| 82 | + |
| 83 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr> |
| 84 | +<tr><td><code>kind</code><br/>string</td><td><code>MetricValue</code></td></tr> |
| 85 | + |
| 86 | + |
| 87 | +<tr><td><code>describedObject</code> <B><!--[Required]-->[必需]</B><br/> |
| 88 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#objectreference-v1-core"><code>core/v1.ObjectReference</code></a> |
| 89 | +</td> |
| 90 | +<td> |
| 91 | + <!-- |
| 92 | + <p>a reference to the described object</p> |
| 93 | + --> |
| 94 | + <p>指向描述对象的引用。</p> |
| 95 | +</td> |
| 96 | +</tr> |
| 97 | +<tr><td><code>metric</code> <B><!--[Required]-->[必需]</B><br/> |
| 98 | +<a href="#custom-metrics-k8s-io-v1beta2-MetricIdentifier"><code>MetricIdentifier</code></a> |
| 99 | +</td> |
| 100 | +<td> |
| 101 | + <span class="text-muted"><!--No description provided.-->无描述。</span></td> |
| 102 | +</tr> |
| 103 | +<tr><td><code>timestamp</code> <B><!--[Required]-->[必需]</B><br/> |
| 104 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#time-v1-meta"><code>meta/v1.Time</code></a> |
| 105 | +</td> |
| 106 | +<td> |
| 107 | + <!-- |
| 108 | + <p>indicates the time at which the metrics were produced</p> |
| 109 | + --> |
| 110 | + <p>标明度量值生成的时间。</p> |
| 111 | +</td> |
| 112 | +</tr> |
| 113 | +<tr><td><code>windowSeconds</code> <B><!--[Required]-->[必需]</B><br/> |
| 114 | +<code>int64</code> |
| 115 | +</td> |
| 116 | +<td> |
| 117 | + <!-- |
| 118 | + <p>indicates the window ([Timestamp-Window, Timestamp]) from |
| 119 | +which these metrics were calculated, when returning rate |
| 120 | +metrics calculated from cumulative metrics (or zero for |
| 121 | +non-calculated instantaneous metrics).</p> |
| 122 | + --> |
| 123 | + <p>当返回根据累积度量计算的速率度量值时,此字段标明计算这些度量值的时间窗口 |
| 124 | + ([Timestamp-Window, Timestamp])(或对于非计算的瞬时度量值为零)。</p> |
| 125 | +</td> |
| 126 | +</tr> |
| 127 | +<tr><td><code>value</code> <B><!--[Required]-->[必需]</B><br/> |
| 128 | +<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity"><code>k8s.io/apimachinery/pkg/api/resource.Quantity</code></a> |
| 129 | +</td> |
| 130 | +<td> |
| 131 | + <!-- |
| 132 | + <p>the value of the metric for this</p> |
| 133 | + --> |
| 134 | + <p>度量值。</p> |
| 135 | +</td> |
| 136 | +</tr> |
| 137 | +</tbody> |
| 138 | +</table> |
| 139 | + |
| 140 | +## `MetricValueList` {#custom-metrics-k8s-io-v1beta2-MetricValueList} |
| 141 | + |
| 142 | +<!-- |
| 143 | +<p>MetricValueList is a list of values for a given metric for some set of objects</p> |
| 144 | +--> |
| 145 | +<p>MetricValueList 是某个给定指标的某些对象集的数值列表。</p> |
| 146 | + |
| 147 | +<table class="table"> |
| 148 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 149 | +<tbody> |
| 150 | + |
| 151 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr> |
| 152 | +<tr><td><code>kind</code><br/>string</td><td><code>MetricValueList</code></td></tr> |
| 153 | + |
| 154 | + |
| 155 | +<tr><td><code>metadata</code> <B><!--[Required]-->[必需]</B><br/> |
| 156 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#listmeta-v1-meta"><code>meta/v1.ListMeta</code></a> |
| 157 | +</td> |
| 158 | +<td> |
| 159 | + <span class="text-muted"><!--No description provided.-->无描述。</span></td> |
| 160 | +</tr> |
| 161 | +<tr><td><code>items</code> <B><!--[Required]-->[必需]</B><br/> |
| 162 | +<a href="#custom-metrics-k8s-io-v1beta2-MetricValue"><code>[]MetricValue</code></a> |
| 163 | +</td> |
| 164 | +<td> |
| 165 | + <!-- |
| 166 | + <p>the value of the metric across the described objects</p> |
| 167 | + --> |
| 168 | + <p>所描述对象的度量值。</p> |
| 169 | +</td> |
| 170 | +</tr> |
| 171 | +</tbody> |
| 172 | +</table> |
| 173 | + |
| 174 | +## `MetricIdentifier` {#custom-metrics-k8s-io-v1beta2-MetricIdentifier} |
| 175 | + |
| 176 | +<!-- |
| 177 | +**Appears in:** |
| 178 | +--> |
| 179 | +**出现在:** |
| 180 | + |
| 181 | +- [MetricValue](#custom-metrics-k8s-io-v1beta2-MetricValue) |
| 182 | + |
| 183 | +<!-- |
| 184 | +<p>MetricIdentifier identifies a metric by name and, optionally, selector</p> |
| 185 | +--> |
| 186 | +<p>MetricIdentifier 按名称和可选的选择算符来标识指标。</p> |
| 187 | + |
| 188 | +<table class="table"> |
| 189 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 190 | +<tbody> |
| 191 | + |
| 192 | +<tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/> |
| 193 | +<code>string</code> |
| 194 | +</td> |
| 195 | +<td> |
| 196 | + <!-- |
| 197 | + <p>name is the name of the given metric</p> |
| 198 | + --> |
| 199 | + <p>name 是给定指标的名称。</p> |
| 200 | +</td> |
| 201 | +</tr> |
| 202 | +<tr><td><code>selector</code><br/> |
| 203 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#labelselector-v1-meta"><code>meta/v1.LabelSelector</code></a> |
| 204 | +</td> |
| 205 | +<td> |
| 206 | + <!-- |
| 207 | + <p>selector represents the label selector that could be used to select |
| 208 | +this metric, and will generally just be the selector passed in to |
| 209 | +the query used to fetch this metric. |
| 210 | +When left blank, only the metric's Name will be used to gather metrics.</p> |
| 211 | + --> |
| 212 | + <p>selector 表示可用于选择此指标的标签选择算符,通常就是传递给查询用于获取此指标的选择算符。 |
| 213 | +当留空时,仅使用指标的 Name 来采集指标。</p> |
| 214 | +</td> |
| 215 | +</tr> |
| 216 | +</tbody> |
| 217 | +</table> |
| 218 | + |
0 commit comments