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

models: add restart-commands for docker, kubelet, containerd #1231

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

etungsten
Copy link
Contributor

Issue number:
N/A

Description of changes:

Author: Erikson Tung <[email protected]>
Date:   Thu Dec 3 12:17:30 2020 -0800

    models: add restart-commands for docker, kubelet, containerd
    
    Add `restart-commands` for `services.kubernetes`, `services.docker`,
    `services.containerd`, `services.host-containerd`.

Testing done:

Testing kubelet restarts for kubernetes variants:

  1. Launched several nodes with built AMI
  2. Applied the bottlerocket update operator on all nodes.
  3. Waited for all the agent pods and the controller pods to start running
  4. Set settings.kubernetes.max-pods to 29 to kick off the restart-command for services.kubelet
  5. sudo sheltie'd and checked kubelet.service and saw that it restarted successfully.
  6. Checked the agent pods and controller pod via kubectl and saw them all still running and outputting logs with the same name

Testing containerd restarts for kubernetes variants:

  1. Launched several nodes with built AMI
  2. Applied the bottlerocket update operator on all nodes.
  3. Waited for all the agent pods and the controller pods to start running
  4. Set settings.kubernetes.pod-infra-container-image to "gcr.io/google-containers/pause-amd64:3.2" to kick off the restart-command for services.kubelet AND services.containerd
  5. sudo sheltie'd and checked kubelet.service containerd.service and saw that both restarted successfully.
  6. Checked the agent pods and controller pod via kubectl and saw them all still running and outputting logs with the same name

Testing docker restarts for ECS variants:

  1. Launched an ECS instance
  2. Ran a simple ECS task that simply started an nginx server with host networking.
  3. Got into the admin container as curl'ed localhost:80 and saw nginx running successfully.
[ec2-user@ip- ~]$ curl localhost:80
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
  1. sudo sheltie'd and ran systemctl try-restart docker.service to simulate a docker restart due to settings/configuration file change
  2. curl'd localhost:80 and saw nginx is still running fine.
  3. Checked ECS console and saw the task still running fine.

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.

Add `restart-commands` for `services.kubernetes`, `services.docker`,
`services.containerd`, `services.host-containerd`.
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.

🎄

Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

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

Nice testing.

@etungsten etungsten merged commit ccc864a into bottlerocket-os:develop Dec 4, 2020
@etungsten etungsten deleted the restart-commands branch December 4, 2020 20: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.

5 participants