-
Notifications
You must be signed in to change notification settings - Fork 97
Enable use of clab k8s-kind #2854
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
base: dev
Are you sure you want to change the base?
Conversation
|
Hi, thanks for your contribution! Conceptually, what you're looking for is a (meta) device for k8s (like Line 2 in 63e83f8
We may be able to derive k8s from the linux device - @ipspace what do you think? The config YAML would come from a Jinja2 template rendered for each node |
No. The "meta" device is just a collection of settings so the "real" devices can inherit from a clean slate (all IOS devices from ios.yml, all Junos devices from junos.yml) not from another device which might have incompatible settings (for example, iol.yml from csr.yml)
Long-term, another device might be a convenient way to replace a bunch of settings. Short-term, we have other fish to fry... |
Hard-coding edge cases into I would suggest adding "cluster" nodes (k01 in your case) to lab topology. They will get a node ID and might get IP addresses if you attach them to a link, but who cares. Make them unprovisioned and add a config_template to them (it has to be stored in FWIW, I think you will need IP addresses on the "external" interfaces of the worker nodes, so in the end they can't be "unprovisioned" anymore, or you'll need some other mechanism to configure them (I just added "exec" to the list of valid clab keywords to support exactly this use case). Long-term, we could create a "kind" plugin that would create the cluster- and CP/worker nodes automatically. |
|
I tried to create a proof-of-concept and crashed into another show-stopper: netlab doesn't like dashes in node names. How did you get around that @wnagele? |
|
@ipspace have you tried my PR with the example config I posted up here? Basically clab handles these as external containers so like you said, other than the interfaces being added into them through clab/netlab the rest of the config inside of them has to be done using |
Of course I did: What am I missing? |
|
Ah, I used this to get around that: |
🤦♂️ Of course. I should have realized that. Will try to improve the error message. |
|
OK, I got the cluster up and running with this topology (using unmodified clab.j2) We could generate the startup-config with clab.config_template and then use the known file name in the clab.startup-config. The real problem is the container name, which does not follow the standard containerlab container naming convention -- it contains no prefix -- so all netlab commands crash. We could add clab.hostname parameter to allow the users to specify their own container names, or hard-code new rules into |
I've started this work to allow for the use of K8S (Kubernetes) nodes in topologies.
Containerlab does have support for it but it does pose some challenges on how to add it here.
The main challenge I have come across is that you cannot influence the naming of nodes. It does look like this is by design and won't change any time soon. It means that a certain naming pattern has to be followed for this to work.
For now topology configs based on this PR would look like this:
Along with this a
k01-config.ymlwould be needed:I am sure there is probably better ways to do this, but I am not familiar enough with the concepts here to suggest. Feel free to criticise or change as you see fit.