Commit Graph

125 Commits

Author SHA1 Message Date
Harshal Patil
effd82227c Add support for passing sandbox annotations to runtime
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
2019-03-21 14:38:14 +05:30
Lantao Liu
9eabcf525e Add an OCI annotation for sandbox log directory.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-06 16:43:36 -08:00
Lantao Liu
b2cd840042
Merge pull request #1045 from Random-Liu/fix-env-performance-issue
Fix env performance issue
2019-02-12 11:03:33 -08:00
Lantao Liu
89717d0b63 Don't log config at info level.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 02:07:53 -08:00
Lantao Liu
089d4fbfb8 Set /etc/hostname.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 00:18:00 -08:00
Lantao Liu
bfd25c80b4 Change StateUnknown to StateInit
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-04 11:24:49 -08:00
Lantao Liu
0fa8668aa4
Merge pull request #970 from AkihiroSuda/rootless
support DisableCgroup, DisableApparmor, RestrictOOMScoreAdj
2019-01-03 10:14:22 -08:00
Hui Zhu
3bfef01589 Fix the issue that pod or container config file without metadata will crash containerd
Because RunPodSandbox and CreateContainer will access metadata
without check, pod or container config file without metadata will
crash containerd.

This patch add checks to handle the issue.

Fixes: #1009

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-01-03 11:02:10 +08:00
Akihiro Suda
cd8231ab2a support DisableCgroup, DisableApparmor, RestrictOOMScoreAdj
Add following config for supporting "rootless" mode

* DisableCgroup: disable cgroup
* DisableApparmor: disable Apparmor
* RestrictOOMScoreAdj: restrict the lower bound of OOMScoreAdj

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-01-03 05:12:04 +09:00
Mike Brown
f8e89f71a9 adds cni results to verbose pod info
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-11-26 15:57:00 -06:00
Lantao Liu
c1740d8291 Manage mount lifecycle and remove cached state
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-24 11:00:25 -07:00
Starnop
22a8777a9e refactor: setup network after get Sandbox runtime
Signed-off-by: Starnop <starnop@163.com>
2018-10-17 16:35:45 +08:00
Lantao Liu
1442425f92 Support runtime specific configurations.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-08 17:17:29 -07:00
JulienBalestra
27f33cd4d6
cni result: add a debug message
Signed-off-by: JulienBalestra <julien.balestra@datadoghq.com>
2018-10-03 17:19:51 +02:00
Lantao Liu
4b45e16a4b Show runtime handler in sandbox debug info.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-16 21:27:51 -07:00
Lantao Liu
f540c2a74d Skip sctp protocol hostport mapping.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-11 16:32:15 -07:00
Tim Allclair
e7189a25c3
Add RuntimeHandler support
Signed-off-by: Tim Allclair <tallclair@google.com>
2018-09-05 17:27:35 -07:00
Eric Ernst
9a01272dc2 sandbox: separate host accessing workload and privileged
VM isolated runtimes can support privileged workloads. In this
scenario, access to the guest VM is provided instead of the host.
Based on this, allow untrusted runtimes to run privileged workloads.

If the workload is specifically asking for node PID/IPC/network, etc.,
then continue to require the trusted runtime.

This commit repurposes the hostPrivilegedSandbox utility function to
only check for node namespace checking.

Fixes: #855

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2018-07-22 16:51:22 -07:00
yanxuean
7065dd81f9 support no_pivot option for runc
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2018-07-20 08:46:50 +08:00
Filipe Brandenburger
01d77d44f5 Update github.com/opencontainers/runtime-tools to v0.6.0
Also add new dependencies on github.com/xeipuuv/gojson* (brought up by
new runtime-tools) and adapt the containerd/cri code to replace the APIs
that were removed by runtime-tools.

In particular, add new helpers to handle the capabilities, since
runtime-tools now split them into separate sets of functions for each
capability set.

Replace g.Spec() with g.Config since g.Spec() has been deprecated in the
runtime-tools API.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2018-06-20 13:52:50 -07:00
Lantao Liu
53f1ab4145 Fix double /dev/shm mount.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-06-14 19:03:19 -07:00
Lantao Liu
46d621e4ac Support Cmd for sandbox container.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-06-12 14:38:55 -07:00
Lantao Liu
83e6b65566 Select ipv4 first if there is one.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-06-05 18:25:03 +00:00
Evan Hazlett
d7d2212324 vendor bump
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

containerd: linux -> runtime/linux

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

fix utils to properly format vendor repo

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

test fixup

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-05-30 19:51:24 -04:00
Kir Kolyshkin
daeab40b45 os.Unmount: do not consult mountinfo, drop flags
1. Currently, Unmount() call takes a burden to parse the whole nine yards
of /proc/self/mountinfo to figure out whether the given mount point is
mounted or not (and returns an error in case parsing fails somehow).

Instead, let's just call umount() and ignore EINVAL, which results
in the same behavior, but much better performance.

This also introduces a slight change: in case target does not exist,
the appropriate error (ENOENT) is returned -- document that.

