agent.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2017;" >
  5. ]>
  6. <chapter id="kea-ctrl-agent">
  7. <title>Kea Control Agent</title>
  8. <section id="agent-overview">
  9. <title>Overview</title>
  10. <para>Kea Control Agent (CA) is a daemon, first included in Kea 1.2, which
  11. exposes a RESTful control interface for managing Kea servers. The daemon
  12. can receive control commands over HTTP and either forward these commands
  13. to the respective Kea servers or handle these commands on its own. The
  14. determination whether the command should be handled by the CA or forwarded
  15. is made by checking the value of the 'service' parameter which may be
  16. included in the command from the controlling client. The details of the
  17. supported commands as well as their structures are provided in
  18. <xref linkend="ctrl-channel"/>.</para>
  19. <para>Hook libraries can be attached to the CA to provide support for
  20. additional commands or custom behavior of existing commands. Such hook
  21. libraries must implement callouts for 'control_command_receive' hook point.
  22. Details about creating new hook libraries and supported hook points can be
  23. found in
  24. <ulink url="https://jenkins.isc.org/job/Kea_doc/doxygen/">Kea Developer's Guide</ulink>.
  25. </para>
  26. </section>
  27. <section id="agent-configuration">
  28. <title>Configuration</title>
  29. <para>The following example demonstrates the basic CA configuration.</para>
  30. <para>
  31. <screen>
  32. {
  33. "Control-agent": {
  34. "http-host": "10.20.30.40",
  35. "http-port": 8080,
  36. "control-sockets": {
  37. "dhcp4-server": {
  38. "socket-type": "unix",
  39. "socket-name": "/path/to/the/unix/socket-v4"
  40. },
  41. "dhcp6-server": {
  42. "socket-type": "unix",
  43. "socket-name": "/path/to/the/unix/socket-v4"
  44. }
  45. },
  46. "hooks-libraries": [
  47. {
  48. "library": "/opt/local/control-agent-commands.so",
  49. "parameters": {
  50. "param1": "foo"
  51. }
  52. } ]
  53. },
  54. "Logging": {
  55. "loggers": [ {
  56. "name": "kea-ctrl-agent",
  57. "severity": "INFO"
  58. } ]
  59. }
  60. }</screen>
  61. </para>
  62. <warning>
  63. <simpara>
  64. In the Kea 1.2 beta release the Control Agent configuration can't be
  65. specified within the same configuration file as DHCPv4, DHCPv6 and D2
  66. configuration. The default configuration file for the CA is installed
  67. in the <filename>etc/kea/kea-ca.conf</filename>. In the Kea 1.2 final
  68. release the CA configuration will be merged into the default
  69. <filename>etc/kea/kea.conf.</filename>
  70. </simpara>
  71. </warning>
  72. <para>
  73. The <command>http-host</command> and <command>http-port</command>
  74. specify an IP address and port to which HTTP service will be bound.
  75. In case of the example configuration provided above, the RESTful
  76. service will be available under the URL of
  77. <command>http://10.20.30.40:8080/</command>. If these parameters
  78. are not specified, the default URL is http://127.0.0.1:8000/
  79. </para>
  80. <para>
  81. It has been mentioned in the <xref linkend="agent-overview"/> that
  82. CA can forward received commands to the specific Kea servers for
  83. processing. For example, <command>config-get</command> is sent to
  84. retrieve configuration of one of the Kea services. When CA receives
  85. this command, including a <command>service</command> parameter
  86. indicating that the client desires to retrieve configuration of
  87. the DHCPv4 server, the CA will forward this command to this server
  88. and then pass the received response back to the client. More about
  89. the <command>service</command> parameter and general structure of
  90. the commands can be found in <xref linkend="ctrl-channel"/>.
  91. </para>
  92. <para>
  93. The CA uses unix domain sockets to forward control commands and receive
  94. responses from other Kea services. The <command>dhcp4-server</command>,
  95. <command>dhcp6-server</command> and <command>d2-server</command> maps
  96. specify the files to which unix domain sockets are bound. In case
  97. of the configuration above, the CA will connect to the DHCPv4 server
  98. via <filename>/path/to/the/unix/socket-v4</filename> to forward the
  99. commands to it. Obviously, the DHCPv4 server must be configured to
  100. listen to connections via this same socket. In other words, the command
  101. socket configuration for the DHCPv4 server and CA (for this server)
  102. must match. Consult the <xref linkend="dhcp4-ctrl-channel"/> and the
  103. <xref linkend="dhcp6-ctrl-channel"/> to learn how the socket
  104. configuration is specified for the DHCPv4 and DHCPv6 services.
  105. </para>
  106. <para>
  107. Hooks libraries can be attached to the Control Agent just like to
  108. DHCPv4 and DHCPv6 servers. It currently supports one hook point
  109. 'control_command_receive' which makes it possible to delegate
  110. processing of some commands to the hooks library. The
  111. <command>hooks-libraries</command> list contains the list of hooks
  112. libraries that should be loaded by the CA, along with their configuration
  113. information specified with <command>parameters</command>.
  114. </para>
  115. <para>
  116. Please consult <xref linkend="logging"/> for the details how to
  117. configure logging. The CA's root logger's name is
  118. <command>kea-ctrl-agent</command> as given in the example above.
  119. </para>
  120. </section>
  121. <section id="agent-secure-connection">
  122. <title>Secure Connections</title>
  123. <para>
  124. Control Agent doesn't natively support secure HTTP connections like
  125. SSL or TLS. In order to setup secure connection please use one
  126. of the available third party HTTP servers and configure it to run
  127. as a reverse proxy to the Control Agent.
  128. </para>
  129. </section>
  130. <section id="agent-limitations">
  131. <title>Control Agent Limitations</title>
  132. <para>
  133. Control Agent is a new component, first released in Kea 1.2 beta. In
  134. this release it comes with two notable limitations:
  135. <itemizedlist>
  136. <listitem>
  137. <simpara>
  138. CA configuration must be specified in a separate configuration file
  139. from the configurations of other components. The default confirguation
  140. file for CA is located in <filename>etc/kea/kea-ca.conf</filename>.
  141. </simpara>
  142. </listitem>
  143. <listitem>
  144. <simpara>
  145. keactrl hasn't been updated to manage the Control Agent (start, stop
  146. reload). As a result, the CA must be started directly as described in
  147. <xref linkend="agent-launch"/>
  148. </simpara>
  149. </listitem>
  150. </itemizedlist>
  151. </para>
  152. </section>
  153. <section id="agent-launch">
  154. <title>Starting Control Agent</title>
  155. <para>
  156. The CA is started by running its binary and specifying the configuration file
  157. it should use. For example:
  158. <screen>
  159. $ ./kea-ctrl-agent -c /usr/local/etc/kea/kea-ca.conf
  160. </screen>
  161. </para>
  162. </section>
  163. </chapter>