agent.xml 7.0 KB

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