Commit Graph

51 Commits (68097515d821217918a1c916759a8373e5e5eb86)

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Dan Williams 62e4635cfb rkt: set up network namespace with plugins 2016-05-18 11:28:05 -05:00
Yifan Gu 9d5bcf4251 rkt: Add tests for GarbageCollect(). 2016-05-13 15:13:52 -07:00
Yifan Gu 5351602f7d rkt: Implement ImageStats() for rkt. 2016-05-09 11:26:40 -07:00
k8s-merge-robot fe135fc251 Merge pull request #24630 from euank/redundant-created
Automatic merge from submit-queue

kubelet: Remove redundant `Container.Created`

As far as I can tell, this has been supplanted by a) the `DockerJSON.CreatedAt` field and b) the
`ContainerStatus.CreatedAt`, where the first is used for creating the
second.

The `.Created` field was only written to as far as I can see.

cc @yifan-gu & @Random-Liu 

Is there any reason we might want to keep this around?
2016-05-08 16:21:05 -07:00
k8s-merge-robot 4c7abddc1c Merge pull request #24567 from yifan-gu/post_start_hook
Automatic merge from submit-queue

rkt: Add post-start hook support.

This adds a poll-and-timeout procedure after the pod is
started, to make sure the post-start hooks execute when the
container is actually running.

This is a temporal workaround for implementing post-hooks,
a long term solution is to use lifecycle event to trigger
those hooks, see https://github.com/kubernetes/kubernetes/issues/23084.

Also this fixes a bug of getting container ID for a non-running
container when running pre-stop hook.


cc @sjpotter @euank @kubernetes/sig-node
2016-04-27 11:14:35 -07:00
Euan Kemp 7d34b0b09d kubelet: Remove redundant `Container.Created`
This has been supplanted by a) the DockerJSON.CreatedAt field and b) the
ContainerStatus.CreatedAt, where the first is used for creating the
second.

The `.Created` field was only written to as far as I can see.
2016-04-25 12:19:24 -07:00
Yifan Gu a12a7c2a2c rkt: Add post-start hook support.
This adds a poll-and-timeout procedure after the pod is
started, to make sure the post-start hooks execute when the
container is actually running.

This is a temporal workaround for implementing post-hooks,
a long term solution is to use lifecycle event to trigger
those hooks, see https://github.com/kubernetes/kubernetes/issues/23084.

Also this fixes a bug of getting container ID for a non-running
container when running pre-stop hook.
2016-04-22 15:38:05 -07:00
Euan Kemp a6718f5969 rkt: Implement pod `FinishedAt`
This is implemented via touching a file on stop as a hook in the systemd
unit. The ctime of this file is then used to get the `finishedAt` time
in the future.
In addition, this changes the `startedAt` and `createdAt` to use the api
server's results rather than the annotations it previously used.

It's possible we might want to move this into the api in the future.

Fixes #23887
2016-04-22 15:34:55 -07:00
Yifan Gu dfb6dd010f rkt: Fix hostnetwork.
Mount hosts' /etc/hosts, /etc/resolv.conf, set host's hostname
when running the pod in the host's network.

Besides, do not set the DNS flags when running in host's network.
2016-04-14 18:44:09 -07:00
Yifan Gu cc4336829d rkt: Add pre-stop lifecycle hooks for rkt.
When a pod is being terminated, the pre-stop hooks of all the containers
will be run before the containers are stopped.
2016-04-12 13:10:51 -07:00
Yifan Gu d4dc037bf7 rkt: Add '--hostname' support for rkt.
Add GeneratePodHostNameAndDomain() to RuntimeHelper to
get the hostname of the pod from kubelet.

Also update the logging flag to change the journal match from
_HOSTNAME to _MACHINE_ID.
2016-03-28 17:06:14 -07:00
Yifan Gu d814d973ff rkt: Bump rkt required version. Get options from api service. 2016-03-28 17:06:14 -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
k8s-merge-robot 88d50f30d2 Merge pull request #23228 from yifan-gu/rkt_entry_cmd
Auto commit by PR queue bot
2016-03-22 08:07:41 -07:00
Yifan Gu 9d3d55d0fb rkt: Unmarshal the ENTRYPOINT/CMD from jsons instead of strings.
Using json makes this robust to ENTRYPOINT/CMD that contains space.

