Commit Graph

120 Commits (f34a24e98e7c837b567b78be3af958ac1156cd80)

Author SHA1 Message Date
Andrey Kurilin 9f1c3a4c56 Fix various typos in kubelet 2016-08-03 01:14:44 +03:00
k8s-merge-robot 68632db799 Merge pull request #27562 from 7ing/ipt
Automatic merge from submit-queue

improve iptables-restore implementation #27559

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
fixes #27559
- improve restoreInternal implementation in iptables
- add SetStdin and SetStdout functions to Cmd interface
- modify kubelet/prober and some tests in order to work with Cmd interface
2016-08-02 08:02:32 -07:00
k8s-merge-robot 3786701280 Merge pull request #28865 from ronnielai/image-gc-0
Automatic merge from submit-queue

Moving event.go from kubelet/container to kubelet/events
2016-07-18 22:54:03 -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
Daniel Smith 78c02cd052 Stop eating panics 2016-07-13 11:12:59 -07:00
Ron Lai e6b745122d Moving event.go from kubelet/container to kubelet/events 2016-07-12 17:42:29 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Tim St. Clair f2f3caf744 Rename **/manager.go 2016-06-21 15:11:31 -07:00
Jing Liu ef66f1ead8 improve iptables-restore implementation #27559
- improve restoreInternal implementation in iptables
- add SetStdin and SetStdout functions to Cmd interface
- modify kubelet/prober and some tests in order to work with Cmd interface
2016-06-16 12:19:34 -07:00
k8s-merge-robot a5cd171c2f Merge pull request #25064 from Clarifai/httpheaders-querystring
Automatic merge from submit-queue

Preserve query strings in HTTP probes instead of escaping them

Fixes a problem reported on Slack by devth.

```release-note
* Allow the use of query strings and URI fragments in HTTP probes
```

This might also preserve fragments, for those crazy enough to pass them.

I am using url.Parse() on the path in order to get path/query/fragment
and also deliberately avoiding the addition of more fields to the API.
2016-06-09 01:15:47 -07:00
Clayton Coleman 205a8b4574
Add init container loading to the kubelet 2016-05-17 00:29:53 -04:00
k8s-merge-robot 59b7b1c550 Merge pull request #24921 from feiskyer/merge-exec
Automatic merge from submit-queue

Remove RunInContainer interface in Kubelet Runtime interface

According to #24689, we should merge RunInContainer and ExecInContainer in the container runtime interface. 

@yujuhong  @kubernetes/sig-node
2016-05-15 02:58:15 -07:00
Rudi Chiarito a2051b2d47 Preserve query strings in HTTP probes instead of escaping them
This might also preserve fragments, for those crazy enough to pass them.

I am using url.Parse() on the path in order to get path/query/fragment
and also deliberately avoiding the addition of more fields to the API.
2016-05-02 20:53:19 -04:00
feisky 831203c19b Remove RunInContainer interface in Kuberlete Runtime interface 2016-05-01 20:21:15 +08:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07: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
Saad Ali f9b1a33b12 Merge pull request #21953 from timstclair/testing
Move kubelet test-only files to test-only packages
2016-03-01 15:48:10 -08:00
Tim St. Clair 7b6d843309 Move test-only files to test-only packages 2016-03-01 09:11:32 -08:00
Yu-Ju Hong 1a3d205faf kubelet: stop probing if liveness check fails
This change puts the worker on hold when the liveness check fails. It will
resume probing when observing a new container ID.
2016-02-26 17:12:27 -08:00
Andy Goldstein 51251ef5c1 Skip probe if container ID not yet set
If the container status exists but the container hasn't been created yet, it won't have an ID.
Have the probe wait for a valid status if the container ID is not yet set; otherwise, you'll see the
following cryptic log message from runtime.go: invalid container ID: "".
2016-02-23 15:32:13 -05:00
Chao Xu ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00
Lantao Liu 77b6f14f86 Change pod in probe update to pod uid. 2016-02-12 05:02:31 +00:00
k8s-merge-robot c382943353 Merge pull request #20726 from ingvagabund/jitter-sync-loops-in-kubelet
Auto commit by PR queue bot
2016-02-10 09:06:59 -08:00
Jan Chaloupka 392fc6668f Jittering periods of some kubelet's sync loops:
- pod_workers: pod syncing
- prober workers: container syncing

