Skip to content

Commit

Permalink
docs: update metrics port info (aws#6681)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschalo authored Aug 7, 2024
1 parent 903b72b commit 667d264
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/karpenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cosign verify public.ecr.aws/karpenter/karpenter:0.37.0 \
| controller.image.digest | string | `"sha256:157f478f5db1fe999f5e2d27badcc742bf51cc470508b3cebe78224d0947674f"` | SHA256 digest of the controller image. |
| controller.image.repository | string | `"public.ecr.aws/karpenter/controller"` | Repository path to the controller image. |
| controller.image.tag | string | `"0.37.0"` | Tag of the controller image. |
| controller.metrics.port | int | `8000` | The container port to use for metrics. |
| controller.metrics.port | int | `8080` | The container port to use for metrics. |
| controller.resources | object | `{}` | Resources for the controller pod. |
| controller.sidecarContainer | list | `[]` | Additional sidecarContainer config |
| controller.sidecarVolumeMounts | list | `[]` | Additional volumeMounts for the sidecar - this will be added to the volume mounts on top of extraVolumeMounts |
Expand Down
5 changes: 3 additions & 2 deletions hack/docs/metrics_gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ import (
"go/ast"
"go/parser"
"go/token"
"golang.org/x/exp/slices"
"io/fs"
"log"
"os"
"path/filepath"
"sort"
"strings"

"golang.org/x/exp/slices"

"github.com/samber/lo"

"sigs.k8s.io/karpenter/pkg/metrics"
Expand Down Expand Up @@ -110,7 +111,7 @@ description: >
`)
fmt.Fprintf(f, "<!-- this document is generated from hack/docs/metrics_gen_docs.go -->\n")
fmt.Fprintf(f, "Karpenter makes several metrics available in Prometheus format to allow monitoring cluster provisioning status. "+
"These metrics are available by default at `karpenter.karpenter.svc.cluster.local:8000/metrics` configurable via the `METRICS_PORT` environment variable documented [here](../settings)\n")
"These metrics are available by default at `karpenter.karpenter.svc.cluster.local:8080/metrics` configurable via the `METRICS_PORT` environment variable documented [here](../settings)\n")
previousSubsystem := ""

for _, metric := range allMetrics {
Expand Down
10 changes: 5 additions & 5 deletions website/content/en/docs/contributing/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ By default, `make apply` will set the log level to debug. You can change the log
OSX:

```bash
open http://localhost:8000/metrics && kubectl port-forward service/karpenter -n karpenter 8000
open http://localhost:8080/metrics && kubectl port-forward service/karpenter -n kube-system 8080
```

Linux:

```bash
gio open http://localhost:8000/metrics && kubectl port-forward service/karpenter -n karpenter 8000
gio open http://localhost:8080/metrics && kubectl port-forward service/karpenter -n karpenter 8080
```

### Tailing Logs
Expand Down Expand Up @@ -143,8 +143,8 @@ go install github.com/google/pprof@latest
### Get a profile
```
# Connect to the metrics endpoint
kubectl port-forward service/karpenter -n karpenter 8000
open http://localhost:8000/debug/pprof/
kubectl port-forward service/karpenter -n karpenter 8080
open http://localhost:8080/debug/pprof/
# Visualize the memory
go tool pprof -http 0.0.0.0:9000 localhost:8000/debug/pprof/heap
go tool pprof -http 0.0.0.0:9000 localhost:8080/debug/pprof/heap
```
2 changes: 1 addition & 1 deletion website/content/en/docs/reference/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >
Inspect Karpenter Metrics
---
<!-- this document is generated from hack/docs/metrics_gen_docs.go -->
Karpenter makes several metrics available in Prometheus format to allow monitoring cluster provisioning status. These metrics are available by default at `karpenter.karpenter.svc.cluster.local:8000/metrics` configurable via the `METRICS_PORT` environment variable documented [here](../settings)
Karpenter makes several metrics available in Prometheus format to allow monitoring cluster provisioning status. These metrics are available by default at `karpenter.karpenter.svc.cluster.local:8080/metrics` configurable via the `METRICS_PORT` environment variable documented [here](../settings)
### `karpenter_build_info`
A metric with a constant '1' value labeled by version from which karpenter was built.

Expand Down
2 changes: 1 addition & 1 deletion website/content/en/docs/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Karpenter surfaces environment variables and CLI parameters to allow you to conf
| LEADER_ELECT | \-\-leader-elect | Start leader election client and gain leadership before executing the main loop. Enable this when running replicated components for high availability.|
| LOG_LEVEL | \-\-log-level | Log verbosity level. Can be one of 'debug', 'info', or 'error' (default = info)|
| MEMORY_LIMIT | \-\-memory-limit | Memory limit on the container running the controller. The GC soft memory limit is set to 90% of this value. (default = -1)|
| METRICS_PORT | \-\-metrics-port | The port the metric endpoint binds to for operating metrics about the controller itself (default = 8000)|
| METRICS_PORT | \-\-metrics-port | The port the metric endpoint binds to for operating metrics about the controller itself (default = 8080)|
| RESERVED_ENIS | \-\-reserved-enis | Reserved ENIs are not included in the calculations for max-pods or kube-reserved. This is most often used in the VPC CNI custom networking setup https://docs.aws.amazon.com/eks/latest/userguide/cni-custom-network.html. (default = 0)|
| VM_MEMORY_OVERHEAD_PERCENT | \-\-vm-memory-overhead-percent | The VM memory overhead as a percent that will be subtracted from the total memory for all instance types. (default = 0.075)|
| WEBHOOK_METRICS_PORT | \-\-webhook-metrics-port | The port the webhook metric endpoing binds to for operating metrics about the webhook (default = 8001)|
Expand Down
10 changes: 5 additions & 5 deletions website/content/en/preview/contributing/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ By default, `make apply` will set the log level to debug. You can change the log
OSX:

```bash
open http://localhost:8000/metrics && kubectl port-forward service/karpenter -n karpenter 8000
open http://localhost:8080/metrics && kubectl port-forward service/karpenter -n kube-system 8080
```

Linux:

```bash
gio open http://localhost:8000/metrics && kubectl port-forward service/karpenter -n karpenter 8000
gio open http://localhost:8080/metrics && kubectl port-forward service/karpenter -n karpenter 8080
```

### Tailing Logs
Expand Down Expand Up @@ -143,8 +143,8 @@ go install github.com/google/pprof@latest
### Get a profile
```
# Connect to the metrics endpoint
kubectl port-forward service/karpenter -n karpenter 8000
open http://localhost:8000/debug/pprof/
kubectl port-forward service/karpenter -n karpenter 8080
open http://localhost:8080/debug/pprof/
# Visualize the memory
go tool pprof -http 0.0.0.0:9000 localhost:8000/debug/pprof/heap
go tool pprof -http 0.0.0.0:9000 localhost:8080/debug/pprof/heap
```
2 changes: 1 addition & 1 deletion website/content/en/preview/reference/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >
Inspect Karpenter Metrics
---
<!-- this document is generated from hack/docs/metrics_gen_docs.go -->
Karpenter makes several metrics available in Prometheus format to allow monitoring cluster provisioning status. These metrics are available by default at `karpenter.karpenter.svc.cluster.local:8000/metrics` configurable via the `METRICS_PORT` environment variable documented [here](../settings)
Karpenter makes several metrics available in Prometheus format to allow monitoring cluster provisioning status. These metrics are available by default at `karpenter.karpenter.svc.cluster.local:8080/metrics` configurable via the `METRICS_PORT` environment variable documented [here](../settings)
### `karpenter_build_info`
A metric with a constant '1' value labeled by version from which karpenter was built.
- Stability Level: STABLE
Expand Down
2 changes: 1 addition & 1 deletion website/content/en/preview/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Karpenter surfaces environment variables and CLI parameters to allow you to conf
| LOG_OUTPUT_PATHS | \-\-log-output-paths | Optional comma separated paths for directing log output (default = stdout)|
| LOG_ERROR_OUTPUT_PATHS | \-\-log-error-output-paths | Optional comma separated paths for directing log error output (default = stderr)|
| MEMORY_LIMIT | \-\-memory-limit | Memory limit on the container running the controller. The GC soft memory limit is set to 90% of this value. (default = -1)|
| METRICS_PORT | \-\-metrics-port | The port the metric endpoint binds to for operating metrics about the controller itself (default = 8000)|
| METRICS_PORT | \-\-metrics-port | The port the metric endpoint binds to for operating metrics about the controller itself (default = 8080)|
| RESERVED_ENIS | \-\-reserved-enis | Reserved ENIs are not included in the calculations for max-pods or kube-reserved. This is most often used in the VPC CNI custom networking setup https://docs.aws.amazon.com/eks/latest/userguide/cni-custom-network.html. (default = 0)|
| VM_MEMORY_OVERHEAD_PERCENT | \-\-vm-memory-overhead-percent | The VM memory overhead as a percent that will be subtracted from the total memory for all instance types. (default = 0.075)|
| WEBHOOK_METRICS_PORT | \-\-webhook-metrics-port | The port the webhook metric endpoing binds to for operating metrics about the webhook (default = 8001)|
Expand Down

0 comments on commit 667d264

Please sign in to comment.