Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host-ctr: remove KillMode=mixed and don't create the container task under the unit's cgroup #1242

Merged
merged 2 commits into from
Dec 15, 2020

Conversation

etungsten
Copy link
Contributor

Issue number:
Fixes #1237

Description of changes:

Author: Erikson Tung <etung@amazon.com>
Date:   Fri Dec 4 14:31:26 2020 -0800

    host-containers@: remove KillMode=mixed
    
    We don't need systemd to go and actively try kill all processes
    of the unit's cgroup.

Author: Erikson Tung <etung@amazon.com>
Date:   Mon Dec 14 13:47:04 2020 -0800

    host-ctr: don't create the container task under the service's cgroup
    
    We no longer need to launch the host container task under the systemd
    service unit's cgroup. We're managing the life-cycle of the host
    container directly without the help of systemd

Testing done:
Built aws-k8s-1.17 x86 ami and launched instance.
Restarting host-containerd doesn't kill any running host-containers as expected.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

We no longer need to launch the host container task under the systemd
service unit's cgroup. We're managing the life-cycle of the host
container directly without the help of systemd
We don't need systemd to go and actively try kill all processes
of the unit's cgroup.
@etungsten etungsten changed the title host-ctr: remove KillMpde=mixed and don't create the container task under the unit's cgroup host-ctr: remove KillMode=mixed and don't create the container task under the unit's cgroup Dec 15, 2020
@bcressey
Copy link
Contributor

Which cgroup are the tasks created under now? Still host-containerd's, or something else?

@etungsten
Copy link
Contributor Author

Which cgroup are the tasks created under now? Still host-containerd's, or something else?

They're all launched under host-containerd's cgroup:

● host-containerd.service - containerd runtime for host containers
     Loaded: loaded (/x86_64-bottlerocket-linux-gnu/sys-root/usr/lib/systemd/system/host-containerd.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-12-15 06:13:18 UTC; 1min 8s ago
       Docs: https://containerd.io
   Main PID: 2928 (containerd)
      Tasks: 34
     Memory: 685.3M
     CGroup: /system.slice/host-containerd.service
             ├─2928 /usr/bin/containerd --config /etc/host-containerd/config.toml
             ├─3660 /x86_64-bottlerocket-linux-gnu/sys-root/usr/bin/containerd-shim-runc-v2 -namespace default -id control -address /run/host-containerd/containerd.sock
             ├─3736 /usr/bin/amazon-ssm-agent
             ├─3836 /x86_64-bottlerocket-linux-gnu/sys-root/usr/bin/containerd-shim-runc-v2 -namespace default -id admin -address /run/host-containerd/containerd.sock
             ├─3858 /usr/sbin/sshd -e -D
             ├─3961 sshd: ec2-user [priv]
             ├─3972 sshd: ec2-user@pts/0
             ├─3974 -bash
             ├─4017 sudo sheltie
             ├─4018 nsenter -t 1 -a /proc/4017/root/opt/bin/bash
             ├─4019 /proc/4017/root/opt/bin/bash
             ├─4401 systemctl status host-containerd
             └─4402 more

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏐

@etungsten etungsten merged commit 989bcbf into bottlerocket-os:develop Dec 15, 2020
@etungsten etungsten deleted the host-ctr-cgroup branch December 15, 2020 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

host-ctr: don't try to create the container under the systemd unit's cgroup
4 participants