-
Notifications
You must be signed in to change notification settings - Fork 748
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
Add hostPort support #144 #153
Conversation
2367b39
to
3a6fbec
Compare
I built and installed this in my cluster. Seem to work! 👍 Thank you very much for this! To be more clear about it working, I'm running an Nginx pod using |
Would love to see this merged in, this is actually a pretty big blocker for our team on EKS 😄 👍 |
@igorvpcleao Thank you for submitting this PR.
|
@liwenwu-amazon Sure. We need to create a pod and then set the Here you are a manifest for an app which replies If the node security group is open to where you are performing the request, via internet, you may run something like:
Or you can ssh to a node from within your Kubernetes cluster and make the request:
Where |
@igorvpcleao Thanks for providing the test scenario. I have one question: After I did
From one of the Pod running in the same cluster, I am able to get response from Pod using Pod's IP
In summary, I am able to reach Pod using Pod's IP and its container port. I am curious to know what's the use cases you need to use hostport? thanks |
@liwenwu-amazon The use-case is Ingress. For us it would be required to expose 80/443 on the instance to an end-user-facing NLB. |
Same use case here. Our clients require a whitelisted IP address to connect to. So we run a tcp proxy on an instance with an AWS EIP that just forwards to an AWS ALB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! We're moving a few things around before the next release, and we'll be copying CNI plugins (including portmap) from an init container (See #158). For now, could you remove the portmap download and copy but keep the configuration changes?
@@ -17,6 +17,15 @@ | |||
VERSION ?= $(shell git describe --tags --always --dirty) | |||
LDFLAGS ?= -X main.version=$(VERSION) | |||
|
|||
# Download portmap plugin | |||
download-portmap: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently bake CNI binaries in our AMI, but we should really put this process in an init container (See #158).
Can you remove this for now?
cp /app/aws-cni /host/opt/cni/bin/ | ||
cp /app/portmap /host/opt/cni/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this?
COPY misc/aws.conf /app | ||
COPY misc/10-aws.conflist /app | ||
|
||
COPY portmap /app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micahhausler Sure, I removed my last commit. It only handled portmap plugin. Let me know if you need further changes.
@liwenwu-amazon Sometimes it may be a little hard to handle requests from outside the cluster when we have stateful applications, mainly when using UDP. |
Hi @micahhausler, Let me know if you need any further changes. Best, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you test the upgrade? In another word, what happens when the new docker CNI image is loaded onto an existing worker? thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay, one more small change
scripts/install-aws.sh
Outdated
cp /app/aws-cni /host/opt/cni/bin/ | ||
cp /app/aws-cni-support.sh /host/opt/cni/bin/ | ||
cp /app/aws.conf /host/etc/cni/net.d/ | ||
cp /app/10-aws.conflist /host/etc/cni/net.d/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove aws.conf
if it already exists? The file will already be there on existing systems where this is an upgrade.
if [[ -f /host/etc/cni/net.d/aws.conf ]]; then
rm /host/etc/cni/net.d/aws.conf
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micahhausler sure. I can submit it in a second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micahhausler done. Let me know if you want me to write a comment about it.
@micahhausler will this PR be compatible with the current CNI release or blocked behind the changes in #158? Lack of hostPort functionality is a blocker for us to migrating to this CNI plugin. |
@igorvpcleao please also rebase your change. |
@liwenwu-amazon done. |
@igorvpcleao thanks! Testing your PR now... |
@igorvpcleao For some reason, with this PR, I am NOT able to create any Pod. Let me try again with top of tree to see if this is my environment issue Are you able to test your PR ? |
@liwenwu-amazon I think it's because in this PR we do not have the portmap plugin anymore, as it was describe at #158. |
@liwenwu-amazon Is the init container from #158 already available? |
@igorvpcleao No, it is not available yet. |
@igorvpcleao can you revert the change back to your original commit, so host port will work just by this PR. When we working on #158 , we can do same logic for portmap plugin. thanks |
@liwenwu-amazon Sure! I've just added it again. We just need to be aligned with @micahhausler about it. |
@igorvpcleao can you rebase your change and make change in |
@liwenwu-amazon Sure! Sorry for my delay. What changes do you want to be made on |
@igorvpcleao Sorry, you don't need to change to config/v1.2. Can you rebase and squash all of your commits into 1 single commit? Once you do that, I will kick off testing. thanks |
@liwenwu-amazon No problem. Yep, It's done on #ee54500bc2c79c5731066d71286411a490b01b10. Let me know if you have any problem. |
@igorvpcleao Thanks! Starting testing it now. Once it passed conformance test, I will add it back to 1.2. thanks |
This PR adds support to hostPort.
Design decisions to de discussed:
amazon-vpc-cni-k8s
image itself or by modifying amazon-vpc-cni manifests on Kops, adding a new image to perform a slightly different installation, for instance.github.com/containernetworking/plugins/releases