Commit Graph

311 Commits (ec6181d5d3cae2238d485ee75332ab9c09b619d9)

Author SHA1 Message Date
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 151c2249cc Merge pull request #28044 from yifan-gu/bump_rkt
Automatic merge from submit-queue

rkt: Bump required rkt version to 1.9.1.

Bump the rkt version to use the one that fixed the [go-systemd sdjournal issue](https://github.com/coreos/rkt/pull/2837), also match [release doc](https://github.com/kubernetes/kubernetes.github.io/blob/release-1.3/docs/getting-started-guides/rkt/index.md#prerequisite).

cc @kubernetes/sig-rktnetes @kubernetes/sig-node
2016-06-24 22:50:29 -07:00
Yifan Gu 8b1b9120c6 rkt: Fix the 'privileged' check when stage1 annotation is provided.
Previously when stage1 annotation is provided, we only checks if
the kubelet allows privileged, which is not useful as that is a global
setting.

Instead, we should check if the pod has explicitly set the privileged
security context to 'true'.
2016-06-24 16:33:12 -07:00
Yifan Gu 30c913e211 rkt: Bump required rkt version to 1.9.1. 2016-06-24 13:54:32 -07:00
k8s-merge-robot 89bb77d3e8 Merge pull request #27737 from yifan-gu/grace_period
Automatic merge from submit-queue

rkt: Refactor grace termination period.

Add `TimeoutStopSec` service option to support grace termination.

Found we can improve the grace-period-termination by adding a systemd service option.

cc @kubernetes/sig-rktnetes
2016-06-22 19:23:25 -07:00
Dan Williams a657d0587b kubelet/kubenet: Fix getRunningPods() to support rkt pods
Don't assume there's an infra container.
2016-06-22 13:45:13 -05:00
k8s-merge-robot ee35555cb6 Merge pull request #27570 from Random-Liu/add-runtime-request-timeout-flag
Automatic merge from submit-queue

Add runtime-request-timeout kubelet flag.

XRef #23563.

Addresses https://github.com/kubernetes/kubernetes/issues/27388#issuecomment-226570083.

Add a new kubelet flag `runtime-request-timeout`, and set to 2 minutes by default.
Now the flag only affects dockertools, rkt may also want to set request timeout according to the flag. @yifan-gu 

This PR also removed the timeout for all long running operations to avoid issues like #27588 and #26122.

@yujuhong @rrati 
/cc @kubernetes/sig-node 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-21 01:26:54 -07:00
Yifan Gu 4329ba700f rkt: Refactor grace termination period.
Add `TimeoutStopSec` service option to support grace termination.
2016-06-20 17:18:12 -07:00
Yifan Gu 4e9298cd99 rkt: Map kubelet's `--stage1-image` flag to rkt's `--stage1-name` flag.
This enables rkt to use cached stage1 image instead of unpacking the
stage1 image every time for every pod.

After this change, users need to preload the stage1 images in order to
enable rkt to find the stage1 image with the name specified by this flag.
2016-06-20 10:39:46 -07:00
k8s-merge-robot 090e6ff660 Merge pull request #27625 from goltermann/spell2
Automatic merge from submit-queue

Fix several spelling errors in comments

What the title says
2016-06-18 23:08:28 -07:00
Random-Liu 3cc9ca3988 Add timeout for rkt requests. 2016-06-17 18:18:41 -07:00
goltermann 218645b346 Fix several spelling errors in comments. 2016-06-17 10:41:18 -07:00
Yu-Ju Hong f279e36292 Don't remove all containers of deleted pods until sources are ready
Without this fix, kubelet may assume a pod from a not-ready source has already
been deleted, and GC all its dead containers.
2016-06-16 10:47:12 -07:00
Yifan Gu 03ee60c810 rkt: Updated the TestMakePodManifestAnnotations(). 2016-06-13 09:43:15 -07:00
Yifan Gu f2bf13a5ac rkt: Treat pod container cgroup as the infra container. 2016-06-13 09:43:10 -07:00
Yifan Gu edc946e081 rkt: Error out when the gid is empty.
Since appc requires gid to be non-empty today (https://github.com/appc/spec/issues/623),
we have to error out when gid is empty instead of using the root gid.
2016-06-10 18:48:14 -07:00
k8s-merge-robot 07f72acaa2 Merge pull request #27098 from yifan-gu/rkt_getlog
Automatic merge from submit-queue

rkt: Replace 'journalctl' with rkt's GetLogs() API.

This replaced the `journactl` shell out with rkt's GetLogs() API.
Fixes #26997 

To make this fully work, we need rkt to have this patch #https://github.com/coreos/rkt/pull/2763

cc @kubernetes/sig-node @euank @alban @iaguis @jonboulle
2016-06-10 01:54:05 -07:00
Yifan Gu d69351b83a rkt: Replace 'journalctl' with rkt's GetLogs() API.
Also fixed a bug where 'journalctl -f' process leaks when the kubelet
is killed.
2016-06-09 20:02:53 -07:00
Yifan Gu 5a9ea30814 rkt: Do not run rkt pod inside a pre-created netns when network plugin is no-op.
This fixed a panic where the returned pod network status is nil.
Also this makes lkvm stage1 able to run inside a user defined
network, where the network name needs to be 'rkt.kubernetes.io'.

Also fixed minor issues such as passing the wrong pod UID, ignoring
logging errors.
2016-06-09 19:38:07 -07:00
Yifan Gu 8596d25ad5 rkt: Fix incomplete selinux context string when the option is partial.
Add Getfilecon() into the selinux interface.
2016-06-07 14:43:35 -07:00
Yifan Gu 3699b70b00 rkt: Refactor the systemd interface.
Replace shell out calls with dbus API calls.
Remove unused 'Reload()'.
2016-06-06 05:27:08 +00:00
k8s-merge-robot 8e091e254f Merge pull request #26666 from euank/fix-wrong-err
Automatic merge from submit-queue

rkt: Wrap exec errors as utilexec.ExitError

This is needed by the exec prober to distinguish error types and exit
codes correctly. Without this, the exec prober used for liveness probes
doesn't identify errors correctly and restarts aren't triggered. Fixes #26456

An alternative, and preferable solution would be to use utilexec
everywhere, but that change is much more involved and should come at a
later date. Unfortunately, until that change is made, writing tests for
this is quite difficult.

cc @yifan-gu @sjpotter
2016-06-04 05:11:16 -07:00
k8s-merge-robot 4c316979c8 Merge pull request #25851 from euank/fixJournaldUsage
Automatic merge from submit-queue

rkt: Get logs via syslog identifier

This change works around https://github.com/coreos/rkt/issues/2630
Without this change, logs cannot reliably be collected for containers
with short lifetimes.

With this change, logs cannot be collected on rkt versions v1.6.0 and
before.

I'd like to also bump the required rkt version, but I don't want to do that until there's a released version that can be pointed to (so the next rkt release).

I haven't added tests (which were missing) because this code will be removed if/when logs are retrieved via the API. I have run E2E tests with this merged in and verified the tests which previously failed no longer fail.

cc @yifan-gu
2016-06-02 15:53:39 -07:00
k8s-merge-robot a27058156f Merge pull request #24901 from yifan-gu/support_selinux
Automatic merge from submit-queue

rkt: Add pod selinux support.

Currently only pod level selinux context is supported, besides when
running selinux, we will not be able to use the overlay fs, see:
https://github.com/coreos/rkt/issues/1727#issuecomment-173203129.


cc @kubernetes/sig-node  @alban @mjg59 @pmorie
2016-06-02 07:48:02 -07:00
Euan Kemp 40efc0fb33 rkt: Wrap exec errors as utilexec.ExitError
This is needed by the exec prober to distinguish error types and exit
codes correctly.

An alternative, and preferable solution would be to use utilexec
everywhere, but that change is much more involved and should come at a
later date. Unfortunately, until that change is made, writing tests for
this is quite difficult.
2016-06-01 15:34:49 -07:00
Yifan Gu 0a7537ecbf rkt: Add pod selinux support.
Currently only pod level selinux context is supported, besides when
running selinux, for now we will not be able to use the overlay fs
except for coreos, see:
https://github.com/coreos/rkt/issues/1727#issuecomment-173203129.
2016-06-02 00:55:27 +08:00
k8s-merge-robot 6277eea57b Merge pull request #26200 from yifan-gu/remove_systemd_quotes
Automatic merge from submit-queue

rkt: Remove quotes in the systemd ExecStart command.

cc @euank @dcbw
2016-06-01 03:13:19 -07:00
Euan Kemp f028a9f410 rkt: Update minimum rkt version to 1.7.0
Also remove the redundant `appcVersion` check, that version should
already be captured in the rkt version
2016-05-31 15:24:51 -07:00
Euan Kemp d0a31873d7 rkt: Get logs via syslog identifier
This change works around https://github.com/coreos/rkt/issues/2630
Without this change, logs cannot reliably be collected for containers
with short lifetimes.

With this change, logs cannot be collected on rkt versions v1.6.0 and
before.
2016-05-31 15:23:46 -07:00
Yifan Gu 6cb87e8d69 rkt: Remove quotes in the systemd ExecStart command.
With quotes, the service doesn't start for systemd 219 with the error
saying the path of the netns cannot be found.

This PR fixes the bug by removing the quotes surround the netns path.
2016-05-31 22:16:42 +08:00
Yifan Gu 1d40f471b4 rkt: Fix docker auth config save directory to avoid race. 2016-05-30 20:40:31 +08:00
k8s-merge-robot d00dec7825 Merge pull request #26397 from euank/fixReadOnlyRootfsPanic
Automatic merge from submit-queue

rkt: Fix panic in setting ReadOnlyRootFS

What the title says. I wish this method were broken out in a reasonably unit testable way. fixing this panic is more important for the second though, testing will come in a later commit.

I observed the panic in a `./hack/local-up-cluster.sh` run with rkt as the container runtime.

This is also the panic that's failing our jenkins against master ([recent run](https://console.cloud.google.com/m/cloudstorage/b/rktnetes-jenkins/o/logs/kubernetes-e2e-gce/1946/artifacts/jenkins-e2e-minion-group-qjh3/kubelet.log for the log output of a recent run))

cc @tmrts @yifan-gu
2016-05-29 02:17:09 -07:00
k8s-merge-robot 350efaf13d Merge pull request #26096 from euank/set-pod-ip
Automatic merge from submit-queue

rkt: Pass through podIP

This is needed for the /etc/hosts mount and the downward API to work.
Furthermore, this is required for the reported `PodStatus` to be
correct.

The `Status` bit mostly worked prior to #25062, and this restores that
functionality in addition to the new functionality.

In retrospect, the regression in status is large enough the prior PR should have included at least some of this; my bad for not realizing the full implications there.

#25902 is needed for downwards api stuff, but either merge order is fine as neither will break badly by itself.

cc @yifan-gu @dcbw
2016-05-28 12:40:39 -07:00
Euan Kemp abbd0321b2 rkt: Use volumes from RunContainerOptions
This replaces the previous creation of mounts from the `volumeGetter`
with mounts provided via RunContainerOptions.

This is motivated by the fact that the latter has a more complete set of
mounts (e.g. the `/etc/hosts` one created in kubelet.go).
2016-05-27 13:11:47 -07:00
Alex Robinson bd0b94efe2 Merge pull request #26029 from luxas/mkdir_all
kubelet: Use MkdirAll instead of Mkdir
2016-05-27 11:40:01 -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
Euan Kemp ecfd8f723f rkt: Fix panic in setting ReadOnlyRootFS 2016-05-26 20:43:26 -07:00
Alex Mohr 5b1653ec39 Merge pull request #25681 from vishh/lifecycle-probe-logs
Log output of lifecycle hooks on failure
2016-05-26 12:37:02 -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
k8s-merge-robot e7022106ff Merge pull request #25719 from tmrts/rk8s/read-only-rootfs
Automatic merge from submit-queue

Use read-only root filesystem capabilities of rkt

Propagates `api.Container.SecurityContext.ReadOnlyRootFileSystem` flag to rkt container runtime.

cc @yifan-gu 

Fixes #23837
2016-05-25 17:58:03 -07:00
Euan Kemp 8a2895d88f rkt: Pass through podIP
This is needed for the /etc/hosts mount and the downward API to work.
Furthermore, this is required for the reported `PodStatus` to be
correct.

The `Status` bit mostly worked prior to #25062, and this restores that
functionality in addition to the new functionality.
2016-05-25 11:16:39 -07:00
Vishnu kannan e7721ea8cf Expose errors from libecycle hooks as events for the pod.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-05-24 11:12:53 -07:00
Euan Kemp 136da158c5 rkt: Support alternate stage1's via annotation
This provides a basic implementation for setting a stage1 on a per-pod
basis via an annotation.

It's possible this feature should be gated behind additional knobs, such
as a kubelet flag to filter allowed stage1s, or a check akin to what
priviliged gets in the apiserver.
Currently, it checks `AllowPrivileged`, as a means to let people disable
this feature, though overloading it as stage1 and privileged isn't
ideal.
2016-05-23 13:47:16 -07:00
Euan Kemp dc236d926d rkt: Add VolumeGetter mock 2016-05-23 13:43:55 -07:00
Lucas Käldström 2022c44409 kubelet: Use MkdirAll instead of Mkdir 2016-05-22 00:23:18 +03:00
Tamer Tas 239c04d60d Use read-only root filesystem capabilities of appc & rkt 2016-05-21 20:01:00 +03:00
k8s-merge-robot d6d0a6eb83 Merge pull request #25656 from tmrts/godep-update/rkt-1.6.0
Automatic merge from submit-queue

Update rkt API version to 1.6.0

Updates coreos/rkt container runtime dependency to `1.6.0`

Fixes #25430
2016-05-21 09:56:52 -07:00
k8s-merge-robot 423a4154be Merge pull request #25062 from dcbw/kubenet-rkt
Automatic merge from submit-queue

Hook rkt kubelet runtime up to network plugins
2016-05-21 00:45:19 -07:00
Dan Williams 62e4635cfb rkt: set up network namespace with plugins 2016-05-18 11:28:05 -05:00
Dan Williams 9b85d20c73 kubelet/runtime: add method to return pod network namespace path
Some runtimes (eg, Hypernetes) don't create network namespaces for pods,
so network plugins must correctly handle any error returned from the
runtime.
2016-05-18 09:26:01 -05:00