Commit Graph

670 Commits (f6f71c32b673feaea8808fb29011cde9deb281e7)

Author SHA1 Message Date
Random-Liu 816f867c62 Add image cache. 2016-12-08 14:04:01 -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
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
Rajat Ramesh Koujalagi d81e216fc6 Better messaging for missing volume components on host to perform mount 2016-11-09 15:16:11 -08:00
Kubernetes Submit Queue 182a09c3c7 Merge pull request #35526 from justinsb/fix_35521_b
Automatic merge from submit-queue

kubelet bootstrap: start hostNetwork pods before we have PodCIDR

Network readiness was checked in the pod admission phase, but pods that
fail admission are not retried.  Move the check to the pod start phase.

Issue #35409 
Issue #35521
2016-11-06 12:53:14 -08:00
Justin Santa Barbara 88628119ab kubelet: testing for hostNetwork with network errors 2016-11-04 00:46:33 -04:00
Tim St. Clair ec9111d942
Hold bad AppArmor pods in pending rather than rejecting 2016-11-02 11:05:16 -07:00
Jess Frazelle d51962e1bb
vet fixes
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-10-13 21:12:15 -07:00
Kubernetes Submit Queue 1854bdcb0c Merge pull request #29048 from justinsb/volumes_nodename_not_hostname
Automatic merge from submit-queue

Use strongly-typed types.NodeName for a node name

We had another bug where we confused the hostname with the NodeName.

Also, if we want to use different values for the Node.Name (which is
an important step for making installation easier), we need to keep
better control over this.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName
2016-09-27 17:58:41 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Paul Morie b1f91bd510 Move Kubelet pod-management code into kubelet_pods.go 2016-09-26 17:16:59 -04:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
deads2k 16fbb47189 fix up service lister 2016-09-20 08:24:33 -04:00
Yu-Ju Hong 7ada99181c Limit the number of names per image reported in the node status 2016-09-16 15:16:08 -07:00
Kubernetes Submit Queue 622c2bbd5e Merge pull request #32116 from ZTE-PaaS/zhangke-patch-039
Automatic merge from submit-queue

Fixed TODO: move predicate check into a pod admitter

refractoring AdmitPod func to move predicate check into a pod admitter
2016-09-11 18:25:13 -07:00
Ke Zhang 0ce6d8dafb TODO: move predicate check into a pod admitter 2016-09-09 09:58:42 +08:00
derekwaynecarr ff017839c7 Log an event when container runtime exceeds grace-period during eviction 2016-09-07 13:28:08 -04:00
Yu-Ju Hong 013f7e3c46 kubelet_test.go: use assertions
Switch most of the tests in this file to using  the assert/require library
(in `github.com/stretchr/testify`) in the tests for better readability and
less code in general.
2016-09-01 17:21:48 -07:00
Kubernetes Submit Queue bb9523bd0f Merge pull request #31157 from pmorie/kubelet-move
Automatic merge from submit-queue

Kubelet code move: volume / util

Addresses some odds and ends that I apparently missed earlier.  Preparation for kubelet code-move ENDGAME.

cc @kubernetes/sig-node
2016-08-25 00:20:39 -07:00
Justin Santa Barbara 902ba4e249 Add network-plugin-mtu option for MTU selection
MTU selection is difficult, and if there is a transport such as IPSEC in
use may be impossible.  So we allow specification of the MTU with the
network-plugin-mtu flag, and we pass this down into the network
provider.

Currently implemented by kubenet.
2016-08-23 01:50:58 -04:00
Paul Morie b91ad76066 Kubelet code move: volume / util 2016-08-22 23:35:11 -04:00
Clayton Coleman e1ebde9f92
Add spec.nodeName and spec.serviceAccountName to downward env var
The serviceAccountName is occasionally useful for clients running on
Kube that need to know who they are when talking to other components.

The nodeName is useful for PetSet or DaemonSet pods that need to make
calls back to the API to fetch info about their node.

Both fields are immutable, and cannot easily be retrieved in another
way.
2016-08-20 15:50:36 -04:00
Kubernetes Submit Queue 1b79bc1812 Merge pull request #30731 from ncdc/exec-probe-message
Automatic merge from submit-queue

