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

Restructure node peer annotations #1393

Open
rkojedzinszky opened this issue Nov 8, 2022 · 1 comment
Open

Restructure node peer annotations #1393

rkojedzinszky opened this issue Nov 8, 2022 · 1 comment
Labels
feature override-stale Don't allow automatic management of stale issues / PRs
Milestone

Comments

@rkojedzinszky
Copy link
Contributor

Is your feature request related to a problem? Please describe.
For many external peers for a node, it might be difficult to change per-node settings (e.g. password, asn prepends, etc.) because they are stored in different arrays.

Describe the solution you'd like
Restructure configuration in a serialized json or yaml format, with elements of peer configurations.

Instead of:

apiVersion: v1
kind: Node
metadata:
  annotations:
...
    kube-router.io/peer.asns: "64640"
    kube-router.io/peer.ips: 192.168.8.254
    kube-router.io/peer.passwords: cGFzc3dvcmQ=
...

We could have:

apiVersion: v1
kind: Node
metadata:
  annotations:
...
    kube-router.io/peers: |
      - remoteip: 192.168.8.254
        remoteasn: 64640
        password: cGFzc3dvcmQ=
...
``

For compatibility, both formats can be supported at the same time.

**Additional context**
If having multiple peers, and for example we want some fields have defaults or not specified (e.g. a password), the list can read confusing. Also, right now there are many settings applicable for a peer, and restructuring them into a real struct would enhance readability, and also would make processing it in code much simpler.
@aauren
Copy link
Collaborator

aauren commented Nov 15, 2022

This seems reasonable. We should also probably replace the options --peer-router-passwords-file (https://github.com/cloudnativelabs/kube-router/blob/master/pkg/options/options.go#L195) with an option to instead pass a YAML config file that has the same structure as the annotation.

That would allow the user multiple ways to specify the same data either at runtime via node annotation or via configuration file that is passed to kube-router at startup. The same Go object should be able to decode both.

@aauren aauren added the override-stale Don't allow automatic management of stale issues / PRs label Sep 4, 2023
@aauren aauren added this to the v2.3.0 milestone Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature override-stale Don't allow automatic management of stale issues / PRs
Projects
None yet
Development

No branches or pull requests

2 participants