Commit Graph

203 Commits (9b85d20c73e14f76ed30a13270d1e9a77c6c83ab)

Author SHA1 Message Date
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
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
Yifan Gu 9d5bcf4251 rkt: Add tests for GarbageCollect(). 2016-05-13 15:13:52 -07:00
Yifan Gu 06b1955c4a rkt: Refactor GarbageCollect() to enforce GCPolicy.MaxContainers. 2016-05-13 15:12:36 -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
Robert Bailey b274c5b7de Merge pull request #24843 from derekwaynecarr/graceperiod_override
Allow KillPod to take a gracePeriodOverride
2016-05-06 15:17:56 -07:00
derekwaynecarr 7bab6999d4 Allow KillPod to take a gracePeriodOverride 2016-05-06 12:14:43 -04:00
Yifan Gu 36f3185223 rkt: When host port is zero, we should not forward the port. 2016-05-04 19:02:39 -07:00
feisky 831203c19b Remove RunInContainer interface in Kuberlete Runtime interface 2016-05-01 20:21:15 +08:00
Abhishek Shah 8a3ed48808 Added Hostname and Subdomain field to Pod.Spec 2016-04-28 10:56:56 -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
k8s-merge-robot cf38d68734 Merge pull request #23595 from vishh/image-accounting
Automatic merge from submit-queue

Collect and expose runtime's image storage usage via Kubelet's /stats/summary endpoint

This information is useful to users since docker images are typically not stored on the root filesystem.

Kubelet will also consume this feature in the future to decide is evicting images will help with disk usage on the nodes.

cc @kubernetes/sig-node
2016-04-25 21:34:30 -07: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
Euan Kemp 941caa1372 rkt: Pass through os argument
This was lost in a rebase in #24496 and, while not required to build, is
required to function correctly.
2016-04-25 12:56:25 -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
k8s-merge-robot 61c0424b27 Merge pull request #24301 from yifan-gu/host_net
Automatic merge from submit-queue

rkt: Fix hostnetwork.

Mount hosts' /etc/hosts, /etc/resolv.conf, set host's hostname
when running the pod in the host's network.

Fix #24235 

cc @kubernetes/sig-node
2016-04-15 13:59:27 -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 f64c47ef80 rkt: Use rkt pod's uuid as the systemd service file's name.
Previously, the service file's name is 'k8s_${POD_UID}.service',
which means we need to `systemctl daemon-reload` if the we replace
the content of the service file (e.g. pod is restarted).

However this makes the journal in the previous pod get disconnected.

This PR solves the issue by using the unique rkt uuid as the service
file's name. After the change, the service file's name will be:
'k8s_${rkt_uuid}.service'.
2016-04-14 18:42:44 -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
k8s-merge-robot 6a87dba0b8 Merge pull request #22733 from resouer/flow-control
Automatic merge from submit-queue

Add flow control pkg

minor fix ref #15634
Refactor pkg names in back off related files
2016-04-11 06:18:51 -07:00
harry 5fe773d37c Add flow control pkg
Refactor pkg names in flow control related files
2016-04-03 11:28:03 +08:00
Wlodzimierz Borkowski 378ef9746e keep deprecated flag stage1-image with rkt 2016-04-01 09:32:10 +02: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
saadali 79012f6d53 Rename volume.Builder to Mounter and volume.Cleaner to Unmounter 2016-03-25 11:29:58 -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
Brian Grant c6b4518aed Merge pull request #22666 from pmorie/pod-ip-flake-redux
Fix flake in pod IP as env var e2e
2016-03-11 09:42:40 -08:00
Andy Goldstein 7230bd1096 Fix rkt GetPods() order
Use an array to store the pod IDs and use that to build the pod array with consistent ordering,
instead of map ordering, which is random and causes test flakes.
2016-03-11 12:32:22 -05:00
Paul Morie 5194c12d9e Fix flake in pod IP as env var e2e 2016-03-10 16:32:03 -05: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
k8s-merge-robot fa0bf812d6 Merge pull request #22467 from Random-Liu/push-down-runtime-version-check
Auto commit by PR queue bot
2016-03-05 22:34:19 -08:00
k8s-merge-robot 357a9d1fdf Merge pull request #22033 from yifan-gu/rkt_get_status
Auto commit by PR queue bot
2016-03-05 10:46:47 -08:00
Random-Liu 07b21c50fa Add Status in runtime interface and use it for runtime health check. 2016-03-04 21:26:41 -08:00
Yifan Gu 168ec8b80f kubelet: Sort the container statuses in convertStatusToAPIStatus(). 2016-02-26 11:27:03 -08:00
Yifan Gu 2d2225414f rkt: fix KillPod() to return the correct error message. 2016-02-22 17:07:31 -08:00
k8s-merge-robot a2086d4150 Merge pull request #20816 from yifan-gu/termination_log_anno
Auto commit by PR queue bot
2016-02-10 00:26:48 -08:00
k8s-merge-robot 2ec49efd54 Merge pull request #19945 from Clarifai/fix-formatting
Auto commit by PR queue bot
2016-02-09 16:05:00 -08:00
Yifan Gu b14ac9481a rkt: Add hyphen in the annotation key. 2016-02-09 14:50:25 +08:00
Yifan Gu 8964469e4a rkt: Remove ShouldContainerBeRestartedOldVersion(). 2016-02-09 00:15:58 +08:00
Yifan Gu 8e5c14f1bf rkt: Annotation key should not container capital letters. 2016-02-09 00:13:08 +08:00
Random-Liu 2b7d0182ca Remove ConvertPodStatusToAPIPodStatus from runtime interface 2016-02-05 19:19:46 +00:00