Commit Graph

87 Commits (09e42764483ecd1c1a71863518beba5b98241f71)

Author SHA1 Message Date
Kubernetes Submit Queue 791116476f Merge pull request #32348 from asalkeld/metrics-nil-spammy
Automatic merge from submit-queue

Disambiguate unsupported metrics from metrics errors

**What this PR does / why we need it**:
Stop logging "metrics are not supported for MetricsNil Volumes" as it spams the log.

**Which issue this PR fixes** 
fixes #20676, fixes #27373

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Don't log "metrics are not supported for MetricsNil Volumes"
```
2016-09-16 11:27:15 -07:00
Hai Huang 192825bc5e fix a typo 2016-09-16 09:42:29 -04:00
Angus Salkeld a1b2fcb10f Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10: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
mdshuai c3ddd882df correct imagefs inodes value in summary stats 2016-09-08 17:19:48 +08:00
Mike Danese 39d190e983 lower loglevel of spammy warning 2016-09-02 13:34:29 -07:00
bindata-mockuser e792d4117d Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
derekwaynecarr 2563696719 Add total inodes to kubelet summary api 2016-08-08 12:20:14 -04:00
bindata-mockuser e00a35ccad updated cadvisor version 2016-08-02 16:33:03 -07:00
Matt T. Proud 5c6292c074 pkg/various: plug leaky time.New{Timer,Ticker}s
According to the documentation for Go package time, `time.Ticker` and
`time.Timer` are uncollectable by garbage collector finalizers.  They
leak until otherwise stopped.  This commit ensures that all remaining
instances are stopped upon departure from their relative scopes.
2016-07-26 06:20:31 +02:00
k8s-merge-robot 8d46d9b0c7 Merge pull request #28281 from nhlfr/authorize-return-bool
Automatic merge from submit-queue

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 21:40:26 -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
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
k8s-merge-robot 50172148e4 Merge pull request #25273 from ncdc/exec-sigwinch
Automatic merge from submit-queue

Support terminal resizing for exec/attach/run

```release-note
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.
```

Fixes #13585
2016-07-14 07:26:49 -07: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
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