Always return command output for exec probes and kubelet RunInContainer

Always return command output for exec probes and kubelet RunInContainer, even if the command invocation returns nonzero.

When #24921 replaced RunInContainer with ExecInContainer, it introduced a change where an exec probe that failed no longer included the stdout/stderr from the probe in the event. For example, when running at log level 4, you see:

```
I0816 15:01:36.259826 29713 exec.go:38] Exec probe response: "Failed to access the status endpoint : HTTP Error 404: Not Found.\nHawkular metrics has only been running for 7\n seconds not aborting yet.\n"
```

But the event looks like this:

```
54s 22s 5 hawkular-metrics-hjme4 Pod spec.containers{hawkular-metrics} Warning Unhealthy {kubelet corbeau} Readiness probe failed:
```

Note the absence of the exec probe response after "Readiness probe failed". This PR restores the previous behavior.

cc @kubernetes/rh-cluster-infra @mwringe 

xref https://github.com/openshift/origin/issues/10424
2016-08-20 05:41:44 -07:00
Andy Goldstein c3fe759fec Always return exec command output
Always return exec command output, even if the command invocation returns nonzero. This applies to
exec probes and kubelet RunInContainer calls.
2016-08-17 16:21:19 -04:00
Scott Creeley 782d7d9815 Add Events for operation_executor to show status of mounts, failed or successful 2016-08-17 09:53:47 -04:00
Kubernetes Submit Queue 79ed7064ca Merge pull request #27970 from jingxu97/restartKubelet-6-22
Automatic merge from submit-queue

Add volume reconstruct/cleanup logic in kubelet volume manager

Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.

Fixes https://github.com/kubernetes/kubernetes/issues/27653
2016-08-15 13:48:43 -07:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Kubernetes Submit Queue 34e51d8ce9 Merge pull request #30095 from ronnielai/image-gc-2
Automatic merge from submit-queue

Moving image gc to pkg/kubelet/images
2016-08-05 03:11:33 -07:00
derekwaynecarr 68bc47ecc6 Add support to invoke image gc in response to disk eviction thresholds 2016-08-04 17:13:08 -04:00
bindata-mockuser 0c76d85cc8 moving image gc to images 2016-08-04 12:26:06 -07:00
Andrey Kurilin 9f1c3a4c56 Fix various typos in kubelet 2016-08-03 01:14:44 +03:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
Paul Morie 249da77371 Extract kubelet node status into separate file 2016-07-22 01:21:30 -04:00
Paul Morie d9ffcace6a Move ExtractPodBandwidthResources test into appropriate package 2016-07-19 14:34:08 -04:00
Cindy Wang e13c678e3b Make volume unmount more robust using exclusive mount w/ O_EXCL 2016-07-18 16:20:08 -07: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
k8s-merge-robot 5067af159e Merge pull request #28715 from euank/kubelet-trim-dead-code
Automatic merge from submit-queue

kubelete: delete a few bits of dead code

Less is more.
2016-07-11 11:40:47 -07:00
Euan Kemp 26e0f50504 kubelet: delete unused code 2016-07-08 15:15:43 -07:00
Paul Morie 5c836f3582 Extract kubelet network code into its own file 2016-07-08 15:18:07 -04:00
derekwaynecarr c162fec94d Move ActiveDeadlineSeconds to use lifecycle observers 2016-07-07 13:43:55 -04:00
ronnielai 5d05fbad9b Revert "Declare out of disk when there is no free inodes" 2016-07-06 08:19:09 -07:00
k8s-merge-robot d06359d6a0 Merge pull request #28409 from saad-ali/moveVolumeController
Automatic merge from submit-queue

Reorganize volume controllers and manager

* Move both PV and attach/detach volume controllers to `controllers/volume` (closes #26222)
* Rename `kubelet/volume` to `kubelet/volumemanager`
* Add/update OWNER files
2016-07-02 00:41:02 -07:00
saadali 0dd17fff22 Reorganize volume controllers and manager 2016-07-01 18:50:25 -07:00
Ron Lai 8cc6057c63 Declare out of disk when there is no free inodes. 2016-06-30 09:43:36 -07:00