Commit Graph

178 Commits

Author SHA1 Message Date
RainbowMango
214228f024 Remove the derprecated API RawRegister from stability framework 2019-11-19 18:56:09 +08:00
RainbowMango
2e8dcf7809 Migrate custom collector and mark metrics with ALPHA. 2019-11-08 20:19:37 +08:00
wuyafang
78d24f59dd remove reference to promhttp in kubelet 2019-10-26 09:10:33 +08:00
David Eads
ff689ce3de set backup value to ensure connections against kubelets eventually close 2019-10-16 13:39:14 -04:00
Jordan Liggitt
92eb072989 Propagate context to Authorize() calls 2019-09-24 11:14:54 -04:00
Han Kang
3a50917795 migrate kubelet's metrics/probes & metrics endpoint to metrics stability framework 2019-08-28 11:16:38 -07:00
Tim Allclair
e06912ca3e Clean up deprecated references 2019-08-21 10:40:21 -07:00
Tim Allclair
3f510c69f6 Remove dead code from pkg/kubelet/... 2019-08-21 10:40:21 -07:00
Kubernetes Prow Robot
59d29b67d9
Merge pull request #59484 from verb/debug-kubelet-1
Add support for Ephemeral Containers to the kubelet
2019-08-21 00:29:17 -07:00
Lee Verberne
ea212d5d49 Add support for ephemeral containers to the kubelet 2019-07-24 16:24:26 +00:00
Elana Hashman
e0b66c792b
Drop "pod_name" and "container_name" metric labels
These labels were deprecated in 1.14 (#69099) and should no longer be
used in metric queries.
2019-07-19 10:08:21 -07:00
Dr. Stefan Schimanski
e848eaa566 apiserver: store httplog in context 2019-06-26 18:33:19 +02:00
Kubernetes Prow Robot
6602f61596
Merge pull request #79002 from jiayingz/add-cadvisor-metrics
Enable cadvisor ProcessMetrics collecting.
2019-06-15 08:53:04 -07:00
Jiaying Zhang
edcfdc4cbf Enable cadvisor ProcessMetrics collecting. 2019-06-13 16:21:24 -07:00
Kubernetes Prow Robot
6b6bdc760a
Merge pull request #78504 from dashpole/deprecate_cadvisor_json
Add kubelet flag to disable cadvisor json apis, and mark it deprecrated
2019-06-01 04:44:55 -07:00
David Ashpole
785d40923a add kubelet flag to disable cadvisor json apis, and mark it deprecrated 2019-05-30 10:39:45 -07:00
Han Kang
2d48b3e81e add process start time metric to metric probes since they use counters 2019-05-16 08:19:29 -07:00
Haiyan Meng
4751f40319
Remove the host label from the kubelet http traffic metrics
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-05-10 13:46:35 -07:00
Kubernetes Prow Robot
b7dc0124a0
Merge pull request #77379 from tedyu/http-stat-map
Use map to check whether stack trace is needed
2019-05-09 14:13:34 -07:00
Ted Yu
85fc089855 Use map to check whether stack trace is needed
Signed-off-by: Ted Yu <yute@vmware.com>
2019-05-08 14:31:50 -07:00
Ted Yu
fe6e50df3d Use map to check for long-running request
Signed-off-by: Ted Yu <yute@vmware.com>
2019-04-30 19:32:35 -07:00
Haiyan Meng
538cd87864
Add metrics to monitor the kubelet http server
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-04-11 14:16:57 -07:00
Kubernetes Prow Robot
535064773a
Merge pull request #73946 from dashpole/prometheus_core_metrics
Add kubelet resource metrics v1alpha1 endpoint
2019-03-07 22:43:28 -08:00
David Ashpole
6051664c0f add kubelet prometheus resource metrics endpoint 2019-03-07 15:39:37 -08:00
Kubernetes Prow Robot
272d78f1d9
Merge pull request #73966 from alculquicondor/fix/lint-kubelet-server
Fix lint on pkg/kubelet/server/...
2019-02-25 20:27:48 -08:00
Aldo Culquicondor
e61cd68bf3 Fix lint on pkg/kubelet/server/... 2019-02-21 10:31:41 -05:00
Elana Hashman
3539e89af2 Rename labels to match instrumentation guidelines
For the next release, we include both sets of labels for pods and
containers: "container_name" and "container", "pod_name" and "pod".
In future releases, the "*_name" metrics will be deprecated.
2019-01-28 12:36:20 -05:00
Marek Counts
ba81a5409a move logs into component-base
all the code changes to move move /apiserver/pkg/util/logs into /component-base/logs
2019-01-17 09:16:21 -05:00
David Ashpole
630cb53f82 add kubelet grpc server for pod-resources service 2018-11-15 09:43:20 -08: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
Mike Danese
e5227216c0 rebase authenticators onto new interface. 2018-10-22 10:16:59 -07:00
David Ashpole
788196e45b update cadvisor to v0.31.0 2018-09-10 10:31:56 -07:00
Kubernetes Submit Queue
cffa2aed0e
Merge pull request #64601 from hzxuzhonghu/cm-dynamic-loglevel-set
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Other components support set log level dynamically

**What this PR does / why we need it**:

#63777 introduced a way to set glog.logging.verbosity dynamically. 
We should enable this for all other components, which is specially useful in debugging. 


**Release note**:

```release-note
Expose `/debug/flags/v` to allow kubelet dynamically set glog logging level.  If want to change glog level to 3, you only have to send a PUT request like `curl -X PUT http://127.0.0.1:8080/debug/flags/v -d "3"`.
```
2018-08-15 21:32:46 -07:00
xuzhonghu
c867bf9cab kubelet support dynamically set glog log level --v 2018-08-15 17:18:25 +08:00
Yu-Ju Hong
390b158db9 kubelet: plumb context for log requests
This allows kubelets to stop the necessary work when the context has
been canceled (e.g., connection closed), and not leaking a goroutine
and inotify watcher waiting indefinitely.
2018-08-10 17:35:46 -07:00
Jordan Liggitt
b7b4b84afe
Add healthz check to ensure logging is not blocked 2018-07-03 22:27:23 -04:00
Lantao Liu
9677616eaf Address comments in #64006.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-06-01 17:25:56 -07:00
Lantao Liu
174b6d0e2f Proxy container streaming in kubelet. 2018-05-31 15:26:32 -07:00
Lantao Liu
7c17ee25ec Remove unused limit writer.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-05-25 16:55:08 -07:00
Derek Carr
a09990cd43 Apply pod name and namespace labels for pod cgroup for cadvisor metrics 2018-05-07 14:51:12 -04:00
Rohit Ramkumar
c0c5566c25 Expose kubelet health checks using new prometheus endpoint 2018-03-30 11:08:15 -07:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Mike Danese
12125455d8 move authorizers over to new interface 2017-11-03 13:46:28 -07:00
Chen Li
a4a6076924 Improve kubectl error messages
Fixes https://github.com/kubernetes/kubernetes/issues/34457
Part of work on https://github.com/kubernetes/kubernetes/issues/31267
2017-10-30 20:09:43 -05:00
Dr. Stefan Schimanski
7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Kubernetes Submit Queue
cc557e61cc Merge pull request #51473 from bboreham/cadvisor-consistent-labels
Automatic merge from submit-queue (batch tested with PRs 51471, 50561, 50435, 51473, 51436)

Fix inconsistent Prometheus cAdvisor metrics

**What this PR does / why we need it**:

We need this because otherwise kubelet is exposing different sets of Prometheus metrics that randomly include or do not include containers.

See also https://github.com/google/cadvisor/issues/1704; quoting here:

Prometheus requires that all metrics in the same family have the same labels, so we arrange to supply blank strings for missing labels

The function `containerPrometheusLabels()` conditionally adds various metric labels from container labels - pod name, image, etc. However, when it receives the metrics, Prometheus [checks](https://github.com/prometheus/client_golang/blob/master/prometheus/registry.go#L665) that all metrics in the same family have the same label set, and [rejects](https://github.com/prometheus/client_golang/blob/master/prometheus/registry.go#L497) those that do not.

Since containers are collected in (somewhat) random order, depending on which kind is seen first you get one set of metrics or the other.

Changing the container labels function to always add the same set of labels, adding `""` when it doesn't have a real value, eliminates the issue in my testing.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #50151

**Special notes for your reviewer**:

I have made the same fix in two places.  I am 98% sure the one in `cadvisor_linux.go` isn't used and indeed cannot be used, but have not gone fully down that rabbit-hole.

**Release note**:
```release-note
Fix inconsistent Prometheus cAdvisor metrics
```
2017-08-29 02:22:16 -07:00
Bryan Boreham
c193bbc7c2 Make Prometheus cAdvisor metrics labels consistent
Prometheus requires that all metrics in the same family have the same
labels, so we arrange to supply blank strings for missing labels

See https://github.com/google/cadvisor/issues/1704
2017-08-28 19:53:18 +00:00
Yang Guo
f9767d2f71 Change StatsProvider interface to provide container stats from either cadvisor or CRI and implement this interface using cadvisor 2017-08-25 13:11:26 -07:00
Clayton Coleman
d3be1ac92e
Update generic errors with the new http package codes
All of these errors are now part of the standard HTTP method. Formalize
those into our error types and remove duplication and unclear
separation.
2017-07-28 19:13:11 -04:00
Clayton Coleman
f5f9893824
Restore cAdvisor prometheus metrics to the main port
But under a new path - `/metrics/cadvisor`. This ensures a secure port
still exists for metrics while getting the benefit of separating out
container metrics from the kubelet's metrics.
2017-07-18 08:58:14 -04:00
Lee Verberne
786e993338 Fix typo in ExecCommandParam 2017-07-14 13:54:51 +00:00
Tim St. Clair
e9795e3742
Cleanup lint errors in the pkg/kubelet/server/... directory 2017-06-29 15:58:07 -07:00
Kubernetes Submit Queue
cf15b17319 Merge pull request #47484 from allencloud/fix-nit-in-kubelet-server
Automatic merge from submit-queue (batch tested with PRs 47484, 47904, 48034)

fix nits in kubelet server

Signed-off-by: allencloud <allen.sun@daocloud.io>

**What this PR does / why we need it**:
fix nits in kubelet server

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
NONE

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2017-06-26 22:21:57 -07:00
allencloud
25881fe30e fix nits in kubelet server
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-06-23 08:21:09 +08:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Jacob Simpson
4c22e6bc6a Certificate rotation for kubelet server certs.
Replaces the current kubelet server side self signed certs with certs
signed by the Certificate Request Signing API on the API server. Also
renews expiring kubelet server certs as expiration approaches.
2017-05-29 12:28:01 -07:00
Dmitry Shulyak
2612e0c78a Move client/unversioned/remotecommand to client-go
Module remotecommand originally part of kubernetes/pkg/client/unversioned was moved
to client-go/tools, and will be used as authoritative in kubectl, e2e and other places.

Module remotecommand relies on util/exec module which will be copied to client-go/pkg/util
2017-05-15 16:28:56 +03:00
Dmitry Shulyak
f50480c714 Decouple remotecommand client from term/kubelet dependencies
In order to move client/unversioned/remotecommand to client-go as a followup
for this change we have to decouple it from tons of dependencies
2017-04-13 15:56:40 +03:00
Andy Goldstein
b011529d8a Add pprof trace support
Add pprof trace support and --enable-contention-profiling to those
components that don't already have it.
2017-03-07 10:10:42 -05:00
Tim Hockin
98d693e9d2 Merge pull request #39837 from foxyriver/modify-comment
modify-comment
2017-02-21 16:33:47 -06:00
Alejandro Escobar
024d750370 making log statement clearer. 2017-02-15 19:49:52 -08:00
Alejandro Escobar
5d71eb4b05 added log message to capture that log handlers have been turned on. 2017-02-14 14:58:59 -08:00
Michael Fraenkel
93c11422e4 CRI Portforward needs to forward websocket ports
- adjust ports to int32
- CRI flows the websocket ports as query params

- Do not validate ports since the protocol is unknown
  SPDY flows the ports as headers and websockets uses query params
- Only flow query params if there is at least one port query param
2017-02-01 18:03:42 -07:00
Michael Fraenkel
beb53fb71a Port forward over websockets
- split out port forwarding into its own package

Allow multiple port forwarding ports
- Make it easy to determine which port is tied to which channel
- odd channels are for data
- even channels are for errors

- allow comma separated ports to specify multiple ports

Add  portfowardtester 1.2 to whitelist
2017-02-01 06:32:04 -07:00
Dr. Stefan Schimanski
3d9449a353 genericapiserver: fix imports 2017-01-19 13:06:47 +01:00
deads2k
77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Kubernetes Submit Queue
7dd815221c Merge pull request #39838 from foxyriver/add-break
Automatic merge from submit-queue

break from the for loop

**What this PR does / why we need it**:

exit loop, because the following actions will not affect the result

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-01-13 11:43:48 -08:00
Kubernetes Submit Queue
9a88687e24 Merge pull request #37865 from yujuhong/decouple_lifecycle
Automatic merge from submit-queue

kubelet: remove the pleg health check from healthz

This prevents kubelet from being killed when docker hangs.

Also, kubelet will report node not ready if PLEG hangs (`docker ps` + `docker inspect`).
2017-01-12 19:10:14 -08:00
foxyriver
b35dc8ecd7 break from the for loop 2017-01-13 09:34:31 +08:00
foxyriver
659c7df3c6 modify-comment 2017-01-13 09:27:23 +08:00
Kubernetes Submit Queue
4ac5f278c5 Merge pull request #38742 from timstclair/cri-exec-long
Automatic merge from submit-queue

[CRI] Don't include user data in CRI streaming redirect URLs

Fixes: https://github.com/kubernetes/kubernetes/issues/36187

Avoid userdata in the redirect URLs by caching the {Exec,Attach,PortForward}Requests with a unique token. When the redirect URL is created, the token is substituted for the request params. When the streaming server receives the token request, the token is used to fetch the actual request parameters out of the cache.

For additional security, the token is generated using the secure random function, is single use (i.e. the first request with the token consumes it), and has a short expiration time.

/cc @kubernetes/sig-node
2017-01-11 17:16:07 -08:00
Tim St. Clair
c17f3ee367
Don't include user data in CRI streaming redirect URLs 2017-01-11 13:40:43 -08:00
deads2k
c4fae4e690 mechanical repercussions 2017-01-11 15:20:36 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Yu-Ju Hong
03106dd1cb kubelet: remove the pleg health check from healthz/
If docker hangs, we don't want kubelet to get killed as well.
2017-01-10 16:32:46 -08:00
deads2k
4d7fcae85a mechanicals 2017-01-05 11:14:27 -05:00
Tim St. Clair
bc3ade7454
Refactor remotecommand options parsing 2016-12-13 16:09:23 -08:00
Clayton Coleman
3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman
5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Clayton Coleman
35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
Chao Xu
5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
Tim St. Clair
7badc1d226
Use indirect streaming path for dockershim & remote CRI runtime 2016-11-08 10:58:38 -08:00
Rodolfo Carvalho
506129ba4e Add timeout argument to ExecInContainer
This allows us to interrupt/kill the executed command if it exceeds the
timeout (not implemented by this commit).

Set timeout in Exec probes. HTTPGet and TCPSocket probes respect the
timeout, while Exec probes used to ignore it.

Add e2e test for exec probe with timeout. However, the test is skipped
while the default exec handler doesn't support timeouts.
2016-11-07 13:00:59 +01:00
Kubernetes Submit Queue
c04cab536b Merge pull request #36134 from liggitt/kubelet-auth-cleanup
Automatic merge from submit-queue

Cleanup auth logging, allow starting secured kubelet in local-up-cluster.sh

Cleanup for https://github.com/kubernetes/features/issues/89
2016-11-06 08:33:04 -08:00
Kubernetes Submit Queue
3cdf8bb1ef Merge pull request #36189 from euank/kubelet-nolog-redir
Automatic merge from submit-queue

kubelet: don't print httplogs for redirects

Goes with #36020, but can merge independently.

cc @timstclair
2016-11-04 14:06:18 -07:00
Euan Kemp
97336cd7cb kubelet: don't print httplogs for redirects
The new CRI exec implementation relies on this status code. Without this
change, kubelet logs a scary stacktrace during normal execution.
2016-11-03 14:19:34 -07:00
Tim St. Clair
86d849e374
Separate Direct and Indirect streaming paths, implement indirect path with CRI 2016-11-03 13:26:33 -07:00
Jordan Liggitt
d3991aa7c6
Cleanup auth logging, allow starting secured kubelet in local-up-cluster.sh 2016-11-03 16:17:11 -04:00
Random-Liu
8e376dc843 Add kuberuntime container logs support. 2016-10-26 17:37:09 -07:00
Kubernetes Submit Queue
a898f3d996 Merge pull request #34381 from liggitt/kubelet-auth
Automatic merge from submit-queue

kubelet authn/authz

Implements https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/kubelet-auth.md

Part of [Authenticated/Authorized access to kubelet API](https://github.com/kubernetes/features/issues/89) feature
2016-10-25 17:40:27 -07:00
Tim St. Clair
52ed57ec3b
Refactor PortForward server methods into the portforward package 2016-10-25 12:08:35 -07:00
Jordan Liggitt
a602ae77b8
Move kubelet api paths to constants 2016-10-25 03:40:08 -04:00
Avesh Agarwal
feaeb2a25c Do not log stack trace for the error http.StatusBadRequest (400). 2016-10-21 14:05:37 -04:00
Hai Huang
192825bc5e fix a typo 2016-09-16 09:42:29 -04:00
mbohlool
54fee8c253 Improvements on OpenAPI spec generation:
- Generating models using go2idl library (no reflection anymore)
- Remove dependencies on go-restful/swagger
- Generate one swagger.json file for each web-service
- Bugfix: fixed a bug in trie implementation
2016-09-12 18:47:03 -07:00
Michal Rostecki
fa0dd46ab7 Return (bool, error) in Authorizer.Authorize()
Before this change, Authorize() method was just returning an error,
regardless of whether the user is unauthorized or whether there
is some other unrelated error. Returning boolean with information
about user authorization and error (which should be unrelated to
the authorization) separately will make it easier to debug.

Fixes #27974
2016-07-18 12:06:54 +02:00
Andy Goldstein
3b21a9901b Support terminal resizing for exec/attach/run
Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions
inherit the environment from the primary process, so if the container was created with tty=false,
that means the exec session's TERM variable will default to "dumb". Users can override this by
setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior.
2016-07-13 17:06:16 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot
6224f44717 Merge pull request #25771 from sjpotter/fs-info
Automatic merge from submit-queue

kubelet/cadvisor: Refactor cadvisor disk stat/usage interfaces.

basically

1) cadvisor struct will know what runtime the kubelet is, passed in via additional argument to New()

2) rename cadvisor wrapper function to DockerImagesFsInfo() to ImagesFsInfo() and have linux implementation choose a label based on the runtime inside the cadvisor struct

2a) mock/fake/unsupported modified to take the same additional argument in New()

3) kubelet's wrapper for the cadvisor wrapper is renamed in parallel

4) make all tests use new interface
2016-05-22 03:08:59 -07:00