Skip to content

Commit bc4758e

Browse files
committed
Add config APIs metrics API
The 'metrics.k8s.io' APIs are exposed by the 'metrics-server' component to facilitate auto-scaling. The other two APIs are for fetching metrics from custom or external sources respectively.
1 parent 70b445f commit bc4758e

File tree

6 files changed

+539
-11
lines changed

6 files changed

+539
-11
lines changed

content/en/docs/reference/_index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ operator to use or manage a cluster.
102102
* [v1beta3](/docs/reference/config-api/kubeadm-config.v1beta3/)
103103
* [v1beta4](/docs/reference/config-api/kubeadm-config.v1beta4/)
104104

105+
## External APIs
106+
107+
These are the APIs defined by the Kubernetes project, but are not implemented
108+
by the core project:
109+
110+
* [Metrics API (v1beta1)](/docs/reference/external-api/metrics.v1beta1/)
111+
* [Custom Metrics API (v1beta2)](/docs/reference/external-api/custom-metrics.v1beta2)
112+
* [External Metrics API (v1beta1)](/docs/reference/external-api/external-metrics.v1beta1)
113+
105114
## Design Docs
106115

107116
An archive of the design docs for Kubernetes functionality. Good starting points are
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: External APIs
3+
weight: 135
4+
---
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: Kubernetes Custom Metrics (v1beta2)
3+
content_type: tool-reference
4+
package: custom.metrics.k8s.io/v1beta2
5+
auto_generated: true
6+
---
7+
<p>Package v1beta2 is the v1beta2 version of the custom_metrics API.</p>
8+
9+
10+
## Resource Types
11+
12+
13+
- [MetricListOptions](#custom-metrics-k8s-io-v1beta2-MetricListOptions)
14+
- [MetricValue](#custom-metrics-k8s-io-v1beta2-MetricValue)
15+
- [MetricValueList](#custom-metrics-k8s-io-v1beta2-MetricValueList)
16+
17+
18+
19+
## `MetricListOptions` {#custom-metrics-k8s-io-v1beta2-MetricListOptions}
20+
21+
22+
23+
<p>MetricListOptions is used to select metrics by their label selectors</p>
24+
25+
26+
<table class="table">
27+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
28+
<tbody>
29+
30+
<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr>
31+
<tr><td><code>kind</code><br/>string</td><td><code>MetricListOptions</code></td></tr>
32+
33+
34+
<tr><td><code>labelSelector</code><br/>
35+
<code>string</code>
36+
</td>
37+
<td>
38+
<p>A selector to restrict the list of returned objects by their labels.
39+
Defaults to everything.</p>
40+
</td>
41+
</tr>
42+
<tr><td><code>metricLabelSelector</code><br/>
43+
<code>string</code>
44+
</td>
45+
<td>
46+
<p>A selector to restrict the list of returned metrics by their labels</p>
47+
</td>
48+
</tr>
49+
</tbody>
50+
</table>
51+
52+
## `MetricValue` {#custom-metrics-k8s-io-v1beta2-MetricValue}
53+
54+
55+
**Appears in:**
56+
57+
- [MetricValueList](#custom-metrics-k8s-io-v1beta2-MetricValueList)
58+
59+
60+
<p>MetricValue is the metric value for some object</p>
61+
62+
63+
<table class="table">
64+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
65+
<tbody>
66+
67+
<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr>
68+
<tr><td><code>kind</code><br/>string</td><td><code>MetricValue</code></td></tr>
69+
70+
71+
<tr><td><code>describedObject</code> <B>[Required]</B><br/>
72+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#objectreference-v1-core"><code>core/v1.ObjectReference</code></a>
73+
</td>
74+
<td>
75+
<p>a reference to the described object</p>
76+
</td>
77+
</tr>
78+
<tr><td><code>metric</code> <B>[Required]</B><br/>
79+
<a href="#custom-metrics-k8s-io-v1beta2-MetricIdentifier"><code>MetricIdentifier</code></a>
80+
</td>
81+
<td>
82+
<span class="text-muted">No description provided.</span></td>
83+
</tr>
84+
<tr><td><code>timestamp</code> <B>[Required]</B><br/>
85+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#time-v1-meta"><code>meta/v1.Time</code></a>
86+
</td>
87+
<td>
88+
<p>indicates the time at which the metrics were produced</p>
89+
</td>
90+
</tr>
91+
<tr><td><code>windowSeconds</code> <B>[Required]</B><br/>
92+
<code>int64</code>
93+
</td>
94+
<td>
95+
<p>indicates the window ([Timestamp-Window, Timestamp]) from
96+
which these metrics were calculated, when returning rate
97+
metrics calculated from cumulative metrics (or zero for
98+
non-calculated instantaneous metrics).</p>
99+
</td>
100+
</tr>
101+
<tr><td><code>value</code> <B>[Required]</B><br/>
102+
<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity"><code>k8s.io/apimachinery/pkg/api/resource.Quantity</code></a>
103+
</td>
104+
<td>
105+
<p>the value of the metric for this</p>
106+
</td>
107+
</tr>
108+
</tbody>
109+
</table>
110+
111+
## `MetricValueList` {#custom-metrics-k8s-io-v1beta2-MetricValueList}
112+
113+
114+
115+
<p>MetricValueList is a list of values for a given metric for some set of objects</p>
116+
117+
118+
<table class="table">
119+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
120+
<tbody>
121+
122+
<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr>
123+
<tr><td><code>kind</code><br/>string</td><td><code>MetricValueList</code></td></tr>
124+
125+
126+
<tr><td><code>metadata</code> <B>[Required]</B><br/>
127+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#listmeta-v1-meta"><code>meta/v1.ListMeta</code></a>
128+
</td>
129+
<td>
130+
<span class="text-muted">No description provided.</span></td>
131+
</tr>
132+
<tr><td><code>items</code> <B>[Required]</B><br/>
133+
<a href="#custom-metrics-k8s-io-v1beta2-MetricValue"><code>[]MetricValue</code></a>
134+
</td>
135+
<td>
136+
<p>the value of the metric across the described objects</p>
137+
</td>
138+
</tr>
139+
</tbody>
140+
</table>
141+
142+
## `MetricIdentifier` {#custom-metrics-k8s-io-v1beta2-MetricIdentifier}
143+
144+
145+
**Appears in:**
146+
147+
- [MetricValue](#custom-metrics-k8s-io-v1beta2-MetricValue)
148+
149+
150+
<p>MetricIdentifier identifies a metric by name and, optionally, selector</p>
151+
152+
153+
<table class="table">
154+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
155+
<tbody>
156+
157+
158+
<tr><td><code>name</code> <B>[Required]</B><br/>
159+
<code>string</code>
160+
</td>
161+
<td>
162+
<p>name is the name of the given metric</p>
163+
</td>
164+
</tr>
165+
<tr><td><code>selector</code><br/>
166+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#labelselector-v1-meta"><code>meta/v1.LabelSelector</code></a>
167+
</td>
168+
<td>
169+
<p>selector represents the label selector that could be used to select
170+
this metric, and will generally just be the selector passed in to
171+
the query used to fetch this metric.
172+
When left blank, only the metric's Name will be used to gather metrics.</p>
173+
</td>
174+
</tr>
175+
</tbody>
176+
</table>
177+
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Kubernetes External Metrics (v1beta1)
3+
content_type: tool-reference
4+
package: external.metrics.k8s.io/v1beta1
5+
auto_generated: true
6+
---
7+
<p>Package v1beta1 is the v1beta1 version of the external metrics API.</p>
8+
9+
10+
## Resource Types
11+
12+
13+
- [ExternalMetricValue](#external-metrics-k8s-io-v1beta1-ExternalMetricValue)
14+
- [ExternalMetricValueList](#external-metrics-k8s-io-v1beta1-ExternalMetricValueList)
15+
16+
17+
18+
## `ExternalMetricValue` {#external-metrics-k8s-io-v1beta1-ExternalMetricValue}
19+
20+
21+
**Appears in:**
22+
23+
- [ExternalMetricValueList](#external-metrics-k8s-io-v1beta1-ExternalMetricValueList)
24+
25+
26+
<p>ExternalMetricValue is a metric value for external metric
27+
A single metric value is identified by metric name and a set of string labels.
28+
For one metric there can be multiple values with different sets of labels.</p>
29+
30+
31+
<table class="table">
32+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
33+
<tbody>
34+
35+
<tr><td><code>apiVersion</code><br/>string</td><td><code>external.metrics.k8s.io/v1beta1</code></td></tr>
36+
<tr><td><code>kind</code><br/>string</td><td><code>ExternalMetricValue</code></td></tr>
37+
38+
39+
<tr><td><code>metricName</code> <B>[Required]</B><br/>
40+
<code>string</code>
41+
</td>
42+
<td>
43+
<p>the name of the metric</p>
44+
</td>
45+
</tr>
46+
<tr><td><code>metricLabels</code> <B>[Required]</B><br/>
47+
<code>map[string]string</code>
48+
</td>
49+
<td>
50+
<p>a set of labels that identify a single time series for the metric</p>
51+
</td>
52+
</tr>
53+
<tr><td><code>timestamp</code> <B>[Required]</B><br/>
54+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#time-v1-meta"><code>meta/v1.Time</code></a>
55+
</td>
56+
<td>
57+
<p>indicates the time at which the metrics were produced</p>
58+
</td>
59+
</tr>
60+
<tr><td><code>window</code> <B>[Required]</B><br/>
61+
<code>int64</code>
62+
</td>
63+
<td>
64+
<p>indicates the window ([Timestamp-Window, Timestamp]) from
65+
which these metrics were calculated, when returning rate
66+
metrics calculated from cumulative metrics (or zero for
67+
non-calculated instantaneous metrics).</p>
68+
</td>
69+
</tr>
70+
<tr><td><code>value</code> <B>[Required]</B><br/>
71+
<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity"><code>k8s.io/apimachinery/pkg/api/resource.Quantity</code></a>
72+
</td>
73+
<td>
74+
<p>the value of the metric</p>
75+
</td>
76+
</tr>
77+
</tbody>
78+
</table>
79+
80+
## `ExternalMetricValueList` {#external-metrics-k8s-io-v1beta1-ExternalMetricValueList}
81+
82+
83+
84+
<p>ExternalMetricValueList is a list of values for a given metric for some set labels</p>
85+
86+
87+
<table class="table">
88+
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
89+
<tbody>
90+
91+
<tr><td><code>apiVersion</code><br/>string</td><td><code>external.metrics.k8s.io/v1beta1</code></td></tr>
92+
<tr><td><code>kind</code><br/>string</td><td><code>ExternalMetricValueList</code></td></tr>
93+
94+
95+
<tr><td><code>metadata</code> <B>[Required]</B><br/>
96+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#listmeta-v1-meta"><code>meta/v1.ListMeta</code></a>
97+
</td>
98+
<td>
99+
<span class="text-muted">No description provided.</span></td>
100+
</tr>
101+
<tr><td><code>items</code> <B>[Required]</B><br/>
102+
<a href="#external-metrics-k8s-io-v1beta1-ExternalMetricValue"><code>[]ExternalMetricValue</code></a>
103+
</td>
104+
<td>
105+
<p>value of the metric matching a given set of labels</p>
106+
</td>
107+
</tr>
108+
</tbody>
109+
</table>
110+

0 commit comments

Comments
 (0)