Also removed 'RemainAfterExit' option, originally this option is
useful when we implement GetPods() by 'systemctl list-units'.
However since we are using rkt API service now, it's no longer needed.
2016-03-18 17:18:24 -07:00
Yifan Gu 89feb6fc53 rkt: Append tag to the returned image name. 2016-03-18 16:40:44 -07:00
k8s-merge-robot a4097fa4f1 Merge pull request #22891 from yifan-gu/rkt_version
Auto commit by PR queue bot
2016-03-16 00:04:55 -07:00
Yifan Gu fe2c3c351a rkt: Split checkVersion() to two parts: get version, and check version.
This enables rkt runtime to setup versions during creation,
this fixes a kubelet nil pointer panic when kubelet tries to get the
rkt versions but it's not set.
2016-03-15 16:35:26 -07:00
k8s-merge-robot 3b208815fd Merge pull request #22713 from yifan-gu/rkt_fix_entrypoint
Auto commit by PR queue bot
2016-03-12 01:41:53 -08:00
Yifan Gu 56be600c2b rkt: Fix GetPods().
Group containers from different rkt pods into one k8s pod if
they have the same k8s pod UID.
2016-03-09 17:46:44 -08:00
Yifan Gu 4a63f7f74c rkt: Support ENTRYPOINT/CMD substitution. 2016-03-08 18:32:18 -08:00
laushinka 7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07:00
Yifan Gu d27a635c4a rkt: Add DNS support.
rkt is now able to populate /etc/resolv.conf with command line flags.
Update the runtime code to fix DNS issues.
2016-02-03 14:54:09 +01:00
k8s-merge-robot e78834ab62 Merge pull request #20337 from yifan-gu/rkt_empty_isolator
Auto commit by PR queue bot
2016-02-02 09:56:04 -08:00
k8s-merge-robot 23c64ec103 Merge pull request #20233 from yifan-gu/rkt_fix_user_group
Auto commit by PR queue bot
2016-02-02 08:47:08 -08:00
k8s-merge-robot 171c2ecbe7 Merge pull request #19524 from derekparker/rkt-image-size
Auto commit by PR queue bot
2016-02-01 11:53:36 -08:00
Yifan Gu 581759d12d rkt: Set default 'User', 'Group' to root if it's not specified. 2016-02-01 20:00:09 +08:00
Yifan Gu 9ce10c8552 rkt: Add support for termination message, termination reason.
If 'TerminationMessagePath' in container spec is set, then
We will mount the termination message log into the container.

Also in GetPodStatus, if the container exits and the 'TerminationMessagePath'
is set, then the 'message' field in container state will be populated.
2016-02-01 18:06:47 +08:00
Yifan Gu 1b34e2c314 rkt: If resource's limit is empty, populate it with request,and vice versa. 2016-01-29 10:50:37 -08:00
Yifan Gu dcee692d64 rkt: Expand environment variables in Command and Args. 2016-01-29 10:09:48 -08:00
Fabio Yeon 7205a160ac Remove all instances of "/tmp" from unit tests and replace with a common
tmp directory creator. Exception is documented.
2016-01-27 16:11:22 -08:00
k8s-merge-robot ffed4e1a3a Merge pull request #19428 from yifan-gu/rkt_isolator
Auto commit by PR queue bot
2016-01-16 08:48:38 -08:00
Derek Parker 55f09009c7 rkt: Include size in ListImages 2016-01-12 14:44:40 -08:00
Yifan Gu dda62129d1 rkt: Add unit tests for setApp. 2016-01-08 13:41:18 -08:00
harry zhang 27ca7dc71e Expose image list in node status
Change image manager to use repotag
2016-01-08 17:01:31 +08:00
Yifan Gu ee7251ed10 rkt: Update for newest api version. 2015-12-22 12:02:25 -08:00
Yifan Gu 2c79c670f1 rkt: Fix GetPods(), refactor tests for GetPods().
Fix GetPods() so that the container hash is fetched from the
annotations in pod manifest's app list instead of image manifest.
2015-12-16 16:53:45 -08:00
Yifan Gu 5f4e6d0908 rkt: Add GetPodStatus(), GetPodStatusAndAPIPodStatus().
Also add ConvertPodStatusToAPIPodStatus().
Add tests for GetPodStatus().
2015-12-16 14:35:19 -08:00
Derek Gonyeo 5a16b4751b rkt: rewrote GetPods to use rkt's api service
This involved adding annotations to the rkt pod's manifest that contain
information about the kubernetes pod, which is later read by the
kubelet.
2015-12-09 14:43:50 -08:00
Derek Gonyeo 7ae6bf9d39 rkt: rewrote ListImages to use rkt's API service 2015-12-04 11:25:56 -08:00