2. As Unmount() is always used with MNT_DETACH flag, let's drop the
flags argument. This way, the only reason of EINVAL returned from
umount(2) can only be "target is not mounted".

3. While at it, remove the 'containerdmount' alias from the package.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-30 12:54:10 -07:00
Lantao Liu
ed20174ce4 Add RunAsGroup support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-30 22:26:07 +00:00
Lantao Liu
f4c9ef2647 Add symlink follow into unmount util.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-24 01:25:31 +00:00
Mike Brown
94df315de8 adds volatile state directory to the fs plan for cntrs/pods/fifo
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-03-24 00:05:52 +00:00
Lantao Liu
ca67f94ee0 Address comments for privileged runtime code.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-23 02:17:46 +00:00
Jose Carlos Venegas Munoz
ca16bd601a runtime: Add trusted runtime option
Some CRI compatible runtimes may not support provileged operations.
Specifically hypervisor based runtimes (like kata-containers, cc-runtime
and runv) do not support privileged operations like:

- Provide access to the host namespaces
- Create fully privileged containers with access to host devices

Hypervisor based runtimes create container workloads within virtual machines.
When a running host privileged containers using them,
they wont provide support to requested the privileged opertations.

This commits add the new options to define two runtimes:

Trusted runtime : Used when a privileged container is requested.
Default runtime : for non-privileged workloads.

A container that belongs to a privileged pod will inherent this property
an will be created with the trusted runtime.

- Add options to define trusted runtime
- Add logic to decide if a sanbox is trusted
- Export annotation containers below to a trusted sandbox

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-03-20 13:56:49 -06:00
Lantao Liu
387da59ee5 Rename all variables to remove "cricontainerd".
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-19 21:59:32 +00:00
Lantao Liu
e1fe1abff0 Use github.com/pkg/errors
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-17 02:24:38 +00:00
abhi
2bdf428eb7 Removing DAD config and updating plugins to v0.7.0
Signed-off-by: abhi <abhi@docker.com>
2018-03-16 14:46:46 -07:00
abhi
003bbd4292 Modifying fake cni plugin
Signed-off-by: abhi <abhi@docker.com>
2018-03-15 17:05:33 -07:00
abhi
92110e1d74 Moving to use go-cni library from containerd
This fix aims to use the cni library form containerd.
The library avoid usage of nsenter.

Signed-off-by: abhi <abhi@docker.com>
2018-03-14 19:25:54 -07:00
Mike Brown
d4e7154625 move links for cri-containerd to cri
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-03-13 17:06:26 -05:00
Lantao Liu
f01c6d73a6 Fix cleanup context.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-07 07:05:27 +00:00
Lantao Liu
46fc92f65f Use new namespace mode and support shared pid namespace.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-08 03:10:57 +00:00
Lantao Liu
d113c16802 Update ocicni to my fork.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-02 19:45:26 +00:00
Lantao Liu
df58d6825d Avoid containerd access as much as possible.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-25 23:36:00 +00:00
Lantao Liu
2b6f084f36 Disable IPv6 dad by default.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-22 23:54:16 +00:00
Lantao Liu
3d68005c04 Replace glog with logrus
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-17 21:57:31 +00:00
Jose Carlos Venegas Munoz
b383b0261a Annotations: Provide container metadata for VM based runtimes
For hypervisor-based container runtimes (like Kata Containers, Clear Containers
or runv) a pod will be created in a VM and then create containers within the VM.

When a runtime is requested for container commands like create and start, both
the instal "pause" container and next containers need to be added to the pod
namespace (same VM).

A runtime does not know if it needs to create/start a VM or if it needs to add a
container to an already running VM pod.

This patch adds a way to provide this information through container annotations.
When starting a container or a sandbox, 2 annotations are added:

- type (Container or Sandbox)
- sandbox name

This allow to a VM based runtime to decide if they need to create a pod VM or
container within the VM pod.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-01-17 09:57:20 -06:00
Lantao Liu
025ffe551f Rename kubernetes-incubator/cri-containerd to containerd/cri-containerd.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-10 22:35:33 +00:00
Lantao Liu
aee7a366f3
Merge pull request #525 from abhi/cniip
Caching IP allocated by CNI plugin
2018-01-05 00:27:48 -08:00
abhi
f1dbc0b375 Caching IP allocated by CNI plugin
Signed-off-by: abhi <abhi@docker.com>
2018-01-04 20:00:55 -08:00
Lantao Liu
31bc964195 Enable HostSpecific option in runtime-tools generator.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-03 19:04:47 +00:00
Mike Brown
31223fd5b1 adds oci image spec to image info placed into imagestore
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2017-12-12 15:58:07 -06:00
abhi
43c05efb22 Revert: Setting containerd shim cgroup same as pod cgroup
Signed-off-by: abhi <abhi@docker.com>
2017-12-01 16:03:38 -08:00
Lantao Liu
181d7d5076 Move shim cgroup opts to pkg/containerd/opts.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-12-01 19:18:26 +00:00