Commit Graph

272 Commits (6d7a9048b67d81e57923892650a23636f1afba42)

Author SHA1 Message Date
Ron Lai 2c71ce305a Include inode info in container summary 2016-07-11 15:53:55 -07:00
Ron Lai e5f8cd9973 Includes the number of free indoes in summary 2016-06-30 10:05:57 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot db4c943f6d Merge pull request #27800 from derekwaynecarr/fix_filename_typo
Automatic merge from submit-queue

Fix typo in filename

just a simple fix
2016-06-27 09:49:16 -07:00
derekwaynecarr 060e69ae92 Fix typo in filename 2016-06-21 16:56:07 -04:00
Euan Kemp c7a60fd99a kubelet: Remove stack alloc
Presumably this was accidental leftover debug info
2016-06-13 14:04:22 -07:00
k8s-merge-robot eed13d702f Merge pull request #26253 from xiangpengzhao/fix_assertnotnil
Automatic merge from submit-queue

Add assert.NotNil for test case

I hardcode the `DefaultInterfaceName` from `eth0` to `eth-k8sdefault` at release 1.2.0,  in order to test my CNI plugins. When running the test, it panics and prints wrongly formatted messages as below.

In the test case `TestBuildSummary`, `containerInfoV2ToNetworkStats` will return `nil` if `DefaultInterfaceName` is not `eth0`. So maybe we should add `assert.NotNil` to the test case.

```
ok      k8s.io/kubernetes/pkg/kubelet/server    0.591s
W0523 03:25:28.257074    2257 summary.go:311] Missing default interface "eth-k8sdefault" for s%!(EXTRA string=node:FooNode)
W0523 03:25:28.257322    2257 summary.go:311] Missing default interface "eth-k8sdefault" for s%!(EXTRA string=pod:test0_pod1)
W0523 03:25:28.257361    2257 summary.go:311] Missing default interface "eth-k8sdefault" for s%!(EXTRA string=pod:test0_pod0)
W0523 03:25:28.257419    2257 summary.go:311] Missing default interface "eth-k8sdefault" for s%!(EXTRA string=pod:test2_pod0)
--- FAIL: TestBuildSummary (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x471817]

goroutine 16 [running]:
testing.func·006()
        /usr/src/go/src/testing/testing.go:441 +0x181
k8s.io/kubernetes/pkg/kubelet/server/stats.checkNetworkStats(0xc20806d3b0, 0x140bbc0, 0x4, 0x0, 0x0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/server/stats/summary_test.go:296 +0xc07
k8s.io/kubernetes/pkg/kubelet/server/stats.TestBuildSummary(0xc20806d3b0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/server/stats/summary_test.go:124 +0x11d2
testing.tRunner(0xc20806d3b0, 0x1e43180)
        /usr/src/go/src/testing/testing.go:447 +0xbf
created by testing.RunTests
        /usr/src/go/src/testing/testing.go:555 +0xa8b
```
2016-05-29 14:13:00 -07:00
Alex Robinson 789b69758e Merge pull request #25688 from sjpotter/rkt_annotations
kubelet: Move common labels out of dockertools package
2016-05-27 11:26:31 -07:00
Shaya Potter 9dd9f2ad65 move common lables used outside of containr runtime out of dockertools
moved labels and their Get functions to types

aliases kubernetes/types import to kubetypes to use kubelet/types as types
2016-05-25 23:10:19 -07:00
Zach Loafman 3ec25c5425 routecontroller: Add wait.NonSlidingUntil, use it
Make sure the reconciliation loop kicks in again immediately if it
takes a loooooong time.
2016-05-25 13:58:35 -07:00
xiangpengzhao 3caebba6d8 Add assert.NotNil for test case 2016-05-24 10:04:36 -04:00
k8s-merge-robot f1e528eab6 Merge pull request #25933 from timstclair/subcontainers
Automatic merge from submit-queue

Handle cAdvisor partial failures

Kubernetes side of https://github.com/google/cadvisor/issues/1286

Partially fixes https://github.com/kubernetes/kubernetes/issues/25131

