Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

docs: Clean up k8s with cri-containerd howto#251

Merged
grahamwhaley merged 1 commit into
kata-containers:masterfrom
jodh-intel:improve-k8s+cri-containerd-howto
Oct 4, 2018
Merged

docs: Clean up k8s with cri-containerd howto#251
grahamwhaley merged 1 commit into
kata-containers:masterfrom
jodh-intel:improve-k8s+cri-containerd-howto

Conversation

@jodh-intel
Copy link
Copy Markdown

This PR is based on #124 but has been reworked and updated to take into
account review feedback and extra cleanups to bring this howto in line
with the latest documentation requirements.

Fixes #127.

Contributions-from: T. Nichole Williams tribecca@tribecc.us
Signed-off-by: James O. D. Hunt james.o.hunt@intel.com

@jodh-intel jodh-intel force-pushed the improve-k8s+cri-containerd-howto branch from 184a293 to 34ad1e3 Compare September 24, 2018 11:10
@jodh-intel jodh-intel mentioned this pull request Sep 24, 2018
@jodh-intel
Copy link
Copy Markdown
Author

A couple of points on this PR:

@OGtrilliams - ptal! ;)

@jodh-intel jodh-intel force-pushed the improve-k8s+cri-containerd-howto branch from 34ad1e3 to 2325113 Compare September 24, 2018 11:14
Copy link
Copy Markdown
Contributor

@grahamwhaley grahamwhaley left a comment

Choose a reason for hiding this comment

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

Overall looking good to me. thanks for picking this up @jodh-intel Just a few minor questions.


For information about the supported version of these components see
Kata Containers [versions.yaml](https://github.com/kata-containers/runtime/blob/master/versions.yaml) file.
**Note:** For information about the supported versions of these components,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be an > indented note as per our guidelines

If you are behind a proxy, use the following script to configure your proxy for docker, kubelet, and containerd:

```bash
# Set proxys
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if coding this as a #!/bin/bash script here will make it easier for a cut/paste for the user. I know we don't tend to do that for other inline scripts, so am happy to leave as is as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point - I've simplified that block to not require bash now.


$ export KUBECONFIG=/etc/kubernetes/admin.conf
```bash
$ sudo iptables -P FORWARD ACCEPT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ideally I'd like a touch more info around what this is fixing, how, and why it's not a gaping security hole (or, a caveat note if it is ;-) ).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Well, this PR is for reworking the formatting but I'm happy to take input from @jcvenegas with more details... :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jodh-intel this is used for the case that docker is installed in the node, docker set iptables rules that not allow containers communication, the issue is kubernetes/kubernetes#40182

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I did not test if this is not needed anymore, but keep as legacy from our initial k8s installation script.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @jcvenegas - branch updated.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@grahamwhaley, @jcvenegas - can you provide some suitable "security hole or not" words I can add?

/cc @mcastelino.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Phew. Well, that thread over on kubernetes/kubernetes#40182 shows some less broad-spectrum fixes, and also points to what look like two supported solutions:
containernetworking/plugins#75
kubernetes/kubernetes#52569

From reading the thread, it seems the above fix as is is only transient, and not 'sticky' over reboots as well. I think we should say something like:

For testing, temporarily apply the following rule. Please see thread https://github.com/kubernetes/kubernetes/issues/40182 for more details on how to configure the k8s networking to route Docker traffic on your system.

But, let's get some feedback on if that is the right thing...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We didn't resolve this. I'm not happy with it as is, as it applies a broad spectrum port forwared/allow, which is then not sticky. We need a decision. /cc @mcastelino @egernst .

- Create a pod network using flannel

### Allow run pods in master node
**Note:** There is not a programmatic way to know last what flannel commit use. See https://github.com/coreos/flannel/issues/995.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/not a/no/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yoda speak I read this: know last what flannel commit use (and how can there be no :yoda: emoji!) ;-)

If a pod has the `io.kubernetes.cri.untrusted-workload annotation` set as
`"true"`, the CRI plugin will run the pod with the Kata Containers runtime.
sleep 1s
((timeout_dns-=1))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tiddly nit - I think you can use ((timeout_dns--)) here :-)

@jodh-intel jodh-intel force-pushed the improve-k8s+cri-containerd-howto branch from 2325113 to ed60798 Compare September 24, 2018 13:14
@jodh-intel
Copy link
Copy Markdown
Author

Hi @grahamwhaley - good catches! Branch updated ;)

@jodh-intel
Copy link
Copy Markdown
Author