In order to synchronize the current state of Kubernetes's objects (e.g. pods, containers, etc.),
periodic synch loops are run. When there is a lot of objects to synchronize with,
loops increase communication traffic. At some point when all the traffic interfere cpu usage curve
hits the roof causing 100% cpu utilization.

To distribute the traffic in time, some sync loops can jitter their period in each loop
and help to flatten the curve.
2016-02-09 15:22:22 +01:00
Tim St. Clair da0d37f1e0 Fix panic from multiple probe cleanup calls. 2016-02-08 11:23:07 -08:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
Rudi Chiarito a2d1bb7acf Add httpHeaders to httpGet liveness probe
Also update existing documentation and try to steer users away from 'host'.
Add validation.
2016-02-05 11:20:04 -05:00
Chao Xu cddd7b56a4 replace client with clientset in kubelet and other places 2016-02-02 20:28:45 -08:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Brendan Burns 07b3ab720d Improve error reporting a little in ingress e2e.
Also add Output() to the util/exec Cmd interface.
2016-01-06 15:25:04 -08:00
Random-Liu 6e92ddf9e1 Cleanup pod print in dockertools/manager.go, prober/prober.go and
runonce.go
2015-12-28 14:07:37 -08:00
Tim St. Clair facb0a5c42 Concurrency fixes for prober tests
Fix leaking go routines and race conditions in prober unit tests.
2015-12-15 14:37:48 -08:00
Tim St. Clair 246442514c Expose Start method, don't call in constructor 2015-12-09 10:58:15 -08:00
Tim St. Clair 32794b18f0 Fix data race in prober test 2015-12-09 10:20:57 -08:00
Yu-Ju Hong a4816b3bcb Make kublet/util/format.go a separate package
The formatting function is used often in logging. This improves the readability
by shortening the length of the call. Also change the fomartted string to
include the pod UID.
2015-12-03 12:47:36 -08:00
Clayton Coleman 1d592e4c28 Unversioned types should not use ambiguous go-int
All external types that are not int64 are now marked as int32,
including
IntOrString. Prober is now int32 (43 years should be enough of an initial
probe time for anyone).

Did not change the metadata fields for now.
2015-11-26 11:45:25 -05:00
Avesh Agarwal 3d5207fd73 This commit adds type information to events.
This addresses issue #15624.
2015-11-24 09:59:54 -05:00
Tim Hockin ba383bcfeb Refactor IntOrString into a new pkg
pkg/util/intstr is a cleaner encapsulation for this type and supporting
functions.  No behavioral change.
2015-11-16 10:57:52 -08:00
k8s-merge-robot 8761ad3ec1 Merge pull request #15464 from jiangyaoguo/bubble-up-reason-when-killing-pod
Auto commit by PR queue bot
2015-11-11 14:17:27 -08:00
Tim St. Clair 67cfed5bf3 Don't wait for sync to update readiness
Push status updates as soon as readiness state changes for containers,
rather than waiting for the sync loop to update the status. In
particular, this should help new containers to come online faster.

Additionally, consolidates prober test helpers into a single file.
2015-11-10 14:00:12 -08:00
jiangyaoguo b0f0c294d9 make reasons constants with clarity 2015-11-09 23:42:14 +08:00
Tim St. Clair 1e88a682da Add liveness/readiness probe parameters
- PeriodSeconds - How often to probe
- SuccessThreshold - Number of successful probes to go from failure to success state
- FailureThreshold - Number of failing probes to go from success to failure state

This commit includes to changes in behavior:

1. InitialDelaySeconds now defaults to 10 seconds, rather than the
kubelet sync interval (although that also defaults to 10 seconds).
2. Prober only retries on probe error, not failure. To compensate, the
default FailureThreshold is set to the maxRetries, 3.
2015-11-06 10:46:40 -08:00
Tim St. Clair 858126b42a Clean up static/mirror pod status logic
- status.Manager always deals with the local (static) pod, but gets the
  mirror pod when syncing
  - This lets components like the probe workers ignore mirror pods
