Commit Graph

33 Commits

Author SHA1 Message Date
Richa Banker
452343367c Enable ComponentSLIs as beta feature 2023-01-26 17:46:21 -08:00
Richa Banker
eb55e2b980 Add e2e test for checking /metrics/slis endpoint for API server 2023-01-26 17:46:21 -08:00
Patrick Ohly
2f6c4f5eab e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
2022-12-16 20:14:04 +01:00
Kenichi Omichi
c6ba451235 Fix err of GrabFromAPIServer()
If getting an error from internal funcation call, GrabFromAPIServer()
didn't return it to the caller.
This fixes it.
2021-09-02 21:31:04 +00:00
Antonio Ojea
34f4959633 replace e2e WaitForPodsReady by WaitTimeoutForPodReadyInNamespace 2021-08-01 19:24:52 +02:00
Mauricio Poppe
9103b7187c Fetch metrics from controller manager & scheduler no run once 2021-07-21 17:16:42 +00:00
Patrick Ohly
a4c7e91b59 e2e metrics: skip tests when metrics grabbing is disabled
The MetricsGrabber checked whether a component supported metrics
grabbing, but then tests didn't have an API to use the result of that
check. Because metrics grabbing is an optional debug feature, tests
must skip checks that depend on metrics data or, when the entire
test is about metrics data, skip the test.

This is now supported with a special error that gets wrapped and
returned by the individual Grab functions.
2021-06-16 12:02:41 +02:00
Patrick Ohly
1d3420ca72 e2e metrics: check whether debug handlers are available
This can be checked by trying to retrieve log output. As in the case
of no pod found, a warning gets emitted when log retrieval fails and
metrics grabbing gets disabled.

Logging is checked instead of actual metrics retrieval because the
latter is more complex and thus more likely to fail for other reasons.
2021-06-16 12:02:41 +02:00
Patrick Ohly
5e9076da93 e2e: grab controller and scheduler metrics via port forwarding
The previous approach with grabbing via a nginx proxy had some
drawbacks:
- it did not work when the pods only listened on localhost (as
  configured by kubeadm) and the proxy got deployed on a different
  node
- starting the proxy raced with starting the pods, causing
  sporadic test failures because the proxy was not set up
  properly unless it saw all pods when starting the e2e.test
- the proxy was always started, whether it is needed or not
- the proxy was left running after a test and then the next
  test run triggered potentially confusing messages when
  it failed to create objects for the proxy

The new approach is similar to "kubectl port-forward" + "kubectl get
--raw". It uses the port forwarding feature to establish a TCP
connection via a custom dialer, then lets client-go handle TLS and
credentials.

Somehow verifying the server certificate did not work. As this
shouldn't be a big concern for E2E testing, certificate checking gets
disabled on the client side instead of investigating this further.
2021-06-16 12:02:40 +02:00
Grant Griffiths
564e531aa7 Add Snapshot Controller e2e metric tests
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-05-20 23:29:23 -07:00
pacoxu
c496b1d335 e2e: waiting for scheduler pod to expose metrics once
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-05-13 16:54:35 +08:00
Jian Zeng
c4c2574778
refactor(e2e): grab metrics from controller-manager via nginx
Signed-off-by: Jian Zeng <zengjian.zj@bytedance.com>
2021-05-03 00:12:06 +08:00
Kenichi Omichi
176c8e219f Avoid DeprecatedMightBeMasterNode() in e2e metrics
As its name, DeprecatedMightBeMasterNode is deprecated.
In e2e metrics, the function was used for knowing master node name to
get metrics from kube-scheduler and kube-controller-manager pods.
This make e2e metrics get these metrics directly by getting those pod
names without calling DeprecatedMightBeMasterNode().
2020-06-25 23:08:24 +00:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Andrew Sy Kim
f0f6c6fc81 e2e/framework: remove imports to pkg/master/ports
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-03-17 17:42:43 -04:00
Antonio Ojea
2a095f434b e2e wait until controller manager pod ready 2020-03-14 12:17:25 +01:00
Antonio Ojea
334d46eed5
fix logging on e2e metrics grabber test 2020-03-13 09:48:39 +01:00
Antonio Ojea
4361f8f052 wait until /metrics are ready on e2e test
Some e2e tests depend on the controller-manager to expose metrics
on the path /metrics.

It may happen that when the test runs, the pod is not available or the
URL not ready, causing it to fail.

Previously, the test were waiting until the pod was running, but we
need to wait until the /metrics URL is ready.
2020-03-11 14:32:03 +01:00
Kubernetes Prow Robot
a35f54e3e8
Merge pull request #88982 from aojea/flakyvolumes
e2e: wait for controller manager pod to be ready
2020-03-10 03:29:36 -07:00
Kubernetes Prow Robot
b1c1187cca e2e: wait for controller manager pod to be ready
The MetricsGrabber may use the controller-manager pod
to gather metrics, however, it doesn't wait until
it is ready to serve, failing the test if this is the
case.

We wait until the controller-manager pod is running
before trying to get metrics from it.
2020-03-09 22:04:16 +01:00
andrewsykim
674e539fca test/e2e/framework: remove dependencies to internal APIs
Signed-off-by: andrewsykim <kim.andrewsy@gmail.com>
2020-03-02 16:09:15 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
Clayton Coleman
a49a554211
Move the IsMasterNode function to tests and mark it Deprecated
A future change will stop using this signal and instead use a
label selector passed on creation.
2019-08-28 11:17:27 -04:00
Kenichi Omichi
89f6f1d0cc Fix golint failures under e2e/framework/metrics 2019-02-13 18:07:16 +00:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
tanshanshan
cb95edafe8 kube-scheduler: enable secure ports 10259 2018-11-08 16:43:59 +01:00
stewart-yu
0cbe0a6034 controller-manager: switch to config/option struct pattern 2018-02-13 11:16:17 +01:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Kevin
4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Hemant Kumar
381e334d87 Fix volume metric flake
Make sure we only run this test in environments
that support it.
2017-09-22 16:30:11 -04:00
Aleksandra Malinowska
55682f2a55 add grabbing CA metrics in e2e tests 2017-08-10 11:22:45 +02:00
Mik Vyatskov
e79a228a78 Move the sig-instrumentation test to a dedicated folder 2017-08-07 10:33:03 +02:00