Skip to content

Commit

Permalink
chore: Cleaned up documentation and fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithEmad committed Sep 11, 2023
1 parent ffbdb6f commit c7a7509
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 140 deletions.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Report a bug encountered while operating Metrics Server

---

<!--
<!--
STOP -- PLEASE READ!
If you're looking for help, check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).
Expand All @@ -24,6 +24,7 @@ Not doing so may result in your bug not being addressed in a timely manner. Than
**Anything else we need to know?**:

**Environment**:

- Kubernetes distribution (GKE, EKS, Kubeadm, the hard way, etc.):
- Container Network Setup (flannel, calico, etc.):
- Kubernetes version (use `kubectl version`):
Expand Down Expand Up @@ -56,10 +57,11 @@ Not doing so may result in your bug not being addressed in a timely manner. Than
</details>

- Status of Metrics API:

<details>
<summary>spolier for Status of Metrics API:</summary>

```
```sh
kubectl describe apiservice v1beta1.metrics.k8s.io
```

Expand Down
21 changes: 12 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ If your repo has certain guidelines for contribution, put them here ahead of the

## Chart Changes

When contributing chart changes please follow the same process as when contributing other content but also please **DON'T** modify _Chart.yaml_ in the PR as this would result in a chart release when merged and will mean that your PR will need modifying before it can be accepted. The chart version will be updated as part of the PR to release the chart.
When contributing chart changes please follow the same process as when contributing other content but also please **DON'T** modify _Chart.yaml_ in the PR as this would result in a chart release when merged and will mean that your PR will need modifying before it can be accepted. The chart version will be updated as part of the PR to release the chart.

# Development
## Development

Required tools:
* [Docker](https://www.docker.com/)
* [Kind](https://kind.sigs.k8s.io/)
* [Skaffold](https://skaffold.dev/)

- [Docker](https://www.docker.com/)
- [Kind](https://kind.sigs.k8s.io/)
- [Skaffold](https://skaffold.dev/)

## Adding dependencies

The project follows a standard Go project layout, see more about [dependency-management](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#dependency-management).

## Running static code validation

```
```sh
make lint
```

## Running tests

```
```sh
make test-unit
make test-version
make test-e2e
Expand All @@ -52,12 +53,14 @@ make test-e2e
## Live reload

To start local development just run:
```

```sh
kind create cluster
skaffold dev
```

To execute e2e tests run:
```

```sh
go test test/e2e_test.go -v -count=1
```
45 changes: 23 additions & 22 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## FAQ
# FAQ

## Table of Contents

Expand All @@ -19,18 +19,18 @@
- [How often metrics are scraped?](#how-often-metrics-are-scraped)
<!-- /toc -->

#### What metrics are exposed by the metrics server?
### What metrics are exposed by the metrics server?

Metrics server collects resource usage metrics needed for autoscaling: CPU & Memory.
Metrics values use [Metric System prefixes] (`n` = 10<sup>-9</sup> and `Ki` = 2<sup>10</sup>),
Metrics values use [Metric System prefixes] (`n` = 10<sup>-9</sup> and `Ki` = 2<sup>10</sup>),
the same as those used to define pod requests and limits.
Metrics server itself is not responsible for calculating metric values, this is done by Kubelet.

[Metric System prefixes]: https://en.wikipedia.org/wiki/Metric_prefix

#### How CPU usage is calculated?
### How CPU usage is calculated?

CPU is reported as the average core usage measured in cpu units.
CPU is reported as the average core usage measured in cpu units.
One cpu, in Kubernetes, is equivalent to 1 vCPU/Core for cloud providers and 1 hyperthread on bare-metal Intel processors.

This value is derived by taking a rate over a cumulative CPU counter provided by the kernel (in both Linux and Windows kernels).
Expand All @@ -40,7 +40,7 @@ Read more about [Meaning of CPU].

[Meaning of CPU]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu

#### How memory usage is calculated?
### How memory usage is calculated?

Memory is reported as the working set at the instant the metric was collected, measured in bytes.

Expand All @@ -53,55 +53,56 @@ Read more about [Meaning of memory].

[Meaning of memory]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory

#### How does the metrics server calculate metrics?
### How does the metrics server calculate metrics?

Metrics Server itself doesn't calculate any metrics, it aggregates values exposed by Kubelet and exposes them in API
to be used for autoscaling. For any problem with metric values please contact SIG-Node.

#### How often is metrics server released?
### How often is metrics server released?

There is no hard release schedule. A release is done after an important feature is implemented or upon request.

#### Can I run two instances of metrics-server?
### Can I run two instances of metrics-server?

Yes, but it will not provide any benefits. Both instances will scrape all nodes to collect metrics, but only one instance will be actively serving metrics API.

#### How to run metrics-server securely?
### How to run metrics-server securely?

Suggested configuration:
* Cluster with [RBAC] enabled
* Kubelet [read-only port] port disabled
* Validate kubelet certificate by mounting CA file and providing `--kubelet-certificate-authority` flag to metrics server
* Avoid passing insecure flags to metrics server (`--deprecated-kubelet-completely-insecure`, `--kubelet-insecure-tls`)
* Consider using your own certificates (`--tls-cert-file`, `--tls-private-key-file`)

#### How to run metric-server on different architecture?
- Cluster with [RBAC] enabled
- Kubelet [read-only port] port disabled
- Validate kubelet certificate by mounting CA file and providing `--kubelet-certificate-authority` flag to metrics server
- Avoid passing insecure flags to metrics server (`--deprecated-kubelet-completely-insecure`, `--kubelet-insecure-tls`)
- Consider using your own certificates (`--tls-cert-file`, `--tls-private-key-file`)

### How to run metric-server on different architecture?

Starting from `v0.3.7` docker image `registry.k8s.io/metrics-server/metrics-server` should support multiple architectures via Manifests List.
List of supported architectures: `amd64`, `arm`, `arm64`, `ppc64le`, `s390x`.

#### What Kubernetes versions are supported?
### What Kubernetes versions are supported?

Metrics server is tested against the last 3 Kubernetes versions.

#### How is resource utilization calculated?
### How is resource utilization calculated?

Metrics server doesn't provide resource utilization metrics (e.g. percent of CPU used).
Utilization presented by `kubectl top` and HPA is calculated client side based on pod resource requests or node capacity.

#### How to autoscale Metrics Server?
### How to autoscale Metrics Server?

Metrics server scales linearly vertically according to the number of nodes and pods in a cluster. This can be automated using [addon-resizer].

#### Can I get other metrics beside CPU/Memory using Metrics Server?
### Can I get other metrics beside CPU/Memory using Metrics Server?

No, metrics server was designed to provide metrics for [resource metrics pipeline] used for autoscaling.

#### How large can clusters be?
### How large can clusters be?

Metrics Server was tested to run within clusters up to 5000 nodes with an average pod density of 30 pods per node.

#### How often metrics are scraped?
### How often metrics are scraped?

Default 60 seconds, can be changed using `metric-resolution` flag. We are not recommending setting values below 15s, as this is the resolution of metrics calculated by Kubelet.

Expand Down
Loading

0 comments on commit c7a7509

Please sign in to comment.