2015-11-04 11:42:25 -08:00
Tim St. Clair 9a2089adc8 Concurrency fixes in status.Manager
- Fix deadlock when syncing deleted pods with full update channel
- Prevent sending stale updates to API server
- Don't delete cached status when sync fails (causes problems for prober)
2015-10-28 17:40:55 -07:00
Tim St. Clair 07e9892003 Cleanup prober.prober 2015-10-21 15:45:34 -07:00
Tim St. Clair a263c77b65 Refactor liveness probing
This commit builds on previous work and creates an independent
worker for every liveness probe. Liveness probes behave largely the same
as readiness probes, so much of the code is shared by introducing a
probeType paramater to distinguish the type when it matters. The
circular dependency between the runtime and the prober is broken by
exposing a shared liveness ResultsManager, owned by the
kubelet. Finally, an Updates channel is introduced to the ResultsManager
so the kubelet can react to unhealthy containers immediately.
2015-10-19 15:15:59 -07:00
eulerzgy ea86e66fbe Del capatical local packagename for kubeletUtil 2015-10-15 09:58:10 +08:00
Tim St. Clair 9b8bc50357 Generalize readinessManager to handle liveness 2015-10-07 16:40:30 -07:00
Tim St. Clair 551eff63b8 Use strong type for container ID
Change all references to the container ID in pkg/kubelet/... to the
strong type defined in pkg/kubelet/container: ContainerID

The motivation for this change is to make the format of the ID
unambiguous, specifically whether or not it includes the runtime
prefix (e.g. "docker://").
2015-10-07 10:58:05 -07:00
Tim St. Clair 52ece0c34e Refactor readiness probing
Each container with a readiness has an individual go-routine which
handles periodic probing for that container. The results are cached, and
written to the status.Manager in the pod sync path.
2015-10-02 15:37:10 -07:00
Tim St. Clair 1d0577286f Move the prober test from the docker manager_test.go to prober_test.go 2015-09-17 17:04:20 -07:00
Daniel Smith 15b30b8b09 Move version agnostic parts of client
pkg/client/unversioned/cache -> pkg/client/cache
pkg/client/unversioned/record -> pkg/client/record
2015-09-10 17:17:59 -07:00
Kris Rousey ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
xiejunan f5446f2aa3 fix error in findPortByName
using ContainerPort instead of HostPort
2015-08-14 14:00:05 +08:00
jiangyaoguo 9ab4a46b9d Keep event reason in kubelet consistent with others 2015-08-12 19:00:09 +08:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Steve Kuznetsov 3008ff6150 Changed HTTPGetAction to allow user-defined schemes 2015-06-25 16:59:12 -04:00
Mike Danese 35771acdfa seperate readiness and liveness in the code 2015-06-11 15:09:27 -07:00
Tim Hockin a29240f2c5 reduce verbosity of log line 2015-05-21 13:09:18 -07:00
Tim Hockin 75617e8760 Better kubelet logging for probes
Log when we actually run probes and event when they fail.  Print the output of
a probe, too.
2015-05-20 08:56:45 -07:00
Yifan Gu 7831b7da72 kubelet/container: Move prober.ContainerCommandRunner to container.
Also include the ContainerCommandRunner in Runtime interface, but
still keep the ContainerCommandRunner interface for testability.
2015-05-11 15:32:51 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Alex Robinson f3352d96e6 Merge pull request #7595 from a-robinson/typo
Fix typo in kubelet prober code
2015-04-30 14:42:18 -07:00
Alex Robinson faa3292bb3 Fix typo in kubelet prober code. 2015-04-30 13:17:10 -07:00
Gao Zheng 95f2d1378f change probe.runner to probe.Runner as based 2015-04-30 10:36:38 +08:00
Gao Zheng 74975eff03 Fixes issue #7352
readinessProbe calls livenessProbe.Exec.Command which cause
"invalid memory address or nil pointer dereference".
2015-04-30 10:19:49 +08:00
Victor Marmol fe4600ba17 Move ComputePodChanges to DockerManager.
This logic is specific to the Docker runtime. This move is the first
step towards making syncPod() runtime-agnostic.
2015-04-29 14:00:37 -07:00
Victor Marmol f38c607285 Move Prober to its own subpackage.
This will allow it to be reused by the runtimes.
2015-04-29 10:11:28 -07:00