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

[RFC] Support multiple LXD servers #90

Closed
wants to merge 1 commit into from

Conversation

jtopjian
Copy link
Contributor

@jtopjian jtopjian commented Jun 10, 2017

I'm looking for feedback on how to best implement this.

I can see a few ways of implementing this:

  1. Allow all configuration to be repeatable:
[servers.default]

# ...

  [servers.default.discovery]
  kind = "lxd"

  [servers.default.discovery.lxd.local]
  container_label_key = "user.gobetween.label"
  container_port_key = "user.gobetween.port"
  container_label_value = "web"
  generate_client_certs = true
  accept_server_cert = true
  server_address = "unix:///var/lib/lxd/unix.socket"


  [servers.default.discovery.lxd_servers.lxd-02]
  container_label_key = "user.gobetween.label"
  container_port_key = "user.gobetween.port"
  container_label_value = "web"
  generate_client_certs = true
  accept_server_cert = true
  server_address = "https://lxd-02.example.com:8443"
  server_remote_password = "password"
  1. Have one global section and a section for each lxd server. The global settings would be applied to all servers. Each lxd server entry would only have a few configuration settings.
[servers.default]

# ...

  [servers.default.discovery]
  kind = "lxd"

  [servers.default.discovery.lxd]
  container_label_key = "user.gobetween.label"
  container_port_key = "user.gobetween.port"
  container_label_value = "web" 
  generate_client_certs = true
  accept_server_cert = true

  [servers.default.discovery.lxd_servers.local]
  server_address = "unix:///var/lib/lxd/unix.socket"

  [servers.default.discovery.lxd_servers.lxd-02]
  server_address = "https://lxd-02.example.com:8443"
  server_remote_password = "password"
  1. Similar to 2, but the global settings are the standard settings in the [servers.default.discovery] namespace:
[servers.default]

# ...

  [servers.default.discovery]
  kind = "lxd"
  lxd_container_label_key = "user.gobetween.label"
  lxd_container_port_key = "user.gobetween.port"
  lxd_container_label_value = "web"   # (required) Label to filter containers
  lxd_generate_client_certs = true
  lxd_accept_server_cert = true

  [servers.default.discovery.lxd_servers.local]
  server_address = "unix:///var/lib/lxd/unix.socket"

  [servers.default.discovery.lxd_servers.lxd-02]
  server_address = "https://lxd-02.example.com:8443"
  server_remote_password = "password"
  1. Allow all settings to be global and per server. If a setting does not exist in a server, it takes the global value.

This draft PR implements 3 because it seemed like a good mix of everything to critique.

The following configuration settings are able to be set in a per-server config:

  • ServerAddress
  • ServerRemotePassword
  • ContainerInterface
  • ContainerAddressType

All other settings are global, meaning their values are applied to all servers.

There's no rush to review this :)

This commit enables multiple LXD servers to be specified
as gobetween backends.
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 this pull request may close these issues.

None yet

1 participant