Ping @egernst, @jcvenegas, @chavafg, @sboeuf - ptal y'all!

Copy link
Copy Markdown
Member

@jcvenegas jcvenegas left a comment

Choose a reason for hiding this comment

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

Thanks looks much better!. Let me rerun this new docs locally to verify all works

@jodh-intel jodh-intel force-pushed the improve-k8s+cri-containerd-howto branch from ed60798 to e651f4c Compare September 24, 2018 15:02
@jodh-intel
Copy link
Copy Markdown
Author

Hi @klynnrif and @kata-containers/documentation - ptal.

Copy link
Copy Markdown

@klynnrif klynnrif left a comment

Choose a reason for hiding this comment

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

Scrubbed for grammar, structure, and flow. One small change and I'm all set :) Thanks!

- Create a pod network using flannel

By default, the cluster will not schedule pods in the master node to allow that run:
> **Note:** There is no known way to determine programmatically the best version (commit) of to use.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove "of": ...to determine programmatically the best version (commit) to use.

This PR is based on kata-containers#124 but has been reworked and updated to take into
account review feedback and extra cleanups to bring this howto in line
with the latest documentation requirements.

Fixes kata-containers#127.

Signed-off-by: T. Nichole Williams <tribecca@tribecc.us>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
@jodh-intel jodh-intel force-pushed the improve-k8s+cri-containerd-howto branch from e651f4c to 4cc9efe Compare October 1, 2018 07:35
@jodh-intel
Copy link
Copy Markdown
Author

Thanks @klynnrif - branch updated.

/test

Copy link
Copy Markdown

@klynnrif klynnrif left a comment

Choose a reason for hiding this comment

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

lgtm - thanks!

@grahamwhaley
Copy link
Copy Markdown
Contributor

@jcvenegas - did you check this still works - if so, please re-review :-)

Copy link
Copy Markdown
Member

@jcvenegas jcvenegas left a comment

Choose a reason for hiding this comment

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

It keeps working tested locally.

@jodh-intel
Copy link
Copy Markdown
Author

Hi @grahamwhaley - one ack from you and we can land this at long last :)

Copy link
Copy Markdown
Contributor

@grahamwhaley grahamwhaley left a comment

Choose a reason for hiding this comment

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

Still a couple of niggles.


Configure `containerd` to use the Kata runtime to run untrusted workloads by
setting the `plugins.cri.containerd.untrusted_workload_runtime`
[config option](https://github.com/containerd/cri/blob/v1.0.0-rc.0/docs/config.md):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The link here points to a specific, and old, version of containerd. Is that deliberate? Feels wrong. Probably should either point at the master branch - or the version that matches the one in your versions.yaml ? I vote for master.


$ export KUBECONFIG=/etc/kubernetes/admin.conf
```bash
$ sudo iptables -P FORWARD ACCEPT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We didn't resolve this. I'm not happy with it as is, as it applies a broad spectrum port forwared/allow, which is then not sticky. We need a decision. /cc @mcastelino @egernst .

@jodh-intel
Copy link
Copy Markdown
Author

Hi @grahamwhaley - the problem is, I didn't write this document. I understand we're trying to improve this, but I'm also worried that we're now reviewing even the bits of the doc that the original PR didn't touch.

I think we're going to have to therefore wait until someone with more intimate knowledge of this can help me out.

/cc @egernst, @mcastelino, @egernst maybe?

@jodh-intel
Copy link
Copy Markdown
Author

How about we use the usual compromise: I raise an issue for these outstanding niggles so we can atleast get the majority of these improvements landed? The overall issue has been outstanding for ~ 5 months now... :)

@grahamwhaley
Copy link
Copy Markdown
Contributor

OK, let's see if we can get some feedback from those pinged in the next 24h - otherwise we'll go the Issue-and-move-on pragmatic route.

@grahamwhaley
Copy link
Copy Markdown
Contributor

Feedback didn't materialise.... @jodh-intel - merging this, and let's open Issues for any remaining outstanding items.

@grahamwhaley grahamwhaley merged commit ec9f9d4 into kata-containers:master Oct 4, 2018
@jodh-intel
Copy link
Copy Markdown
Author

Thanks - #265 raised for the iptables query.

devimc pushed a commit to devimc/kata-documentation that referenced this pull request Sep 2, 2019
With the old code it was possible to see odd messages like:
"INFO: Create root disk image. Attempt 6 out of 5."

Move the attempt number print to after we check against the max

Fixes kata-containers#251

Signed-off-by: Matt Fischer <matt@mattfischer.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants