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

Service ports: expose customization for multi-tenancy #345

Closed
4 of 5 tasks
vsoch opened this issue Dec 4, 2024 · 9 comments · Fixed by #346
Closed
4 of 5 tasks

Service ports: expose customization for multi-tenancy #345

vsoch opened this issue Dec 4, 2024 · 9 comments · Fixed by #346

Comments

@vsoch
Copy link
Contributor

vsoch commented Dec 4, 2024

Hi @AkihiroSuda ! We are prototyping / preparing for a deployment of user space Kubernetes on our on-premises clusters this fiscal here. In addition to a Python wrapper that (so far) is working on AWS (headless) with flux, either as a system instance, or setup / teardown in a job:

$ flux run -N2 --setattr=attributes.user.usernetes=yes /bin/bash batch.sh 
flux-job: ƒ3SwLtzHu started                                                                                                                                                            00:02:03
Found kubeconfig at /tmp/usernetes-ƒ3swltzhu/kubeconfig
NAME                      STATUS   ROLES           AGE   VERSION
u7s-i-0348057d85534bdeb   Ready    <none>          31s   v1.31.2
u7s-i-056b730dd06cee178   Ready    control-plane   42s   v1.31.2

we are going to want to do the same on a system with multi-tenancy. This means that everyone using the same ports won't fly - and actually even the same user using the same ports won't! So I wanted to discuss / brainstorm with you about ways we can customize the various services to ensure they don't conflict. In HPC we often choose very high numbers too. Thank you!

Proposed plan: tackle each in separate pull request.

Items to do

@AkihiroSuda you can assign this issue to me - I can cover the remaining three bullets. I can also do #347.

@AkihiroSuda
Copy link
Member

The ports of kube-apiserver, kubelet, etc. can be customized via https://github.com/rootless-containers/usernetes/blob/master/docker-compose.yaml and https://github.com/rootless-containers/usernetes/blob/master/kubeadm-config.yaml

I agree that these ports should be configurable, probably via env vars

@vsoch
Copy link
Contributor Author

vsoch commented Dec 4, 2024

Yes exactly! Do you want me to take a shot at a PR this week / weekend?

@AkihiroSuda
Copy link
Member

Yes, thanks

@vsoch
Copy link
Contributor Author

vsoch commented Dec 4, 2024

Awesome! Ping @milroy - let's discuss what other envars we might want to tweak this week for our setup, and I'll follow up here with a pull request to continue discussion.

Thank you @AkihiroSuda 🙏

@vsoch
Copy link
Contributor Author

vsoch commented Dec 5, 2024

All set!

#346

And I had a follow up question in #347 - if there is a means to do that I can open a second PR (and do additional testing for it). We have tested connecting a control plane from EKS with a node they provide, but haven't tested Usernetes on EC2 with the same node (or a different strategy).

@vsoch vsoch changed the title Service ports: expose customization for multi-tenancy? Service ports: expose customization for multi-tenancy Dec 6, 2024
@vsoch
Copy link
Contributor Author

vsoch commented Dec 8, 2024

@AkihiroSuda I've finished work for this issue, and the PR #346 is ready for review, and checkboxes in the description above updated! Specifically:

  • We expose (and test) service ports for the kubelet, kube-apiserver, and etcd.
  • This required some redundancy of testing, so I refactored to add single and multi-node reusable templates
  • I decided to not expose flannel, because it's based on vxlan, and that's a Linux default.

For the last point, I read about the setup and my naive instinct is that we should not be customizing such a default, at least until there is a compelling need (e.g., different default on a different platform). If you'd like to do this I can follow your guidance, either for this PR or a later one.

Thanks again for the review! I learned a lot working on this and appreciate it.

@AkihiroSuda
Copy link
Member

VXLAN ports have to be changeable for supporting multi-tenancy

@vsoch
Copy link
Contributor Author

vsoch commented Dec 8, 2024

VXLAN ports have to be changeable for supporting multi-tenancy

Gotcha. Please see my questions in #346 (review). I think we have two options:

  1. Expose the ports for customization, assuming that someone doing so will know how to configure the vxlan.
  2. Also vendor the flannel yaml here, with the added Port variable customizable from the environment.

If we need to test this, I need to ask for your guidance on how to do that. Note that the current failure in the test looks like a flaky download for the fedora lima image, we can re-run it when the rest finish.

@vsoch
Copy link
Contributor Author

vsoch commented Dec 8, 2024

Flannel is added, and commits squashed #346.

The helm charts don't expose the variables we need (customizing args and the Port) so we clone the repository with the helm chart, write our custom values.yaml (with the changes we need) and then install from that. I thought we might need more system level changes, but it seems to work with that.

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 a pull request may close this issue.

2 participants