-
Notifications
You must be signed in to change notification settings - Fork 650
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
Enhance SONiC with kubernetes management commands #962
Conversation
Config commands: 1) sudo config kubernetes server ip <IP address> 2) sudo config kubernetes server insecure <True/False> 3) sudo config kubernetes server disable <True/False> 4) sudo config kubernetes label add <key> <value> 5) sudo config kubernetes label drop <key> 6) sudo config kubernetes join [-a/--async] [-f/--force] 7) sudo config kubernetes reset Show commands: 1) show kube server 2) show kube status 3) show kube nodes 4) show kube pods A python wrapper for kube_join for invocation by other tools.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This pull request introduces 1 alert when merging d36a167 into 38bff50 - view on LGTM.com new alerts:
|
This reverts commit d36a167.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The last/outstanding alerts from lgtm can be ignored. It looks like, the imports are unused, but they are used, through class method of click. |
@renukamanavalan: It appears the LGTM warnings are correct -- those imports are unused. You don't access the kube module in either the show/main.py or config/main.py files. Please remove those imports. |
Not really. of course I tested this code to work. Here is some high level insight: Test:
Precisely same with show too. The magic is from the class method of click. |
Main one: Handle the absence of admin.conf, which would not be present if node is not connected to the cluster yet.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
No logical code changes.
No logical code changes.
No logical code changes.
@renukamanavalan Do we need this in 201911 ? This seems to be enhancement. |
Apologies for the dumb question, is there a conversation about this change somewhere? |
Good question. There is a HLD review on this Tuesday (9/22). Please join. |
Thanks for the link. I only found SONiC a few days ago, rather innocently in a search for an OSS ONIE NOS and choosing SONiC by project momentum. When I realized it ran Docker, I was blown away. So I started searching for whether anyone had tried putting Kubelet on it. I am ecstatic to find your effort in this regard. My initial impressions is that "legacy SONiC" needs to be supported with The unifying aspect of these different control planes (ie systemd, Docker Swarm, Kubernetes) is they all use the Docker daemon socket for control. The If it's worth connecting over this before the HLD review, please don't hesitate to reach out here or on my email. |
Hi @briantopping, Yes, there is Docker Swarm and also OpenShift. The reasons, we picked Said that, the goal is to keep future adaptation to other technology/tool as simple as possible. If you look at the core design, it is still systemd that manages at service level. When it comes to down to docker level, it either runs docker command or instruct the remote system to start/stop/.... In Kubernetes, it controls it through labels and in docker swarm, it could be different. This is achieved by replacing docker commands with container commands as Guess, we don't have much time to connect, before community review, which is at PDT 8AM tomorrow. Please join. We can connect after that for the follow ups. |
Thanks for the updates, yes OpenShift and Rancher as well if you want to consider other Kubernetes-based distributions. I have a feeling that depending on As a user, I would like to see Kubernetes (or any orchestrator) run as unencumbered as possible. There is a lot of tribal knowledge baked into Kubernetes (for instance) and it's a nonzero possibility that the SONiC container orchestration team would miss one or more of these nuances as it tries to make k8s work through So instead, what if the I am thinking about the overall level of effort to get to a robust and bulletproof implementation that works across all the orchestrators you've named, especially in the face of future implementation changes that we cannot foresee today. If the I regret belaboring this point if you understood what I was talking about from the previous post. Just wanted to save time tomorrow when there is a bigger audience whose valuable time is a consideration. EDIT: Re-reading your current behavior link, I think I may understand that the "complex dependencies across features" requirement may be why it is foreseen that |
I have to differ a little bit here. The Kubernetes is robust, but they don't handle all possible scenarios, which is improbable and becoming too complex to handle "all" will ultimately fall apart. Our SONiC scenario, where we plan to manage daemons only, is not the mainstream scenario for kubernetes. To tell you a sample, a daemonset does not support restartPolicy or backoff timer. As you know, each switch is carrying production traffic and its health is of utmost importance, with minimal down time for any dockers in any scenario. The availability of kubernetes servers can't be assured. Plus, there are many scenarios, where a switch may decide not to join. I can go on ... :-) What we did here is to take a first step, in a non-invasive fashion, but pretty effective in bringing in external support for container management. We are going to learn a lot from this step and this can pave our way to next. Your vision of complete external control -- Need more than kubernetes -- one more layer of orchestration that could monitor switches & kubernetes servers as a whole and take appropriate corrective action as and when needed. We are not there yet. Thank you, |
Yes! That makes perfect sense, thank you for the explanation!! Grateful for your elaboration before tomorrow's meeting. 🙏🙏🙏 |
Config commands:
Show commands:
A python wrapper for kube_join for invocation by other tools.
- What I did
- How I did it
- How to verify it
- Previous command output (if the output of a command-line utility has changed)
- New command output (if the output of a command-line utility has changed)