Configuration
namerd’s configuration is controlled via config file, which must be provided
as a command-line argument. It may be a local file path or -
to
indicate that the configuration should be read from the standard input.
File Format
The configuration may be specified as a JSON or YAML object, as described below.
storage:
kind: io.l5d.inMemory
namespaces:
galaxyquest: |
/host => /#/io.l5d.fs;
/http/1.1/* => /host;
namers:
- kind: io.l5d.fs
rootDir: examples/disco
interfaces:
- kind: io.l5d.thriftNameInterpreter
port: 4100
ip: 0.0.0.0
retryBaseSecs: 600
retryJitterSecs: 60
- kind: io.l5d.httpController
port: 4321
Storage
All configurations must define a storage key which must be a storage object.
Namers
Naming and service discovery are configured via the namers
section of the
configuration file. In this file, namers
is an array of objects each of which
must be a namer.
Interfaces
A top-level interfaces
section controls the published network interfaces to
namerd. It is an array of interface objects.
Interfaces
(for the interfaces key)
An interface is a published network interface to namerd. An interface config block supports the following params:
- kind – Required. One of the supported interface plugins.
- ip – Optional. The local IP address on which to serve the namer interface (defaults may be provided by plugins)
- port – Optional. The port number on which to server the namer interface. (defaults may be provided by plugins)
Thrift Name Interpreter
io.l5d.thriftNameInterpreter
A read-only interface providing NameInterpreter
functionality over the ThriftMux protocol.
- default ip: 0.0.0.0 (wildcard)
- default port: 4100
- retryBaseSecs – Optional. Base number of seconds to tell clients to wait before retrying after an error. (default: 600)
- retryJitterSecs – Optional. Maximum number of seconds to jitter retry time by. (default: 60)
- cache – Optional. Configure the size of the binding and address caches.
It must be an object containing keys:
- bindingCacheActive – Optional. The size of the binding active cache. (default: 1000)
- bindingCacheInactive – Optional. The size of the binding inactive cache. (default: 100)
- addrCacheActive – Optional. The size of the address active cache. (default: 1000)
- addrCacheInactive – Optional. The size of the address inactive cache. (default: 100)
Http Controller
io.l5d.httpController
A read-write HTTP interface to the storage
.
- default ip: loopback
- default port: 4180
Storage
(for the storage key)
A storage object configures the namerd dtabStore which stores and retrieves dtabs. This object supports the following params:
- kind – The name of the storage plugin.
- experimental – Set this to
true
to enable the storage if it is experimental. - sotrage-specific parameters.
In Memory
io.l5d.inMemory
Stores the dtab in memory. Not suitable for production use.
- namespaces – Optional. A map of namespaces to corresponding dtabs.
Kubernetes
io.l5d.k8s
experimental
Stores the dtab with the Kubernetes master via the ThirdPartyResource APIs. Requires a cluster running Kubernetes 1.2+ with the ThirdPartyResource feature enabled.
- host – Optional. The location of the Kubernetes API. (default: “kubernetes.default.svc.cluster.local”)
- port – Optional. The port used to connect to the Kubernetes API. (default: 443)
- tls – Optional. Whether to connect to the Kubernetes API using TLS. (default: true)
- tlsWithoutValidation – Optional. Whether to disable certificate checking against the Kubernetes API. Meaningless if tls is false. (default: false)
- authTokenFile – Optional. The location of the token used to authenticate against the Kubernetes API, if any. (default: no authentication)
- namespace The Kubernetes namespace in which dtabs will be stored. This should usually be the same namespace in which namerd is running. (default: “default”)
ZooKeeper
io.l5d.zk
experimental
Stores the dtab in ZooKeeper. Supports the following options
- zkAddrs – list of ZooKeeper addresses:
- host – the ZooKeeper host.
- port – the ZooKeeper port.
- pathPrefix – Optional. The ZooKeeper path under which dtabs should be stored. (default: “/dtabs”)
- sessionTimeoutMs – Optional. ZooKeeper session timeout in milliseconds. (default: 10000)
- authInfo – Optional. An object containing the authentication information to use when logging
in ZooKeeper:
- scheme – Required. The ZooKeeper auth scheme to use.
- auth – Required. The ZooKeeper auth value to use.
- acls – Optional. A list of ACLs to set on each dtab znode created. Each ACL is an object
containing:
- scheme – Required. The ACL auth scheme to use.
- id – Required. The ACL id to use.
- perms – Required. A subset of the string “crwda” representing the permissions of this ACL. The characters represent create, read, write, delete, and admin, respectively.
Etcd
io.l5d.etcd
experimental
Stores the dtab in Etcd. Supports the following options
- host – Optional. The location of the etcd API. (default: localhost)
- port – Optional. The port used to connect to the etcd API. (default: 2379)
- pathPrefix – Optional. The key path under which dtabs should be stored. (default: “/namerd/dtabs”)
Consul
io.l5d.consul
experimental
Stores the dtab in Consul KV storage. Supports the following options
- host – Optional. The location of the etcd API. (default: localhost)
- port – Optional. The port used to connect to the consul API. (default: 8500)
- pathPrefix – Optional. The key path under which dtabs should be stored. (default: “/namerd/dtabs”)
- token – Optional. The auth token to use when making API calls.
- datacenter – Optional. The datacenter to forward requests to. (default: not set, use agent’s datacenter)