|
@@ -46,7 +46,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <title>Advanced Server Installation — Netmaker 0.5 documentation</title>
|
|
|
+ <title>Advanced Server Installation — Netmaker 0.7 documentation</title>
|
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
|
<link rel="stylesheet" href="_static/material.css" type="text/css" />
|
|
|
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
|
@@ -81,7 +81,7 @@
|
|
|
<nav class="md-header-nav md-grid">
|
|
|
<div class="md-flex navheader">
|
|
|
<div class="md-flex__cell md-flex__cell--shrink">
|
|
|
- <a href="index.html" title="Netmaker 0.5 documentation"
|
|
|
+ <a href="index.html" title="Netmaker 0.7 documentation"
|
|
|
class="md-header-nav__button md-logo">
|
|
|
|
|
|
<i class="md-icon"></i>
|
|
@@ -167,7 +167,7 @@
|
|
|
<nav class="md-tabs" data-md-component="tabs">
|
|
|
<div class="md-tabs__inner md-grid">
|
|
|
<ul class="md-tabs__list">
|
|
|
- <li class="md-tabs__item"><a href="index.html" class="md-tabs__link">Netmaker 0.5 documentation</a></li>
|
|
|
+ <li class="md-tabs__item"><a href="index.html" class="md-tabs__link">Netmaker 0.7 documentation</a></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</nav>
|
|
@@ -179,13 +179,13 @@
|
|
|
<div class="md-sidebar__inner">
|
|
|
<nav class="md-nav md-nav--primary" data-md-level="0">
|
|
|
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
|
|
- <a href="index.html" title="Netmaker 0.5 documentation" class="md-nav__button md-logo">
|
|
|
+ <a href="index.html" title="Netmaker 0.7 documentation" class="md-nav__button md-logo">
|
|
|
|
|
|
<i class="md-icon"></i>
|
|
|
|
|
|
</a>
|
|
|
<a href="index.html"
|
|
|
- title="Netmaker 0.5 documentation">Netmaker Docs</a>
|
|
|
+ title="Netmaker 0.7 documentation">Netmaker Docs</a>
|
|
|
</label>
|
|
|
<div class="md-nav__source">
|
|
|
<a href="https://github.com/gravitl/netmaker/" title="Go to repository" class="md-source" data-md-source="github">
|
|
@@ -376,15 +376,23 @@
|
|
|
<ul class="md-nav__list">
|
|
|
<li class="md-nav__item"><a href="#system-compatibility" class="md-nav__link">System Compatibility</a>
|
|
|
</li>
|
|
|
- <li class="md-nav__item"><a href="#dns-mode-prereqisite-setup" class="md-nav__link">DNS Mode Prereqisite Setup</a>
|
|
|
+ <li class="md-nav__item"><a href="#server-configuration-reference" class="md-nav__link">Server Configuration Reference</a><nav class="md-nav">
|
|
|
+ <ul class="md-nav__list">
|
|
|
+ <li class="md-nav__item"><a href="#variable-description" class="md-nav__link">Variable Description</a>
|
|
|
+ </li>
|
|
|
+ <li class="md-nav__item"><a href="#config-file-reference" class="md-nav__link">Config File Reference</a>
|
|
|
+ </li>
|
|
|
+ <li class="md-nav__item"><a href="#compose-file-annotated" class="md-nav__link">Compose File - Annotated</a>
|
|
|
+ </li></ul>
|
|
|
+ </nav>
|
|
|
+ </li>
|
|
|
+ <li class="md-nav__item"><a href="#dns-mode-setup" class="md-nav__link">DNS Mode Setup</a>
|
|
|
</li>
|
|
|
<li class="md-nav__item"><a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a><nav class="md-nav">
|
|
|
<ul class="md-nav__list">
|
|
|
<li class="md-nav__item"><a href="#test-install-no-dns-no-secure-grpc" class="md-nav__link">Test Install - No DNS, No Secure GRPC</a>
|
|
|
</li>
|
|
|
<li class="md-nav__item"><a href="#no-dns-coredns-disabled" class="md-nav__link">No DNS - CoreDNS Disabled</a>
|
|
|
- </li>
|
|
|
- <li class="md-nav__item"><a href="#reference-compose-file-annotated" class="md-nav__link">Reference Compose File - Annotated</a>
|
|
|
</li></ul>
|
|
|
</nav>
|
|
|
</li>
|
|
@@ -400,13 +408,11 @@
|
|
|
</li></ul>
|
|
|
</nav>
|
|
|
</li>
|
|
|
- <li class="md-nav__item"><a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
|
|
|
- </li>
|
|
|
- <li class="md-nav__item"><a href="#configuration-reference" class="md-nav__link">Configuration Reference</a><nav class="md-nav">
|
|
|
+ <li class="md-nav__item"><a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a><nav class="md-nav">
|
|
|
<ul class="md-nav__list">
|
|
|
- <li class="md-nav__item"><a href="#variable-description" class="md-nav__link">Variable Description</a>
|
|
|
+ <li class="md-nav__item"><a href="#server-install" class="md-nav__link">Server Install</a>
|
|
|
</li>
|
|
|
- <li class="md-nav__item"><a href="#config-file-reference" class="md-nav__link">Config File Reference</a>
|
|
|
+ <li class="md-nav__item"><a href="#netclient-daemonset" class="md-nav__link">Netclient Daemonset</a>
|
|
|
</li></ul>
|
|
|
</nav>
|
|
|
</li>
|
|
@@ -427,35 +433,35 @@
|
|
|
<li class="md-nav__item">
|
|
|
|
|
|
|
|
|
- <a href="#dns-mode-prereqisite-setup" class="md-nav__link">DNS Mode Prereqisite Setup</a>
|
|
|
+ <a href="#server-configuration-reference" class="md-nav__link">Server Configuration Reference</a>
|
|
|
|
|
|
|
|
|
</li>
|
|
|
<li class="md-nav__item">
|
|
|
|
|
|
|
|
|
- <a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
|
|
|
+ <a href="#dns-mode-setup" class="md-nav__link">DNS Mode Setup</a>
|
|
|
|
|
|
|
|
|
</li>
|
|
|
<li class="md-nav__item">
|
|
|
|
|
|
|
|
|
- <a href="#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
|
|
|
+ <a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
|
|
|
|
|
|
|
|
|
</li>
|
|
|
<li class="md-nav__item">
|
|
|
|
|
|
|
|
|
- <a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
|
|
|
+ <a href="#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
|
|
|
|
|
|
|
|
|
</li>
|
|
|
<li class="md-nav__item">
|
|
|
|
|
|
|
|
|
- <a href="#configuration-reference" class="md-nav__link">Configuration Reference</a>
|
|
|
+ <a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
|
|
|
|
|
|
|
|
|
</li>
|
|
@@ -801,15 +807,23 @@
|
|
|
<ul class="md-nav__list">
|
|
|
<li class="md-nav__item"><a href="#system-compatibility" class="md-nav__link">System Compatibility</a>
|
|
|
</li>
|
|
|
- <li class="md-nav__item"><a href="#dns-mode-prereqisite-setup" class="md-nav__link">DNS Mode Prereqisite Setup</a>
|
|
|
+ <li class="md-nav__item"><a href="#server-configuration-reference" class="md-nav__link">Server Configuration Reference</a><nav class="md-nav">
|
|
|
+ <ul class="md-nav__list">
|
|
|
+ <li class="md-nav__item"><a href="#variable-description" class="md-nav__link">Variable Description</a>
|
|
|
+ </li>
|
|
|
+ <li class="md-nav__item"><a href="#config-file-reference" class="md-nav__link">Config File Reference</a>
|
|
|
+ </li>
|
|
|
+ <li class="md-nav__item"><a href="#compose-file-annotated" class="md-nav__link">Compose File - Annotated</a>
|
|
|
+ </li></ul>
|
|
|
+ </nav>
|
|
|
+ </li>
|
|
|
+ <li class="md-nav__item"><a href="#dns-mode-setup" class="md-nav__link">DNS Mode Setup</a>
|
|
|
</li>
|
|
|
<li class="md-nav__item"><a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a><nav class="md-nav">
|
|
|
<ul class="md-nav__list">
|
|
|
<li class="md-nav__item"><a href="#test-install-no-dns-no-secure-grpc" class="md-nav__link">Test Install - No DNS, No Secure GRPC</a>
|
|
|
</li>
|
|
|
<li class="md-nav__item"><a href="#no-dns-coredns-disabled" class="md-nav__link">No DNS - CoreDNS Disabled</a>
|
|
|
- </li>
|
|
|
- <li class="md-nav__item"><a href="#reference-compose-file-annotated" class="md-nav__link">Reference Compose File - Annotated</a>
|
|
|
</li></ul>
|
|
|
</nav>
|
|
|
</li>
|
|
@@ -825,13 +839,11 @@
|
|
|
</li></ul>
|
|
|
</nav>
|
|
|
</li>
|
|
|
- <li class="md-nav__item"><a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
|
|
|
- </li>
|
|
|
- <li class="md-nav__item"><a href="#configuration-reference" class="md-nav__link">Configuration Reference</a><nav class="md-nav">
|
|
|
+ <li class="md-nav__item"><a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a><nav class="md-nav">
|
|
|
<ul class="md-nav__list">
|
|
|
- <li class="md-nav__item"><a href="#variable-description" class="md-nav__link">Variable Description</a>
|
|
|
+ <li class="md-nav__item"><a href="#server-install" class="md-nav__link">Server Install</a>
|
|
|
</li>
|
|
|
- <li class="md-nav__item"><a href="#config-file-reference" class="md-nav__link">Config File Reference</a>
|
|
|
+ <li class="md-nav__item"><a href="#netclient-daemonset" class="md-nav__link">Netclient Daemonset</a>
|
|
|
</li></ul>
|
|
|
</nav>
|
|
|
</li>
|
|
@@ -859,80 +871,95 @@
|
|
|
<p>The following documents are meant for special cases like Kubernetes and LXC, or for more advanced setups.</p>
|
|
|
|
|
|
|
|
|
-<h2 id="dns-mode-prereqisite-setup">DNS Mode Prereqisite Setup<a class="headerlink" href="#dns-mode-prereqisite-setup" title="Permalink to this headline">¶</a></h2>
|
|
|
-<p>If you plan on running the server in DNS Mode, know that a <a class="reference external" href="https://coredns.io/manual/toc/">CoreDNS Server</a> will be installed. CoreDNS is a light-weight, fast, and easy-to-configure DNS server. It is recommended to bind CoreDNS to port 53 of the host system, and it will do so by default. The clients will expect the nameserver to be on port 53, and many systems have issues resolving a different port.</p>
|
|
|
-<p>However, on your host system (for Netmaker), this may conflict with an existing process. On linux systems running systemd-resolved, there is likely a service consuming port 53. The below steps will disable systemd-resolved, and replace it with a generic (e.g. Google) nameserver. Be warned that this may have consequences for any existing private DNS configuration. The following was tested on Ubuntu 20.04 and should be run prior to deploying the docker containers.</p>
|
|
|
+<h2 id="server-configuration-reference">Server Configuration Reference<a class="headerlink" href="#server-configuration-reference" title="Permalink to this headline">¶</a></h2>
|
|
|
+<p>Netmaker sets its configuration in the following order of precendence:</p>
|
|
|
<ol class="arabic simple">
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">systemctl</span> <span class="pre">stop</span> <span class="pre">systemd-resolved</span></code></p></li>
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">systemctl</span> <span class="pre">disable</span> <span class="pre">systemd-resolved</span></code></p></li>
|
|
|
-<li><dl class="simple">
|
|
|
-<dt><code class="docutils literal notranslate"><span class="pre">vim</span> <span class="pre">/etc/systemd/resolved.conf</span></code></dt><dd><ul class="simple">
|
|
|
-<li><p>uncomment DNS and add 8.8.8.8 or whatever reachable nameserver is your preference</p></li>
|
|
|
-<li><p>uncomment DNSStubListener and set to “no”</p></li>
|
|
|
-</ul>
|
|
|
-</dd>
|
|
|
-</dl>
|
|
|
-</li>
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">ln</span> <span class="pre">-sf</span> <span class="pre">/run/systemd/resolve/resolv.conf</span> <span class="pre">/etc/resolv.conf</span></code></p></li>
|
|
|
+<li><p>Defaults</p></li>
|
|
|
+<li><p>Config File</p></li>
|
|
|
+<li><p>Environment Variables</p></li>
|
|
|
</ol>
|
|
|
-<p>Port 53 should now be available for CoreDNS to use.</p>
|
|
|
|
|
|
-
|
|
|
-<h2 id="docker-compose-install">Docker Compose Install<a class="headerlink" href="#docker-compose-install" title="Permalink to this headline">¶</a></h2>
|
|
|
-<p>The most simple (and recommended) way of installing Netmaker is to use one of the provided <a class="reference external" href="https://github.com/gravitl/netmaker/tree/master/compose">Docker Compose files</a>. Below are instructions for several different options to install Netmaker via Docker Compose, followed by an annotated reference Docker Compose in case your use case requires additional customization.</p>
|
|
|
-
|
|
|
-<h3 id="test-install-no-dns-no-secure-grpc">Test Install - No DNS, No Secure GRPC<a class="headerlink" href="#test-install-no-dns-no-secure-grpc" title="Permalink to this headline">¶</a></h3>
|
|
|
-<p>This install will run Netmaker on a server without HTTPS using an IP address. This is not secure and not recommended, but can be helpful for testing.</p>
|
|
|
-<p>It also does not run the CoreDNS server, to simplify the deployment</p>
|
|
|
-<dl class="simple">
|
|
|
-<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
|
|
|
-<li><p>server ports 80, 8081, and 50051 are not blocked by firewall</p></li>
|
|
|
-</ul>
|
|
|
+<h3 id="variable-description">Variable Description<a class="headerlink" href="#variable-description" title="Permalink to this headline">¶</a></h3>
|
|
|
+<dl>
|
|
|
+<dt>VERBOSITY:</dt><dd><p><strong>Default:</strong> 0</p>
|
|
|
+<p><strong>Description:</strong> Specify level of logging you would like on the server. Goes up to 3 for debugging.</p>
|
|
|
</dd>
|
|
|
-<dt><strong>Notes:</strong></dt><dd><ul class="simple">
|
|
|
-<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
|
|
|
-</ul>
|
|
|
+<dt>GRPC_SSL:</dt><dd><p><strong>Default:</strong> “off”</p>
|
|
|
+<p><strong>Description:</strong> Specifies if GRPC is going over secure GRPC or SSL. This is a setting for the clients and is passed through the access token. Can be set to “on” and “off”. Set to on if SSL is configured for GRPC.</p>
|
|
|
+</dd>
|
|
|
+<dt>SERVER_API_CONN_STRING</dt><dd><p><strong>Default:</strong> “”</p>
|
|
|
+<p><strong>Description:</strong> Allows specification of the string used to connect to the server api. Format: IP:PORT or DOMAIN:PORT. Defaults to SERVER_HOST if not specified.</p>
|
|
|
+</dd>
|
|
|
+<dt>SERVER_GRPC_CONN_STRING</dt><dd><p><strong>Default:</strong> “”</p>
|
|
|
+<p><strong>Description:</strong> Allows specification of the string used to connect to grpc. Format: IP:PORT or DOMAIN:PORT. Defaults to SERVER_HOST if not specified.</p>
|
|
|
+</dd>
|
|
|
+<dt>SERVER_HOST: <em>(depreciated, use SERVER_API_CONN_STRING and SERVER_GRPC_CONN_STRING)</em></dt><dd><p><strong>Default:</strong> Server will perform an IP check and set automatically unless explicitly set, or DISABLE_REMOTE_IP_CHECK is set to true, in which case it defaults to 127.0.0.1</p>
|
|
|
+<p><strong>Description:</strong> Sets the SERVER_HTTP_HOST and SERVER_GRPC_HOST variables if they are unset. The address where traffic comes in.</p>
|
|
|
+</dd>
|
|
|
+<dt>SERVER_HTTP_HOST: <em>(depreciated, use SERVER_API_CONN_STRING and SERVER_GRPC_CONN_STRING)</em></dt><dd><p><strong>Default:</strong> Equals SERVER_HOST if set, “127.0.0.1” if SERVER_HOST is unset.</p>
|
|
|
+<p><strong>Description:</strong> Set to make the HTTP and GRPC functions available via different interfaces/networks.</p>
|
|
|
+</dd>
|
|
|
+<dt>SERVER_GRPC_HOST: <em>(depreciated, use SERVER_API_CONN_STRING and SERVER_GRPC_CONN_STRING)</em></dt><dd><p><strong>Default:</strong> Equals SERVER_HOST if set, “127.0.0.1” if SERVER_HOST is unset.</p>
|
|
|
+<p><strong>Description:</strong> Set to make the HTTP and GRPC functions available via different interfaces/networks.</p>
|
|
|
+</dd>
|
|
|
+<dt>API_PORT:</dt><dd><p><strong>Default:</strong> 8081</p>
|
|
|
+<p><strong>Description:</strong> The HTTP API port for Netmaker. Used for API calls / communication from front end.</p>
|
|
|
+</dd>
|
|
|
+<dt>GRPC_PORT:</dt><dd><p><strong>Default:</strong> 50051</p>
|
|
|
+<p><strong>Description:</strong> The GRPC port for Netmaker. Used for communications from nodes.</p>
|
|
|
+</dd>
|
|
|
+<dt>MASTER_KEY:</dt><dd><p><strong>Default:</strong> “secretkey”</p>
|
|
|
+<p><strong>Description:</strong> The admin master key for accessing the API. Change this in any production installation.</p>
|
|
|
+</dd>
|
|
|
+<dt>CORS_ALLOWED_ORIGIN:</dt><dd><p><strong>Default:</strong> “*”</p>
|
|
|
+<p><strong>Description:</strong> The “allowed origin” for API requests. Change to restrict where API requests can come from.</p>
|
|
|
+</dd>
|
|
|
+<dt>REST_BACKEND:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
+<p><strong>Description:</strong> Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to “off” to turn off.</p>
|
|
|
+</dd>
|
|
|
+<dt>AGENT_BACKEND:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
+<p><strong>Description:</strong> Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to “off” to turn off.</p>
|
|
|
+</dd>
|
|
|
+<dt>DNS_MODE:</dt><dd><p><strong>Default:</strong> “off”</p>
|
|
|
+<p><strong>Description:</strong> Enables DNS Mode, meaning config files will be generated for CoreDNS.</p>
|
|
|
</dd>
|
|
|
</dl>
|
|
|
-<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>< Insert your-host IP Address Here ></strong> with your host IP (or domain):</p>
|
|
|
-<ol class="arabic simple">
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.test.yml</span></code></p></li>
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">‘s/HOST_IP/<</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">>/g’</span> <span class="pre">docker-compose.yml</span></code></p></li>
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">-d</span></code></p></li>
|
|
|
-</ol>
|
|
|
|
|
|
|
|
|
-<h3 id="no-dns-coredns-disabled">No DNS - CoreDNS Disabled<a class="headerlink" href="#no-dns-coredns-disabled" title="Permalink to this headline">¶</a></h3>
|
|
|
-<p>DNS Mode is currently limited to clients that can run resolvectl (systemd-resolved, see <a class="reference internal" href="architecture.html"><span class="doc">Architecture docs</span></a> for more info). You may wish to disable DNS mode for various reasons. This installation option gives you the full feature set minus CoreDNS.</p>
|
|
|
-<p>To run without DNS, follow the Quick Install guide, omitting the steps for DNS setup. In addition, when the guide has you pull (wget) the Netmaker docker-compose template, use the following link instead:</p>
|
|
|
-<ol class="arabic simple">
|
|
|
-<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.nodns.yml</span></code></p></li>
|
|
|
-</ol>
|
|
|
-<p>This template is equivalent but omits CoreDNS.</p>
|
|
|
+<h3 id="config-file-reference">Config File Reference<a class="headerlink" href="#config-file-reference" title="Permalink to this headline">¶</a></h3>
|
|
|
+<p>A config file may be placed under config/environments/<env-name>.yml. To read this file at runtime, provide the environment variable NETMAKER_ENV at runtime. For instance, dev.yml paired with ENV=dev. Netmaker will load the specified Config file. This allows you to store and manage configurations for different environments. Below is a reference Config File you may use.</p>
|
|
|
+<div class="highlight-YAML notranslate"><div class="highlight"><pre><span></span><span class="nt">server</span><span class="p">:</span>
|
|
|
+ <span class="nt">apihost</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or remote ip (SERVER_HOST) if DisableRemoteIPCheck is not set to true. SERVER_API_HOST if set</span>
|
|
|
+ <span class="nt">apiport</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 8081 or HTTP_PORT (if set)</span>
|
|
|
+ <span class="nt">grpchost</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or remote ip (SERVER_HOST) if DisableRemoteIPCheck is not set to true. SERVER_GRPC_HOST if set.</span>
|
|
|
+ <span class="nt">grpcport</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 50051 or GRPC_PORT (if set)</span>
|
|
|
+ <span class="nt">masterkey</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 'secretkey' or MASTER_KEY (if set)</span>
|
|
|
+ <span class="nt">allowedorigin</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to '*' or CORS_ALLOWED_ORIGIN (if set)</span>
|
|
|
+ <span class="nt">restbackend</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or REST_BACKEND (if set)</span>
|
|
|
+ <span class="nt">agentbackend</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or AGENT_BACKEND (if set)</span>
|
|
|
+ <span class="nt">clientmode</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or CLIENT_MODE (if set)</span>
|
|
|
+ <span class="nt">dnsmode</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or DNS_MODE (if set)</span>
|
|
|
+ <span class="nt">disableremoteipcheck</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "false" or DISABLE_REMOTE_IP_CHECK (if set)</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
|
|
|
|
|
|
-<h3 id="reference-compose-file-annotated">Reference Compose File - Annotated<a class="headerlink" href="#reference-compose-file-annotated" title="Permalink to this headline">¶</a></h3>
|
|
|
+<h3 id="compose-file-annotated">Compose File - Annotated<a class="headerlink" href="#compose-file-annotated" title="Permalink to this headline">¶</a></h3>
|
|
|
<p>All environment variables and options are enabled in this file. It is the equivalent to running the “full install” from the above section. However, all environment variables are included, and are set to the default values provided by Netmaker (if the environment variable was left unset, it would not change the installation). Comments are added to each option to show how you might use it to modify your installation.</p>
|
|
|
-<div class="highlight-YAML notranslate"><div class="highlight"><pre><span></span><span class="nt">version</span><span class="p">:</span> <span class="s">"3.4"</span>
|
|
|
-
|
|
|
-<span class="nt">services</span><span class="p">:</span>
|
|
|
- <span class="nt">mongodb</span><span class="p">:</span> <span class="c1"># The MongoDB Instance that backs up Netmaker</span>
|
|
|
- <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongo:4.2</span>
|
|
|
- <span class="nt">ports</span><span class="p">:</span>
|
|
|
- <span class="p p-Indicator">-</span> <span class="s">"27017:27017"</span> <span class="c1"># Port Mapping for MongoDB. Can be modified, but be sure to change the MONGO_PORT env var in netmaker</span>
|
|
|
- <span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongodb</span>
|
|
|
- <span class="nt">volumes</span><span class="p">:</span>
|
|
|
- <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mongovol:/data/db</span>
|
|
|
+<div class="highlight-YAML notranslate"><div class="highlight"><pre><span></span><span class="nt">services</span><span class="p">:</span>
|
|
|
+ <span class="nt">rqlite</span><span class="p">:</span>
|
|
|
+ <span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rqlite</span>
|
|
|
+ <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rqlite/rqlite</span>
|
|
|
+ <span class="nt">network_mode</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">host</span>
|
|
|
<span class="nt">restart</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
|
|
|
- <span class="nt">environment</span><span class="p">:</span>
|
|
|
- <span class="nt">MONGO_INITDB_ROOT_USERNAME</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongoadmin</span> <span class="c1"># Default username. Recommend changing for production installs. You will need to set MONGO_ADMIN netmaker env var.</span>
|
|
|
- <span class="nt">MONGO_INITDB_ROOT_PASSWORD</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongopass</span> <span class="c1"># Default password. Recommend changing for production installs. You will need to set MONGO_PASS netmaker env var.</span>
|
|
|
+ <span class="nt">volumes</span><span class="p">:</span>
|
|
|
+ <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">sqldata:/rqlite/file/data</span>
|
|
|
<span class="nt">netmaker</span><span class="p">:</span> <span class="c1"># The Primary Server for running Netmaker</span>
|
|
|
<span class="nt">privileged</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span> <span class="c1"># Necessary to run sudo/root level commands on host system. Take out if not running with CLIENT_MODE=on</span>
|
|
|
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">netmaker</span>
|
|
|
<span class="nt">depends_on</span><span class="p">:</span>
|
|
|
- <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mongodb</span>
|
|
|
- <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gravitl/netmaker:v0.5</span>
|
|
|
+ <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">rqlite</span>
|
|
|
+ <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gravitl/netmaker:v0.7</span>
|
|
|
<span class="nt">volumes</span><span class="p">:</span> <span class="c1"># Volume mounts necessary for CLIENT_MODE to control netclient, wireguard, and networking on host (except dnsconfig, which is where dns config files are stored for use by CoreDNS)</span>
|
|
|
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./:/local</span>
|
|
|
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/netclient:/etc/netclient</span>
|
|
@@ -957,36 +984,23 @@
|
|
|
<span class="nt">CORS_ALLOWED_ORIGIN</span><span class="p">:</span> <span class="s">"*"</span> <span class="c1"># The "allowed origin" for API requests. Change to restrict where API requests can come from.</span>
|
|
|
<span class="nt">REST_BACKEND</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.</span>
|
|
|
<span class="nt">AGENT_BACKEND</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.</span>
|
|
|
- <span class="nt">CLIENT_MODE</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to "off" to turn off.</span>
|
|
|
<span class="nt">DNS_MODE</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning "off" does not remove CoreDNS. You still need to remove CoreDNS from compose file.</span>
|
|
|
<span class="nt">DISABLE_REMOTE_IP_CHECK</span><span class="p">:</span> <span class="s">"off"</span> <span class="c1"># If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.</span>
|
|
|
- <span class="nt">MONGO_ADMIN</span><span class="p">:</span> <span class="s">"mongoadmin"</span> <span class="c1"># Admin user for MongoDB. Change to match above MongoDB instance</span>
|
|
|
- <span class="nt">MONGO_PASS</span><span class="p">:</span> <span class="s">"mongopass"</span> <span class="c1"># Admin password for MongoDB. Change to match above MongoDB instance</span>
|
|
|
- <span class="nt">MONGO_HOST</span><span class="p">:</span> <span class="s">"127.0.0.1"</span> <span class="c1"># Address of MongoDB. Change if necessary.</span>
|
|
|
- <span class="nt">MONGO_PORT</span><span class="p">:</span> <span class="s">"27017"</span> <span class="c1"># Port of MongoDB. Change if necessary.</span>
|
|
|
- <span class="nt">MONGO_OPTS</span><span class="p">:</span> <span class="s">"/?authSource=admin"</span> <span class="c1"># Opts to enable admin login for Mongo.</span>
|
|
|
- <span class="nt">SERVER_GRPC_WIREGUARD</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Whether to run GRPC over a WireGuard network. On by default. Secures server comms. Switch to "off" to turn off.</span>
|
|
|
- <span class="nt">SERVER_GRPC_WG_INTERFACE</span><span class="p">:</span> <span class="s">"nm-grpc-wg"</span> <span class="c1"># Interface to use for GRPC WireGuard network if enabled</span>
|
|
|
- <span class="nt">SERVER_GRPC_WG_ADDRESS</span><span class="p">:</span> <span class="s">"10.101.0.1"</span> <span class="c1"># Private Address to use for GRPC WireGuard network if enabled</span>
|
|
|
- <span class="nt">SERVER_GRPC_WG_ADDRESS_RANGE</span><span class="p">:</span> <span class="s">"10.101.0.0/16"</span> <span class="c1"># Private Address range to use for GRPC WireGard clients if enabled</span>
|
|
|
- <span class="nt">SERVER_GRPC_WG_PORT</span><span class="p">:</span> <span class="s">"50555"</span> <span class="c1"># Port to use for GRPC WireGuard if enabled</span>
|
|
|
- <span class="nt">SERVER_GRPC_WG_PUBKEY</span><span class="p">:</span> <span class="s">"SERVER_GRPC_WG_PUBKEY"</span> <span class="c1"># PublicKey for GRPC WireGuard interface. Generated if blank.</span>
|
|
|
- <span class="nt">SERVER_GRPC_WG_PRIVKEY</span><span class="p">:</span> <span class="s">"SERVER_GRPC_WG_PRIVKEY"</span> <span class="c1"># PrivateKey for GRPC WireGuard interface. Generated if blank.</span>
|
|
|
<span class="nt">GRPC_SSL</span><span class="p">:</span> <span class="s">"off"</span> <span class="c1"># Tells clients to use SSL to connect to GRPC. Switch to on to turn on.</span>
|
|
|
+ <span class="nt">COREDNS_ADDR</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># Address of the CoreDNS server. Defaults to SERVER_HOST</span>
|
|
|
<span class="nt">SERVER_API_CONN_STRING</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># Changes the api connection string. IP:PORT format. By default is empty and uses SERVER_HOST:API_PORT</span>
|
|
|
<span class="nt">SERVER_GRPC_CONN_STRING</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># Changes the grpc connection string. IP:PORT format. By default is empty and uses SERVER_HOST:GRPC_PORT</span>
|
|
|
<span class="nt">netmaker-ui</span><span class="p">:</span> <span class="c1"># The Netmaker UI Component</span>
|
|
|
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">netmaker-ui</span>
|
|
|
<span class="nt">depends_on</span><span class="p">:</span>
|
|
|
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">netmaker</span>
|
|
|
- <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gravitl/netmaker-ui:v0.5</span>
|
|
|
+ <span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gravitl/netmaker-ui:v0.7</span>
|
|
|
<span class="nt">links</span><span class="p">:</span>
|
|
|
<span class="p p-Indicator">-</span> <span class="s">"netmaker:api"</span>
|
|
|
<span class="nt">ports</span><span class="p">:</span>
|
|
|
- <span class="p p-Indicator">-</span> <span class="s">"80:80"</span>
|
|
|
+ <span class="p p-Indicator">-</span> <span class="s">"8082:80"</span>
|
|
|
<span class="nt">environment</span><span class="p">:</span>
|
|
|
<span class="nt">BACKEND_URL</span><span class="p">:</span> <span class="s">"http://HOST_IP:8081"</span> <span class="c1"># URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT</span>
|
|
|
- <span class="nt">MASTER_KEY</span><span class="p">:</span> <span class="s">"secretkey"</span> <span class="c1"># Master Key for API calls. Will be removed in v0.3.5</span>
|
|
|
<span class="nt">coredns</span><span class="p">:</span> <span class="c1"># The DNS Server. Remove this section if DNS_MODE="off"</span>
|
|
|
<span class="nt">depends_on</span><span class="p">:</span>
|
|
|
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">netmaker</span>
|
|
@@ -999,16 +1013,65 @@
|
|
|
<span class="nt">volumes</span><span class="p">:</span>
|
|
|
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">dnsconfig:/root/dnsconfig</span>
|
|
|
<span class="nt">volumes</span><span class="p">:</span>
|
|
|
- <span class="nt">mongovol</span><span class="p">:</span> <span class="p p-Indicator">{}</span>
|
|
|
+ <span class="nt">sqldata</span><span class="p">:</span> <span class="p p-Indicator">{}</span>
|
|
|
<span class="nt">dnsconfig</span><span class="p">:</span> <span class="p p-Indicator">{}</span>
|
|
|
</pre></div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
+<h2 id="dns-mode-setup">DNS Mode Setup<a class="headerlink" href="#dns-mode-setup" title="Permalink to this headline">¶</a></h2>
|
|
|
+<p>If you plan on running the server in DNS Mode, know that a <a class="reference external" href="https://coredns.io/manual/toc/">CoreDNS Server</a> will be installed. CoreDNS is a light-weight, fast, and easy-to-configure DNS server. It is recommended to bind CoreDNS to port 53 of the host system, and it will do so by default. The clients will expect the nameserver to be on port 53, and many systems have issues resolving a different port.</p>
|
|
|
+<p>However, on your host system (for Netmaker), this may conflict with an existing process. On linux systems running systemd-resolved, there is likely a service consuming port 53. The below steps will disable systemd-resolved, and replace it with a generic (e.g. Google) nameserver. Be warned that this may have consequences for any existing private DNS configuration. The following was tested on Ubuntu 20.04 and should be run prior to deploying the docker containers.</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">systemctl</span> <span class="n">stop</span> <span class="n">systemd</span><span class="o">-</span><span class="n">resolved</span>
|
|
|
+<span class="n">systemctl</span> <span class="n">disable</span> <span class="n">systemd</span><span class="o">-</span><span class="n">resolved</span>
|
|
|
+<span class="n">vim</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">systemd</span><span class="o">/</span><span class="n">resolved</span><span class="o">.</span><span class="n">conf</span>
|
|
|
+ <span class="o">*</span> <span class="n">uncomment</span> <span class="n">DNS</span> <span class="ow">and</span> <span class="n">add</span> <span class="mf">8.8.8.8</span> <span class="ow">or</span> <span class="n">whatever</span> <span class="n">reachable</span> <span class="n">nameserver</span> <span class="ow">is</span> <span class="n">your</span> <span class="n">preference</span> <span class="o">*</span>
|
|
|
+ <span class="o">*</span> <span class="n">uncomment</span> <span class="n">DNSStubListener</span> <span class="ow">and</span> <span class="nb">set</span> <span class="n">to</span> <span class="s2">"no"</span> <span class="o">*</span>
|
|
|
+<span class="n">ln</span> <span class="o">-</span><span class="n">sf</span> <span class="o">/</span><span class="n">run</span><span class="o">/</span><span class="n">systemd</span><span class="o">/</span><span class="n">resolve</span><span class="o">/</span><span class="n">resolv</span><span class="o">.</span><span class="n">conf</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">resolv</span><span class="o">.</span><span class="n">conf</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+<p>Port 53 should now be available for CoreDNS to use.</p>
|
|
|
+
|
|
|
+
|
|
|
+<h2 id="docker-compose-install">Docker Compose Install<a class="headerlink" href="#docker-compose-install" title="Permalink to this headline">¶</a></h2>
|
|
|
+<p>The most simple (and recommended) way of installing Netmaker is to use one of the provided <a class="reference external" href="https://github.com/gravitl/netmaker/tree/master/compose">Docker Compose files</a>. Below are instructions for several different options to install Netmaker via Docker Compose, followed by an annotated reference Docker Compose in case your use case requires additional customization.</p>
|
|
|
+
|
|
|
+<h3 id="test-install-no-dns-no-secure-grpc">Test Install - No DNS, No Secure GRPC<a class="headerlink" href="#test-install-no-dns-no-secure-grpc" title="Permalink to this headline">¶</a></h3>
|
|
|
+<p>This install will run Netmaker on a server without HTTPS using an IP address. This is not secure and not recommended, but can be helpful for testing.</p>
|
|
|
+<p>It also does not run the CoreDNS server, to simplify the deployment</p>
|
|
|
+<dl class="simple">
|
|
|
+<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
|
|
|
+<li><p>server ports 80, 8081, and 50051 are not blocked by firewall</p></li>
|
|
|
+</ul>
|
|
|
+</dd>
|
|
|
+<dt><strong>Notes:</strong></dt><dd><ul class="simple">
|
|
|
+<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
|
|
|
+</ul>
|
|
|
+</dd>
|
|
|
+</dl>
|
|
|
+<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>< Insert your-host IP Address Here ></strong> with your host IP (or domain):</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.test.yml
|
|
|
+sed -i ‘s/HOST_IP/< Insert your-host IP Address Here >/g’ docker-compose.yml
|
|
|
+docker-compose up -d`
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+<h3 id="no-dns-coredns-disabled">No DNS - CoreDNS Disabled<a class="headerlink" href="#no-dns-coredns-disabled" title="Permalink to this headline">¶</a></h3>
|
|
|
+<p>DNS Mode is currently limited to clients that can run resolvectl (systemd-resolved, see <a class="reference internal" href="architecture.html"><span class="doc">Architecture docs</span></a> for more info). You may wish to disable DNS mode for various reasons. This installation option gives you the full feature set minus CoreDNS.</p>
|
|
|
+<p>To run without DNS, follow the <a class="reference internal" href="quick-start.html"><span class="doc">Quick Install</span></a> guide, omitting the steps for DNS setup. In addition, when the guide has you pull (wget) the Netmaker docker-compose template, use the following link instead:</p>
|
|
|
+<ol class="arabic simple">
|
|
|
+<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.nodns.yml</span></code></p></li>
|
|
|
+</ol>
|
|
|
+<p>This template is equivalent but omits CoreDNS.</p>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<h2 id="linux-install-without-docker">Linux Install without Docker<a class="headerlink" href="#linux-install-without-docker" title="Permalink to this headline">¶</a></h2>
|
|
|
<p>Most systems support Docker, but some, such as LXC, do not. In such environments, there are many options for installing Netmaker. Netmaker is available as a binary file, and there is a zip file of the Netmaker UI static HTML on GitHub. Beyond the UI and Server, you need to install MongoDB and CoreDNS (optional).</p>
|
|
|
-<p>Below is a guided set of instructions for installing without Docker on Ubuntu 20.04. Depending on your system, the steps may vary.</p>
|
|
|
+<p>To start, we recommend following the Nginx instructions in the <a class="reference internal" href="quick-start.html"><span class="doc">Quick Install</span></a> guide to enable SSL for your environment.</p>
|
|
|
+<p>Once this is enabled and configured for a domain, you can continue with the below. The recommended server runs Ubuntu 20.04.</p>
|
|
|
|
|
|
<h3 id="rqlite-setup">rqlite Setup<a class="headerlink" href="#rqlite-setup" title="Permalink to this headline">¶</a></h3>
|
|
|
<ol class="arabic simple">
|
|
@@ -1019,22 +1082,32 @@
|
|
|
|
|
|
<h3 id="server-setup">Server Setup<a class="headerlink" href="#server-setup" title="Permalink to this headline">¶</a></h3>
|
|
|
<ol class="arabic simple">
|
|
|
-<li><p><strong>Run the install script:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">curl</span> <span class="pre">-sfL</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/v0.3.5/scripts/netmaker-server.sh</span> <span class="pre">|</span> <span class="pre">sh</span> <span class="pre">-</span></code></p></li>
|
|
|
+<li><p><strong>Run the install script:</strong></p></li>
|
|
|
+</ol>
|
|
|
+<p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">curl</span> <span class="pre">-sfL</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/netmaker-server.sh</span> <span class="pre">|</span> <span class="pre">sh</span> <span class="pre">-</span></code></p>
|
|
|
+<ol class="arabic simple" start="2">
|
|
|
<li><p>Check status: <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">journalctl</span> <span class="pre">-u</span> <span class="pre">netmaker</span></code></p></li>
|
|
|
<li><p>If any settings are incorrect such as host or mongo credentials, change them under /etc/netmaker/config/environments/< your env >.yaml and then run <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">restart</span> <span class="pre">netmaker</span></code></p></li>
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
<h3 id="ui-setup">UI Setup<a class="headerlink" href="#ui-setup" title="Permalink to this headline">¶</a></h3>
|
|
|
-<p>The following uses NGinx as an http server. You may alternatively use Apache or any other web server that serves static web files.</p>
|
|
|
+<p>The following uses Nginx as an http server. You may alternatively use Apache or any other web server that serves static web files.</p>
|
|
|
<ol class="arabic simple">
|
|
|
-<li><p><strong>Download UI asset files:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">/usr/share/nginx/html/netmaker-ui.zip</span> <span class="pre">https://github.com/gravitl/netmaker-ui/releases/download/latest/netmaker-ui.zip</span></code></p></li>
|
|
|
-<li><p><strong>Unzip:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">unzip</span> <span class="pre">/usr/share/nginx/html/netmaker-ui.zip</span> <span class="pre">-d</span> <span class="pre">/usr/share/nginx/html</span></code></p></li>
|
|
|
-<li><p><strong>Copy Config to Nginx:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">cp</span> <span class="pre">/usr/share/nginx/html/nginx.conf</span> <span class="pre">/etc/nginx/conf.d/default.conf</span></code></p></li>
|
|
|
-<li><p><strong>Modify Default Config Path:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">'s/root</span> <span class="pre">\/var\/www\/html/root</span> <span class="pre">\/usr\/share\/nginx\/html/g'</span> <span class="pre">/etc/nginx/sites-available/default</span></code></p></li>
|
|
|
-<li><p><strong>Change Backend URL:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">sh</span> <span class="pre">-c</span> <span class="pre">'BACKEND_URL=http://<YOUR</span> <span class="pre">BACKEND</span> <span class="pre">API</span> <span class="pre">URL>:PORT</span> <span class="pre">/usr/share/nginx/html/generate_config_js.sh</span> <span class="pre">>/usr/share/nginx/html/config.js'</span></code></p></li>
|
|
|
-<li><p><strong>Start Nginx:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span> <span class="pre">nginx</span></code></p></li>
|
|
|
+<li><p>Download and Unzip UI asset files</p></li>
|
|
|
+<li><p>Copy Config to Nginx</p></li>
|
|
|
+<li><p>Modify Default Config Path</p></li>
|
|
|
+<li><p>Change Backend URL</p></li>
|
|
|
+<li><p>Start Nginx</p></li>
|
|
|
</ol>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">wget</span> <span class="o">-</span><span class="n">O</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">nginx</span><span class="o">/</span><span class="n">html</span><span class="o">/</span><span class="n">netmaker</span><span class="o">-</span><span class="n">ui</span><span class="o">.</span><span class="n">zip</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">gravitl</span><span class="o">/</span><span class="n">netmaker</span><span class="o">-</span><span class="n">ui</span><span class="o">/</span><span class="n">releases</span><span class="o">/</span><span class="n">download</span><span class="o">/</span><span class="n">latest</span><span class="o">/</span><span class="n">netmaker</span><span class="o">-</span><span class="n">ui</span><span class="o">.</span><span class="n">zip</span>
|
|
|
+<span class="n">sudo</span> <span class="n">unzip</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">nginx</span><span class="o">/</span><span class="n">html</span><span class="o">/</span><span class="n">netmaker</span><span class="o">-</span><span class="n">ui</span><span class="o">.</span><span class="n">zip</span> <span class="o">-</span><span class="n">d</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">nginx</span><span class="o">/</span><span class="n">html</span>
|
|
|
+<span class="n">sudo</span> <span class="n">cp</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">nginx</span><span class="o">/</span><span class="n">html</span><span class="o">/</span><span class="n">nginx</span><span class="o">.</span><span class="n">conf</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">nginx</span><span class="o">/</span><span class="n">conf</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">default</span><span class="o">.</span><span class="n">conf</span>
|
|
|
+<span class="n">sudo</span> <span class="n">sed</span> <span class="o">-</span><span class="n">i</span> <span class="s1">'s/root \/var\/www\/html/root \/usr\/share\/nginx\/html/g'</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">nginx</span><span class="o">/</span><span class="n">sites</span><span class="o">-</span><span class="n">available</span><span class="o">/</span><span class="n">default</span>
|
|
|
+<span class="n">sudo</span> <span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="s1">'BACKEND_URL=http://<YOUR BACKEND API URL>:PORT /usr/share/nginx/html/generate_config_js.sh >/usr/share/nginx/html/config.js'</span>
|
|
|
+<span class="n">sudo</span> <span class="n">systemctl</span> <span class="n">start</span> <span class="n">nginx</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
|
|
|
|
|
|
<h3 id="coredns-setup">CoreDNS Setup<a class="headerlink" href="#coredns-setup" title="Permalink to this headline">¶</a></h3>
|
|
@@ -1042,122 +1115,31 @@
|
|
|
|
|
|
|
|
|
<h2 id="kubernetes-install">Kubernetes Install<a class="headerlink" href="#kubernetes-install" title="Permalink to this headline">¶</a></h2>
|
|
|
-<p><strong>This configuration is coming soon.</strong> It will allow you to deploy Netmaker on a Kubernetes cluster.</p>
|
|
|
|
|
|
-
|
|
|
-<h2 id="configuration-reference">Configuration Reference<a class="headerlink" href="#configuration-reference" title="Permalink to this headline">¶</a></h2>
|
|
|
-<p>The “Reference Compose File” (above) explains many of these options. However, it is important to understand fundamentally how Netmaker sets its configuration:</p>
|
|
|
-<ol class="arabic simple">
|
|
|
-<li><p>Defaults</p></li>
|
|
|
-<li><p>Config File</p></li>
|
|
|
-<li><p>Environment Variables</p></li>
|
|
|
-</ol>
|
|
|
-
|
|
|
-<h3 id="variable-description">Variable Description<a class="headerlink" href="#variable-description" title="Permalink to this headline">¶</a></h3>
|
|
|
-<dl>
|
|
|
-<dt>SERVER_HOST:</dt><dd><p><strong>Default:</strong> Server will perform an IP check and set automatically unless explicitly set, or DISABLE_REMOTE_IP_CHECK is set to true, in which case it defaults to 127.0.0.1</p>
|
|
|
-<p><strong>Description:</strong> Sets the SERVER_HTTP_HOST and SERVER_GRPC_HOST variables if they are unset. The address where traffic comes in.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_HTTP_HOST:</dt><dd><p><strong>Default:</strong> Equals SERVER_HOST if set, “127.0.0.1” if SERVER_HOST is unset.</p>
|
|
|
-<p><strong>Description:</strong> Set to make the HTTP and GRPC functions available via different interfaces/networks.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_HOST:</dt><dd><p><strong>Default:</strong> Equals SERVER_HOST if set, “127.0.0.1” if SERVER_HOST is unset.</p>
|
|
|
-<p><strong>Description:</strong> Set to make the HTTP and GRPC functions available via different interfaces/networks.</p>
|
|
|
-</dd>
|
|
|
-<dt>API_PORT:</dt><dd><p><strong>Default:</strong> 8081</p>
|
|
|
-<p><strong>Description:</strong> The HTTP API port for Netmaker. Used for API calls / communication from front end.</p>
|
|
|
-</dd>
|
|
|
-<dt>GRPC_PORT:</dt><dd><p><strong>Default:</strong> 50051</p>
|
|
|
-<p><strong>Description:</strong> The GRPC port for Netmaker. Used for communications from nodes.</p>
|
|
|
-</dd>
|
|
|
-<dt>MASTER_KEY:</dt><dd><p><strong>Default:</strong> “secretkey”</p>
|
|
|
-<p><strong>Description:</strong> The admin master key for accessing the API. Change this in any production installation.</p>
|
|
|
-</dd>
|
|
|
-<dt>CORS_ALLOWED_ORIGIN:</dt><dd><p><strong>Default:</strong> “*”</p>
|
|
|
-<p><strong>Description:</strong> The “allowed origin” for API requests. Change to restrict where API requests can come from.</p>
|
|
|
-</dd>
|
|
|
-<dt>REST_BACKEND:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
-<p><strong>Description:</strong> Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to “off” to turn off.</p>
|
|
|
-</dd>
|
|
|
-<dt>AGENT_BACKEND:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
-<p><strong>Description:</strong> Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to “off” to turn off.</p>
|
|
|
-</dd>
|
|
|
-<dt>CLIENT_MODE:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
-<p><strong>Description:</strong> Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to “off” to turn off.</p>
|
|
|
-</dd>
|
|
|
-<dt>DNS_MODE:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
-<p><strong>Description:</strong> Enables DNS Mode, meaning config files will be generated for CoreDNS.</p>
|
|
|
-</dd>
|
|
|
-<dt>DISABLE_REMOTE_IP_CHECK:</dt><dd><p><strong>Default:</strong> “off”</p>
|
|
|
-<p><strong>Description:</strong> If turned “on”, Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned “off” by default.</p>
|
|
|
-</dd>
|
|
|
-<dt>MONGO_ADMIN:</dt><dd><p><strong>Default:</strong> “mongoadmin”</p>
|
|
|
-<p><strong>Description:</strong> Admin user for MongoDB.</p>
|
|
|
-</dd>
|
|
|
-<dt>MONGO_PASS:</dt><dd><p><strong>Default:</strong> “mongopass”</p>
|
|
|
-<p><strong>Description:</strong> Admin password for MongoDB.</p>
|
|
|
-</dd>
|
|
|
-<dt>MONGO_HOST:</dt><dd><p><strong>Default:</strong> “127.0.0.1”</p>
|
|
|
-<p><strong>Description:</strong> Address of MongoDB.</p>
|
|
|
-</dd>
|
|
|
-<dt>MONGO_PORT:</dt><dd><p><strong>Default:</strong> “27017”</p>
|
|
|
-<p><strong>Description:</strong> Port of MongoDB.</p>
|
|
|
-</dd>
|
|
|
-<dt>MONGO_OPTS:</dt><dd><p><strong>Default:</strong> “/?authSource=admin”</p>
|
|
|
-<p><strong>Description:</strong> Opts to enable admin login for Mongo.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WIREGUARD:</dt><dd><p><strong>Default:</strong> “on”</p>
|
|
|
-<p><strong>Description:</strong> Whether to run GRPC over a WireGuard network. On by default. Secures the server comms. Switch to “off” to turn off. If off and running in production, make sure to have certificates installed to secure GRPC communications.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_INTERFACE:</dt><dd><p><strong>Default:</strong> “nm-grpc-wg”</p>
|
|
|
-<p><strong>Description:</strong> Interface to use for GRPC WireGuard network if enabled</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_ADDRESS:</dt><dd><p><strong>Default:</strong> “10.101.0.1”</p>
|
|
|
-<p><strong>Description:</strong> Private Address to use for GRPC WireGuard network if enabled</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_ADDRESS_RANGE:</dt><dd><p><strong>Default:</strong> “10.101.0.0/16”</p>
|
|
|
-<p><strong>Description:</strong> Private Address range to use for GRPC WireGard clients if enabled. Gives 65,534 total addresses for all of netmaker. If running a larger network, will need to configure addresses differently, for instance using ipv6, or use certificates instead.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_PORT:</dt><dd><p><strong>Default:</strong> 50555</p>
|
|
|
-<p><strong>Description:</strong> Port to use for GRPC WireGuard if enabled</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_PUBKEY:</dt><dd><p><strong>Default:</strong> < generated at startup ></p>
|
|
|
-<p><strong>Description:</strong> PublicKey for GRPC WireGuard interface. Generated if left blank.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_PRIVKEY:</dt><dd><p><strong>Default:</strong> < generated at startup ></p>
|
|
|
-<p><strong>Description:</strong> PrivateKey for GRPC WireGuard interface. Generated if left blank.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_WG_KEYREQUIRED</dt><dd><p><strong>Default:</strong> “”</p>
|
|
|
-<p><strong>Description:</strong> Determines if an Access Key is required to join the Comms network. Blank (meaning ‘no’) by default. Set to “yes” to turn on.</p>
|
|
|
-</dd>
|
|
|
-<dt>GRPC_SSL</dt><dd><p><strong>Default:</strong> “”</p>
|
|
|
-<p><strong>Description:</strong> Specifies if GRPC is going over secure GRPC or SSL. This is a setting for the clients and is passed through the access token. Can be set to “on” and “off”. Set to on if SSL is configured for GRPC.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_API_CONN_STRING</dt><dd><p><strong>Default:</strong> “”</p>
|
|
|
-<p><strong>Description:</strong> Allows specification of the string used to connect to the server api. Format: IP:PORT or DOMAIN:PORT. Defaults to SERVER_HOST if not specified.</p>
|
|
|
-</dd>
|
|
|
-<dt>SERVER_GRPC_CONN_STRING</dt><dd><p><strong>Default:</strong> “”</p>
|
|
|
-<p><strong>Description:</strong> Allows specification of the string used to connect to grpc. Format: IP:PORT or DOMAIN:PORT. Defaults to SERVER_HOST if not specified.</p>
|
|
|
-</dd>
|
|
|
-</dl>
|
|
|
+<h3 id="server-install">Server Install<a class="headerlink" href="#server-install" title="Permalink to this headline">¶</a></h3>
|
|
|
+<p>This template assumes your cluster uses Nginx for ingress with valid wildcard certificates. If using an ingress controller other than Nginx (ex: Traefik), you will need to manually modify the Ingress entries in this template to match your environment.</p>
|
|
|
+<p>This template also requires RWX storage. Please change references to storageClassName in this template to your cluster’s Storage Class.</p>
|
|
|
+<p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/develop/kube/netmaker-template.yaml</span></code></p>
|
|
|
+<p>Replace the NETMAKER_BASE_DOMAIN references to the base domain you would like for your Netmaker services (ui,api,grpc). Typically this will be something like <strong>netmaker.yourwildcard.com</strong>.</p>
|
|
|
+<p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">‘s/NETMAKER_BASE_DOMAIN/<your</span> <span class="pre">base</span> <span class="pre">domain>/g’</span> <span class="pre">netmaker-template.yaml</span></code></p>
|
|
|
+<p>Now, assuming Ingress and Storage match correctly with your cluster configuration, you can install Netmaker.</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">kubectl</span> <span class="n">create</span> <span class="n">ns</span> <span class="n">nm</span>
|
|
|
+<span class="n">kubectl</span> <span class="n">config</span> <span class="nb">set</span><span class="o">-</span><span class="n">context</span> <span class="o">--</span><span class="n">current</span> <span class="o">--</span><span class="n">namespace</span><span class="o">=</span><span class="n">nm</span>
|
|
|
+<span class="n">kubectl</span> <span class="n">apply</span> <span class="o">-</span><span class="n">f</span> <span class="n">netmaker</span><span class="o">-</span><span class="n">template</span><span class="o">.</span><span class="n">yaml</span> <span class="o">-</span><span class="n">n</span> <span class="n">nm</span>
|
|
|
+</pre></div>
|
|
|
+</div>
|
|
|
+<p>In about 3 minutes, everything should be up and running:</p>
|
|
|
+<p><code class="docutils literal notranslate"><span class="pre">kubectl</span> <span class="pre">get</span> <span class="pre">ingress</span> <span class="pre">nm-ui-ingress-nginx</span></code></p>
|
|
|
|
|
|
|
|
|
-<h3 id="config-file-reference">Config File Reference<a class="headerlink" href="#config-file-reference" title="Permalink to this headline">¶</a></h3>
|
|
|
-<p>A config file may be placed under config/environments/<env-name>.yml. To read this file at runtime, provide the environment variable ENV at runtime. For instance, dev.yml paired with ENV=dev. Netmaker will load the specified Config file. This allows you to store and manage configurations for different environments. Below is a reference Config File you may use.</p>
|
|
|
-<div class="highlight-YAML notranslate"><div class="highlight"><pre><span></span><span class="nt">server</span><span class="p">:</span>
|
|
|
- <span class="nt">apihost</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or remote ip (SERVER_HOST) if DisableRemoteIPCheck is not set to true. SERVER_API_HOST if set</span>
|
|
|
- <span class="nt">apiport</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 8081 or HTTP_PORT (if set)</span>
|
|
|
- <span class="nt">grpchost</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or remote ip (SERVER_HOST) if DisableRemoteIPCheck is not set to true. SERVER_GRPC_HOST if set.</span>
|
|
|
- <span class="nt">grpcport</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 50051 or GRPC_PORT (if set)</span>
|
|
|
- <span class="nt">masterkey</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 'secretkey' or MASTER_KEY (if set)</span>
|
|
|
- <span class="nt">allowedorigin</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to '*' or CORS_ALLOWED_ORIGIN (if set)</span>
|
|
|
- <span class="nt">restbackend</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or REST_BACKEND (if set)</span>
|
|
|
- <span class="nt">agentbackend</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or AGENT_BACKEND (if set)</span>
|
|
|
- <span class="nt">clientmode</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or CLIENT_MODE (if set)</span>
|
|
|
- <span class="nt">dnsmode</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or DNS_MODE (if set)</span>
|
|
|
- <span class="nt">disableremoteipcheck</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "false" or DISABLE_REMOTE_IP_CHECK (if set)</span>
|
|
|
+<h3 id="netclient-daemonset">Netclient Daemonset<a class="headerlink" href="#netclient-daemonset" title="Permalink to this headline">¶</a></h3>
|
|
|
+<p>The following instructions assume you have Netmaker running and a network you would like to add your cluster into. The Netmaker server does not need to be running inside of a cluster for this.</p>
|
|
|
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>wget https://raw.githubusercontent.com/gravitl/netmaker/develop/kube/netclient-template.yaml
|
|
|
+sed -i ‘s/ACCESS_TOKEN_VALUE/< your access token value>/g’ netclient-template.yaml
|
|
|
+kubectl apply -f netclient-template.yaml
|
|
|
</pre></div>
|
|
|
</div>
|
|
|
+<p>For a more detailed guide on integrating Netmaker with MicroK8s, <a class="reference external" href="https://itnext.io/how-to-deploy-a-cross-cloud-kubernetes-cluster-with-built-in-disaster-recovery-bbce27fcc9d7">check out this guide</a>.</p>
|
|
|
|
|
|
|
|
|
|