(Depends on cAdvisor Godeps bump https://github.com/kubernetes/kubernetes/pull/25914)

/cc @kubernetes/sig-node
2016-05-22 04:50:01 -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
Tim St. Clair b05b419c25 Handle cAdvisor partial failures 2016-05-19 19:29:31 -07:00
Shaya Potter ae08ef38d7 kubelet/cadvisor: Refactor cadvisor disk stat/usage interfaces 2016-05-19 11:13:47 -07:00
Clayton Coleman 205a8b4574
Add init container loading to the kubelet 2016-05-17 00:29:53 -04:00
zhouhaibing089 5923fd352e followup to add http server close method 2016-05-05 12:04:41 +08:00
Vishnu kannan e566948a75 Track image storage usage for docker containers
add image fs info to summary stats API.
Adding node e2e test for image stats.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-04-25 16:00:34 -07:00
k8s-merge-robot 9637b09f69 Merge pull request #24047 from derekwaynecarr/reuse_summary_provider
Automatic merge from submit-queue

Expose SummaryProvider for reuse by other parts of kubelet

To support out of resource killing in the kubelet, we will introduce a new top-level module that will ensure node stability by checking if eviction thresholds have been met for memory and file-system usage on the node.  In addition, it will then need information about pod memory and disk usage in order to make an eviction selection.  Currently, this information is collected in `SummaryProvider` but it's hidden away and not available for re-use by other top-level modules of the kubelet.  This initial refactor adds the ability to get summary stat information from the `ResourceAnalyzer` so it can be reused by other top-level modules.

I suspect we will further re-factor this area as code evolves, but this unblocks further progress on out-of-resource killing.

/cc @vishh @timothysc @kubernetes/sig-node @kubernetes/rh-cluster-infra
2016-04-17 20:22:57 -07:00
k8s-merge-robot 75b49f591a Merge pull request #23948 from derekwaynecarr/memory_available
Automatic merge from submit-queue

Add memory available to summary stats provider

To support out of resource killing when low on memory, we want to let operators specify eviction thresholds based on available memory instead of memory usage for ease of use when working with heterogeneous nodes.  

So for example, a valid eviction threshold would be the following: 
* If node.memory.available < 200Mi for 30s, then evict pod(s)

For the node, `memory.availableBytes` is always known since the `memory.limit_in_bytes` is always known for root cgroup.  For individual containers in pods, we only populate the `availableBytes` if the container was launched with a memory limit specified.  When no memory limit is specified, the cgroupfs sets a value of 1 << 63 in the `memory.limit_in_bytes` so we look for a similar max value to handle unbounded limits, and ignore setting `memory.availableBytes`.

FYI @vishh @timstclair - as discussed on Slack.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra
2016-04-17 06:32:36 -07:00
derekwaynecarr 22fc4340a7 Expose SummaryProvider for reuse by other parts of kubelet 2016-04-08 14:25:39 -04:00
Yu-Ju Hong 388b4ff569 kubele: add RSS memroy to the summary API 2016-04-08 11:05:20 -07:00
derekwaynecarr a9e362d70c Add memory available to summary stats provider 2016-04-08 12:30:41 -04:00
k8s-merge-robot 3b65927050 Merge pull request #16451 from ncdc/exec-interop-testing
Automatic merge from submit-queue

Refactor streaming code to support interop testing

Refactor exec/attach/port forward client and server code to better
support interop testing of different client and server subprotocol
versions.

Fixes #16119
2016-04-01 17:11:26 -07:00
Andy Goldstein 4551ba6b53 Refactor exec code to support version skew testing
Refactor exec/attach client and server code to better support interoperability testing of different
client and server subprotocol versions.
2016-04-01 13:05:50 -04:00
goltermann 34d4eaea08 Fixing several (but not all) go vet errors. Most are around string formatting, or unreachable code. 2016-03-22 17:26:50 -07:00
Tim St. Clair 8cb820be0e Set correct applicatoin/json mime type for some kubelet endpoints 2016-03-14 18:04:17 -07:00
derekwaynecarr 26dbbdb244 kubelet stats should ignore .mount cgroups associated with container on systemd 2016-03-07 14:57:29 -05:00
Jeff Lowdermilk 402e44d26e Merge pull request #22320 from timstclair/network
Use the default interface for reporting network stats.
2016-03-03 15:18:34 -08:00
Yu-Ju Hong 94368df91a kubelet: monitor the health of pleg
PLEG is reponsible for listing the pods running on the node. If it's hung
due to non-responsive container runtime or internal bugs, we should restart
kubelet.
2016-03-01 17:24:27 -08:00
Tim St. Clair 3b9feb561c Use the default interface for reporting network stats. 2016-03-01 16:17:04 -08:00
Tim St. Clair 7b6d843309 Move test-only files to test-only packages 2016-03-01 09:11:32 -08:00
k8s-merge-robot f0c0af2561 Merge pull request #20528 from mikedanese/varz
Auto commit by PR queue bot
2016-02-27 00:27:18 -08:00
Mike Danese 5ec02bd021 add http handler to export configuration state 2016-02-24 14:12:28 -08:00
Phillip Wittrock 7bca355bb4 Spread pod volume metrics calc across calc period. Metrics are calculated independently. 2016-02-22 09:54:47 -08:00
Tim St. Clair 225f903ccf Move stats summary types to a new kubelet/api package to avoid unnecessary dependencies 2016-02-17 10:53:25 -08:00
k8s-merge-robot 4a24406579 Merge pull request #20990 from timstclair/summary-api
Auto commit by PR queue bot
2016-02-12 13:25:25 -08:00
Vishnu kannan 575812787d Replace `--resource-container` and `--system-container` with
`--kubelet-cgroups` and `--system-cgroups` respectively.
Updated `--runtime-container` to `--runtime-cgroups`.
Cleaned up most of the kubelet code that consumes these flags to match
the flag name changes.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-02-10 17:33:28 -08:00
Vishnu kannan 38efc837b9 Make container runtime's cgroup configurable.
Use the real cgroups for metrics generation.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-02-10 16:02:34 -08:00
Tim St. Clair 7a54f94cf4 Make summary timestamps more granular 2016-02-10 15:41:57 -08:00
k8s-merge-robot 8fcc105d6d Merge pull request #20444 from ncdc/flake/19466
Auto commit by PR queue bot
2016-02-08 20:46:03 -08:00
Andy Goldstein a45247ad2a Fix exec/attach test flakes
Ensure that stream reply frames are enqueued prior to any goaway frames.
2016-02-08 21:33:23 -05:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
Phillip Wittrock 3de94cd23c Supply volume fs metrics to server/stats/handler.go
* Metrics will not be expose until they are hooked up to a handler
* Metrics are not cached and expose a dos vector, this must be fixed before release or the stats should not be exposed through an api endpoint
2016-02-05 16:00:24 -08:00
Phillip Wittrock ba5be34574 Kubelet Metrics Summary Api Implementation 2016-02-04 14:05:28 -08:00
k8s-merge-robot 32ab64ce5b Merge pull request #19778 from resouer/runtime
Auto commit by PR queue bot
2016-02-01 21:05:05 -08:00
k8s-merge-robot 348858061d Merge pull request #20258 from smarterclayton/get_logs_for_any_container
Auto commit by PR queue bot
2016-02-01 16:24:20 -08:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Clayton Coleman d6d4a17db6 Allow clients to request most recent container logs
Many users attempt to use 'kubectl logs' in order to find the logs
for a container, but receive no logs or an error telling them their
container is not running. The fix in this case is to run with '--previous',
but  this does not match user expectations for the logs command.

This commit changes the behavior of the Kubelet to return the logs of
the currently running container or the previous running container unless
the user provides the "previous" flag. If the user specifies "follow"
the logs of the most recent container will be displayed, and if it is
a terminated container the logs will come to an end (the user can
repeatedly invoke 'kubectl logs --follow' and see the same output).

Clean up error messages in the kubelet log path to be consistent and
give users a more predictable experience.

Have the Kubelet return 400 on invalid requests
2016-01-31 17:47:29 -05:00
Tim St. Clair 1bd945423d Update metrics summary API
- Change resource Quantity types to *uint64
- Change CoreSeconds -> CoreNanoSeconds
- Rename NonLocalObjectReference to PodReference
- Add UID to PodReference
- Add UserDefinedMetrics
- Add StartTime to container and pod metrics.
2016-01-29 16:56:46 -08:00
Clayton Coleman 8448b60f51 Kubelet server was not returning a 500 on errors writing logs
Writing 200 first masks the second error. 200 is defaulted by the Go
http stack automatically.
2016-01-28 21:44:27 -05:00
Clayton Coleman 4a6935b31f Remaining codec change refactors 2016-01-22 13:27:27 -05:00
nikhiljindal 2ad642d370 Merge registered and latest and move to apimachinery 2016-01-21 14:42:21 -08:00
Alex Mohr 7d96694c3f Merge pull request #19725 from timstclair/summary
Add blank /stats/summary kubelet endpoint
2016-01-21 14:27:53 -08:00
k8s-merge-robot fcf8263b1b Merge pull request #19572 from pwittrock/exportfsmetrics
Auto commit by PR queue bot
2016-01-17 07:46:02 -08:00
Tim St. Clair 5a0dc30b51 Add blank /stats/summary kubelet endpoint
Add a `/stats/summary` endpoint to the kubelet which will return an
empty Summary{} struct (json formatted), as a summary API
placeholder. Once the next cAdvisor release is vendored, the summary
API will be filled in.
2016-01-15 14:55:54 -08:00
Phillip Wittrock bb216e53da Define stats api fields for exporting filesystem metrics #17331 2016-01-14 15:52:35 -08:00
k8s-merge-robot a385de1e43 Merge pull request #19357 from timstclair/stats-refactor
Auto commit by PR queue bot
2016-01-13 23:54:48 -08:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
Tim St. Clair 3c72506f10 Fixed test & error code 2016-01-07 11:55:26 -08:00
Tim St. Clair 368447ff3f Rector kubelet stats serving
Changes include:
- Moving stats serving & routes to pkg/kubelet/server/stats/handler.go
- Managing the routes with restful.WebService, rather than manual
parsing
- Misc cleanup

These changes will make adding the new routes for /stats/summary more
manageable.
2016-01-06 17:37:12 -08:00
Tim St. Clair c357b91d2c Update from offline discussions
- Sample is now the toplevel struct, so all child structs have the same
  timestamp
- Removed FilesystemStats. There are more discussions needed
  wrt. volumes and disk accounting, so this will be added in a follow
  up PR
- Removed Options. The most recent sample will be returned.
2015-12-17 15:45:14 -08:00
Tim St. Clair e1fc2c1152 @vishh PR feedback 2015-12-17 10:54:17 -08:00
Tim St. Clair ce20c3b100 Add new Stats API for serving pod level stats
This API has been discussed ad nauseam across several forums, and this
API represents the latest conclusion. In summary, we will provide this
API as temporary solution for providing the new stats required for 1.2.

In the longterm this API will be split into "essential" stats, which
will be provided by a first-party API served through the kubelet, and
"non-essential" (monitoring) stats, which will be provided by a 3rd
party API served from a pod.
2015-12-17 10:54:17 -08:00
Tim St. Clair 89bc7992f9 Refactor kubelet server into its own package
Refactor Kubelet's server functionality into a server package. Most
notably, move pkg/kubelet/server.go into
pkg/kubelet/server/server.go. This will lead to better separation of
concerns and a more readable code hierarchy.
2015-12-15 10:20:38 -08:00
Tim Hockin 7fe7f8a542 move pkg/kubelet/server to cmd/kubelet/app 2015-02-20 08:49:12 -08:00
Andy Goldstein 5bd0e9ab05 Add streaming command execution & port forwarding
Add streaming command execution & port forwarding via HTTP connection
upgrades (currently using SPDY).
2015-02-20 09:57:02 -05:00
Victor Marmol 2d1a8d0da0 Allow ApplyOomScoreAdj to specify what PID to adjust for. 2015-02-19 17:16:31 -08:00
Paul Morie a42ff94c8f Add secret volume plugin and e2e test 2015-02-18 16:27:44 -05:00
Wojciech Tyczynski 524cdba101 Fix hack/test-cmd.sh test. 2015-02-05 01:58:26 +01:00
Joe Beda 76df5471b5 Covert the kubelet binary to hyperkube.
This leaves `pkg/kubelet/server/server.go` looking a little ugly as there is an extra layer of "config" structs that isn't needed.  This is left as a TODO for now.
2015-02-02 14:03:13 -08:00
Joe Beda d96afdd645 Move 'pkg/standalone' package to 'pkg/kubelet/server'.
This paves the way to hyperkube for the kubelet.
2015-02-02 14:03:13 -08:00