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
ability to enable cni portmap plugin #3016
Comments
Something like this |
Yeah but it's dont work :/ |
Any more details? |
Yes sorry :)
And restart kubelet and cni pod |
You can't run with just a portmap plugin; you need a network too. By analogy to the example I pointed to, for Weave Net it would look something like:
caution: I haven't tried this |
this conflist ovewrite other conf file ? it's not realy clear for me :) I'll give a try this night |
Yes, Kubernetes will only read one CNI config file, the first one it comes to (probably in alphanumeric order) |
@bboreham I tried the following, but this sadly did not work:
I'm using https://gist.github.com/nicolai86/abfda3b82ec2ba6b4eac788a68c5ff86 as an example to test if |
I have made somme mistake on my post "cniVersion" is "0.3.1" ( protocol version ) it's not work
|
\o/ working :)
|
@ekozan can you -vvv your steps a little? download portmap and save your content to /etc/cni/net.d/10-mynet.conflist? |
@bboreham Will writing this new CNI spec happen automatically in the future? |
@luxas that would be best, yes. Need to think about how to detect if the user has the portmap plugin installed (or provide a way for Weave Net to install it). PRs welcome 🙂 |
Maybe just do something like hit |
full step
Enjoy |
@ekozan thank you for the steps. |
@luxas as I see it two things are key:
The API server version doesn't indicate either of these things. I don't think there is a published API to get the kubelet version. I think at present we would need a manual switch for the operator to turn on if they are sure the prerequisites are met. |
FTR, I got this working without requiring
On a node with working kubectl (e.g. the master), run:
Note: if the |
@lukemarsden why you need to restart all pods in |
@Bregor I was just copying #3016 (comment) 😄 I'm not sure what you need to delete exactly to "restart CNI", would be good if you could run some tests to find out? |
Restarting pods has no effect on CNI. I might have expected you need to restart kubelet, but if not, that's cool. |
@lukemarsden, @ekozan which kubernetes version did you use? I use kubernetes-1.6.8 with no success at all. I tried following CNI + Plugins combinations:
Also tried all combinations above with weave-1.9.8 and 2.0.1. No success at all. Events:
Kubelet logs:
Contents of {
"cniVersion": "0.3.0",
"name": "weave",
"plugins": [
{
"name": "weave",
"type": "weave-net",
"hairpinMode": true
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
},
"snat": true
}
]
} What am I doing wrong?.. |
Ah, nevermind. |
@bboreham when I run the kube add-on, it automatically generates Short of giving it a lower number (higher priority), is there any way to get it to not generate Conversely, if there were a way to tell the add-on to add the You mentioned earlier that it has an issue detecting; this would give at least a partial resolution. |
@bboreham I see you tagged "help wanted" on here. Do you have any thoughts how you would solve this? I'm using I'm wondering if this needs to be a combined fix between |
With latest releases of kops My guess is we might have to change this check/add portmap to the list @dtshepherd let me know if you would like to give it a try, otherwise I am happy make the change in Kops. |
Not really. Probably the whole thing needs taking apart and doing again. The current implementation is a bit minamalist and simplest-thing-that-works. If I remember correctly, at the time nobody was installing add-ons purely by running a daemonset; the state of the art was to modify the Kubernetes in-tree saltstack. The inside of a DameonSet is a terrible place to make decisions about what is installed and where. To that extent, places like kops and kubeadm are much better. |
The problem with places outside is that they are, well, outside. There is something great about it all just being in a single FWIW, the last installation I did was a mix of the initContainers:
# set up our correct conflist in /etc/cni/net.d
- name: init-conflist
image: busybox
command: ['sh','-c','mkdir -p /host/etc/cni/net.d/ && cp /conf/00-weave.conflist /host/etc/cni/net.d/']
volumeMounts:
- name: cni-conf
mountPath: /host/etc
- name: config-volume
mountPath: /conf Where the {
"cniVersion": "0.3.0",
"name": "mynet",
"plugins": [
{
"name": "weave",
"type": "weave-net",
"hairpinMode": true
},
{
"type": "portmap",
"capabilities": {"portMappings": true},
"snat": true
}
]
} I rely on the ordering of numbers |
@murali-reddy Yes, it is a one-liner change in that file but we also need to update the weave install template for kops (https://github.com/kubernetes/kops/blob/master/upup/models/cloudup/resources/addons/networking.weave/k8s-1.6.yaml.template). However, it would be nice for weave to support generating the @bboreham As an initial rework to weave, could we do something similar to |
configmap fine as long as it's optional. It was so long ago when I did it, optional configmaps didn't exist in Kubernetes... |
Yeah the optional configmaps are nice. So maybe implement the logic "if cni configmap exists, use it... otherwise, default to the hardcoded 10-weave.conf. |
So kubernetes/kops#5474 this will only cover kops side of things. Still weave need to create |
…r portmap as additional plugin along with weave-net Fixes #3016
…r portmap as additional plugin along with weave-net Fixes #3016
…ile. Also adds support for portmap as additional plugin along with weave-net Fixes #3016
…ile. Also adds support for portmap as additional plugin along with weave-net Fixes #3016
…ile. Also adds support for portmap as additional plugin along with weave-net Fixes #3016
Hello, Do you know this version will be publish to DockerHub. Lastest (git-ad4e4238a5d5) still provides non portmap 10-weave.conf Can't wait to test it ! |
I have a lab for this puposal running Containerd (1.2.0-Beta.2) and Docker (17.03.2) along with Kubernetes 1.11.2.
|
@fjudith Great! Please use the image |
That is exactly why I'd go with an at least in part backwards compatible version if you're going to remove the |
…ile. Also adds support for portmap as additional plugin along with weave-net Fixes #3016
Ok. that make sense. That might work. As you say its worth the effort to try out. Let me test out and see if can make both forward and backward compatible. |
I tested out my PR #3356 again from the perspective of backward compatibility. There is nothing in particular need to be done. When upgrade is done to new release |
Hi,
Can you add the possibility of enable portmap plugin on all host on kubernetes
This will solve the hostport problems
Regards :)
The text was updated successfully, but these errors were encountered: