Конфигурация сервера LXC/LXD

Конфигурирование LXC-сервера осуществляется с помощью установки параметров и виде “ключ-значение”.
Параметры разбиты на три группы (пространства имен):

  • core (core daemon configuration)
  • images (image configuration)
  • maas (MAAS integration)

Значения параметров приведены в таблице:

Key Type Default API extension Description
cluster.offline_threshold integer 20 clustering Number of seconds after which an unresponsive node is considered offline
core.https_address string - - Address to bind for the remote API
core.https_allowed_credentials boolean - - Whether to set Access-Control-Allow-Credentials http header value to “true”
core.https_allowed_headers string - - Access-Control-Allow-Headers http header value
core.https_allowed_methods string - - Access-Control-Allow-Methods http header value
core.https_allowed_origin string - - Access-Control-Allow-Origin http header value
core.macaroon.endpoint string - macaroon_auth URL of the the external authentication endpoint using Macaroons
core.proxy_https string - - https proxy to use, if any (falls back to HTTPS_PROXY environment variable
core.proxy_http string - - http proxy to use, if any (falls back to HTTP_PROXY environment variable)
core.proxy_ignore_hosts string - - хосты, которым не нужен прокси (format to NO_PROXY, e.g. 1.2.3.4,1.2.3.5)
core.trust_password string - - Password to be provided by clients to setup a trust
images.auto_update_cached boolean true - Whether to automatically update any image that LXD caches
images.auto_update_interval integer 6 - Interval in hours at which to look for update cached images (0 disables it)
images.compression_algorithm string gzip - Compression algorithm to use for new images (bzip2, gzip, lzma, xz or none)
images.remote_cache_expiry integer 10 - Number of days after which an unused cached remote image will be flushed
maas.api.key string - maas_network API key to manage MAAS
maas.api.url string - maas_network URL of the MAAS server
maas.machine string host maas_network Name of this LXD host in MAAS

Эти параметры можно установить с помощью команды:

lxc config set <key> <value>

Обычно контейнеры размещены в папке /var/lib/lxc. Изменить папку для размещения контейнеров можно прописав в файле /etc/lxc/lxc.conf параметр:

lxc.lxcpath = /ev3/services