-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply review comments. Add debug support (#7)
* Apply review comments. Add debug support * Apply review comments * Metrics client: cap input stream length * Development README cosmetics Co-authored-by: Ismail Alidzhikov <[email protected]> * README cosmetics Co-authored-by: Ismail Alidzhikov <[email protected]> * Makefile - remove TODO * Bump pipeline_definitions to golang:1.22.1 * Drop inactive configuration from skaffold.yaml --------- Co-authored-by: Ismail Alidzhikov <[email protected]>
- Loading branch information
1 parent
4b9dafe
commit ea8d8a9
Showing
32 changed files
with
241 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
############# builder | ||
FROM golang:1.19.9 AS builder | ||
FROM golang:1.22.1 AS builder | ||
|
||
WORKDIR /go/src/github.com/gardener/gardener-custom-metrics | ||
COPY . . | ||
RUN make install | ||
# RUN CGO_ENABLED=0 GO111MODULE=on GOFLAGS=-mod=vendor go build -a -o gardener-custom-metrics.exe cmd/main.go | ||
|
||
############# base image # TODO: Andrey: P1: Move to distroless | ||
FROM alpine:3.18.0 AS base | ||
FROM alpine:3.18.6 AS base | ||
|
||
############# gardener-custom-metrics | ||
FROM base AS gardener-custom-metrics | ||
WORKDIR / | ||
|
||
COPY --from=builder /go/bin/gardener-custom-metrics /gardener-custom-metrics.exe | ||
# COPY --from=builder /go/src/github.com/gardener/gardener-custom-metrics/gardener-custom-metrics.exe . | ||
ENTRYPOINT ["/gardener-custom-metrics.exe"] | ||
COPY --from=builder /go/bin/gardener-custom-metrics /gardener-custom-metrics | ||
ENTRYPOINT ["/gardener-custom-metrics"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
pkg directory: | ||
``` | ||
├── input - Takes care of source data: tracks seed's k8s contents, scrapes ShootKapis | ||
│ ├── controller | ||
│ │ ├── ... | ||
│ │ ├── pod | ||
│ │ │ └── ... | ||
│ │ └── secret | ||
│ │ └── ... | ||
│ ├── input_data_registry - Repository for the metrics source data | ||
│ │ └── input_data_registry.go | ||
│ └── input_data_service.go - Primary responsible for providing input data | ||
└── metrics_provider_service - Serves k8s metrics via HTTP | ||
├── metrics_provider.go - Implements the provider interface required by the metrics server library | ||
└── metrics_provider_service.go - Primary responsible for serving K8s metrics | ||
``` | ||
# gardener-custom-metrics | ||
|
||
[![REUSE status](https://api.reuse.software/badge/github.com/gardener/gardener-custom-metrics)](https://api.reuse.software/info/github.com/gardener/gardener-custom-metrics) | ||
|
||
## Overview | ||
|
||
The `gardener-custom-metrics` component operates as a K8s API service, adding functionality to the seed kube-apiserver. It periodically scrapes the metrics endpoints of all shoot kube-apiserver pods on the seed. It implements the K8s custom metrics API and provides K8s metrics specific to Gardener, based on custom calculations. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.10.7-dev | ||
v0.1.0-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
> 🚧 Note: This is a WIP document. | ||
### Debugging gardener-custom-metrics | ||
|
||
1. Make sure that you have a running local Gardener setup. The steps to complete this can be found in the [Deploying Gardener Locally guide](https://github.com/gardener/gardener/blob/master/docs/deployment/getting_started_locally.md). | ||
|
||
1. In a new terminal, navigate to the gardener-custom-metrics project root. | ||
|
||
1. Make sure that your `KUBECONFIG` environment variable is targeting the local Gardener cluster. | ||
|
||
1. Run `make debug`. | ||
|
||
This is a blocking call. It builds and deploys a debug-instrumented pod to the cluster. It forwards the pod's log output to the console window. It forwards `localhost:56268` to the debugger port for the pod. | ||
|
||
1. Attach debugger to `localhost:56268`. | ||
|
||
At this point, if you place a breakpoint somewhere, it should be hit. | ||
|
||
### Building and publishing gardener-custom-metrics container image: | ||
|
||
1. In a new terminal, navigate to the gardener-custom-metrics project root. | ||
|
||
1. Run `make docker-build` to build container image. | ||
|
||
1. Run `make docker-login` to authenticate against Artifact Registry before pushing the image. | ||
|
||
1. Run `make docker-push` to push the container image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.