-
Notifications
You must be signed in to change notification settings - Fork 1.2k
⚠ Introduce Metrics Options struct & secure metrics serving #2407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@alvaroaleman @vincepri After that I'll add more documentation and add / fix unit tests. |
96e77c5
to
0d05be8
Compare
1504d8f
to
66ae79b
Compare
@alvaroaleman Thx for the review. Changed the defaulting behavior and added test coverage |
@vincepri PTAL when you have some time :) |
Refactored the implementation to avoid introducing a dependency to k8s.io/apiserver for folks who are not using the authentication/authorization |
ef6074c
to
f764e41
Compare
4b2e71f
to
4aa927f
Compare
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package.
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633).
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Bumped aws-load-balancer-controller to f39ae43121c3 to use latest CRD scheme in e2e tests. - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633).
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Bumped aws-load-balancer-controller to f39ae43121c3 to use latest CRD scheme in e2e tests. - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633). - Migrated infrastructure CRD retrieval to the new package `zz_generated.crd-manifests`: - Updated infrastructure CRD for unit tests using `make update-vendored-crds` command.
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Bumped aws-load-balancer-controller to f39ae43121c3 to use latest CRD scheme in e2e tests. - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633). - Migrated infrastructure CRD retrieval to the new package `zz_generated.crd-manifests`: - Updated infrastructure CRD for unit tests using `make update-vendored-crds` command.
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Bumped aws-load-balancer-controller to f39ae43121c3 to use latest CRD scheme in e2e tests. - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633). - Migrated infrastructure CRD retrieval to the new package `zz_generated.crd-manifests`: - Updated infrastructure CRD for unit tests using `make update-vendored-crds` command. - Updated envtest setup to use the downstream index. - Infrastructure CRD uses CEL functions backported from newer k8s API. - Upstream `envtest` is not ready to use newer CEL function. - Bumped `setup-envtest` to be able to use `--index` flag.
- Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Bumped aws-load-balancer-controller to f39ae43121c3 to use latest CRD scheme in e2e tests. - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633). - Migrated infrastructure CRD retrieval to the new package `zz_generated.crd-manifests`: - Updated infrastructure CRD for unit tests using `make update-vendored-crds` command. - Updated envtest setup to use the downstream index. - Infrastructure CRD uses CEL functions backported from newer k8s API. - Upstream `envtest` is not ready to use newer CEL function. - Bumped `setup-envtest` to be able to use `--index` flag.
#143) - Bumped golang to 1.22: - Update go.mod - Update Dockerfiles - Bumped k8s.io/* modules to 0.30.3 and OpenShift API to 20240812094746-86145edb40cf. - Bumped controller-runtime to 0.18.5: - Manager's `Port` option removed, now using dedicated webhook server field (kubernetes-sigs/controller-runtime#2422). - Manager's `MetricsBindAddress` option removed, now using dedicated metrics server field (kubernetes-sigs/controller-runtime#2407). - Cache's `Namespaces` option replaced by `DefaultNamespaces` (kubernetes-sigs/controller-runtime#2421). - Bumped aws-load-balancer-controller to f39ae43121c3 to use latest CRD scheme in e2e tests. - Regenerated CRD and bundle manifests using `make bundle` command. - Bumped `kustomize` to v5 to fix a conflict caused by k8s.io bumps: - `kyaml` unable to use the bumped `github.com/google/gnostic-models/openapiv2` package. - Removed `TypeMeta` from expected deployment object when it's compared to structured one retrieved from fake client (kubernetes-sigs/controller-runtime#2633). - Migrated infrastructure CRD retrieval to the new package `zz_generated.crd-manifests`: - Updated infrastructure CRD for unit tests using `make update-vendored-crds` command. - Updated envtest setup to use the downstream index. - Infrastructure CRD uses CEL functions backported from newer k8s API. - Upstream `envtest` is not ready to use newer CEL function. - Bumped `setup-envtest` to be able to use `--index` flag.
As part of an effort to standardize metric exposure across KubeVirt components on port 8443, we are transitioning to HTTPS with TLS encryption for the metrics-server. To facilitate this, we leverage the controller-runtime's SecureServing option, which creates a self-signed certificate and configures it as the server certificate for the metrics endpoint when no external certificate is provided[1]. Subsequent PRs will replace this self-signed certificate with a CDI generated one to enable a fully trusted and secure connection between the Prometheus instance and the target metrics endpoints as specified by the CDI ServiceMonitor. Until that integration is complete, the ServiceMonitor will be configured with insecureSkipVerify to allow scraping despite the untrusted certificate. [1] kubernetes-sigs/controller-runtime#2407 Signed-off-by: Adi Aloni <aaloni@redhat.com>
As part of an effort to standardize metric exposure across KubeVirt components on port 8443, we are transitioning to HTTPS with TLS encryption for the metrics-server. To facilitate this, we leverage the controller-runtime's SecureServing option, which creates a self-signed certificate and configures it as the server certificate for the metrics endpoint when no external certificate is provided[1]. Subsequent PRs will replace this self-signed certificate with a CDI generated one to enable a fully trusted and secure connection between the Prometheus instance and the target metrics endpoints as specified by the CDI ServiceMonitor. Until that integration is complete, the ServiceMonitor will be configured with insecureSkipVerify to allow scraping despite the untrusted certificate. [1] kubernetes-sigs/controller-runtime#2407 Signed-off-by: Adi Aloni <aaloni@redhat.com>
As part of an effort to standardize metric exposure across KubeVirt components on port 8443, we are transitioning to HTTPS with TLS encryption for the metrics-server. To facilitate this, we leverage the controller-runtime's SecureServing option, which creates a self-signed certificate and configures it as the server certificate for the metrics endpoint when no external certificate is provided[1]. Subsequent PRs will replace this self-signed certificate with a CDI generated one to enable a fully trusted and secure connection between the Prometheus instance and the target metrics endpoints as specified by the CDI ServiceMonitor. Until that integration is complete, the ServiceMonitor will be configured with insecureSkipVerify to allow scraping despite the untrusted certificate. [1] kubernetes-sigs/controller-runtime#2407 Signed-off-by: Adi Aloni <aaloni@redhat.com>
As part of an effort to standardize metric exposure across KubeVirt components on port 8443, we are transitioning to HTTPS with TLS encryption for the metrics-server. To facilitate this, we leverage the controller-runtime's SecureServing option, which creates a self-signed certificate and configures it as the server certificate for the metrics endpoint when no external certificate is provided[1]. Subsequent PRs will replace this self-signed certificate with a CDI generated one to enable a fully trusted and secure connection between the Prometheus instance and the target metrics endpoints as specified by the CDI ServiceMonitor. Until that integration is complete, the ServiceMonitor will be configured with insecureSkipVerify to allow scraping despite the untrusted certificate. [1] kubernetes-sigs/controller-runtime#2407 Signed-off-by: Adi Aloni <aaloni@redhat.com>
As part of an effort to standardize metric exposure across KubeVirt components on port 8443, we are transitioning to HTTPS with TLS encryption for the metrics-server. To facilitate this, we leverage the controller-runtime's SecureServing option, which creates a self-signed certificate and configures it as the server certificate for the metrics endpoint when no external certificate is provided[1]. Subsequent PRs will replace this self-signed certificate with a CDI generated one to enable a fully trusted and secure connection between the Prometheus instance and the target metrics endpoints as specified by the CDI ServiceMonitor. Until that integration is complete, the ServiceMonitor will be configured with insecureSkipVerify to allow scraping despite the untrusted certificate. [1] kubernetes-sigs/controller-runtime#2407 Signed-off-by: Adi Aloni <aaloni@redhat.com> Co-authored-by: Adi Aloni <aaloni@redhat.com>
This PR introduces metrics options on the manager options. Via the new metrics options it will now be possible to serve metrics via tls and to use authentication and authorization.
Fixes #2073