<h2id="2-create-the-cluster-without-flannel-and-with-calico">2. Create the cluster without flannel and with calico<aclass="headerlink"href="#2-create-the-cluster-without-flannel-and-with-calico"title="Permanent link">¶</a></h2>
<p>On the k3s cluster creation :</p>
<ul>
<li>add the flag <code>--flannel-backend=none</code>. For this, on k3d you need to forward this flag to k3s with the option <code>--k3s-server-arg</code>.</li>
<li>add the flag <code>--flannel-backend=none</code>. For this, on k3d you need to forward this flag to k3s with the option <code>--k3s-arg</code>.</li>
<li>mount (<code>--volume</code>) the calico descriptor in the auto deploy manifest directory of k3s <code>/var/lib/rancher/k3s/server/manifests/</code></li>
</ul>
<p>So the command of the cluster creation is (when you are at root of the k3d repository)</p>
-e, --env <spanclass="c1"># add environment variables to the nodes (quoted string, format: 'KEY[=VALUE][@NODEFILTER[;NODEFILTER...]]', use flag multiple times)</span>
--gpus <spanclass="c1"># [from docker CLI] add GPU devices to the node containers (string, e.g. 'all')</span>
-i, --image <spanclass="c1"># specify which k3s image should be used for the nodes (string, default: 'docker.io/rancher/k3s:v1.20.0-k3s2', tag changes per build)</span>
--k3s-agent-arg <spanclass="c1"># add additional arguments to the k3s agent (quoted string, use flag multiple times) (see https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/#k3s-agent-cli-help)</span>
--k3s-server-arg <spanclass="c1"># add additional arguments to the k3s server (quoted string, use flag multiple times) (see https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/#k3s-server-cli-help)</span>
--k3s-arg <spanclass="c1"># add additional arguments to the k3s server/agent (quoted string, use flag multiple times) (see https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/#k3s-server-cli-help & https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/#k3s-agent-cli-help)</span>
--kubeconfig-switch-context <spanclass="c1"># (implies --kubeconfig-update-default) automatically sets the current-context of your default kubeconfig to the new cluster's context (default: true)</span>
--kubeconfig-update-default <spanclass="c1"># enable the automated update of the default kubeconfig with the details of the newly created cluster (also sets '--wait=true') (default: true)</span>
-l, --label <spanclass="c1"># add (docker) labels to the node containers (format: 'KEY[=VALUE][@NODEFILTER[;NODEFILTER...]]', use flag multiple times)</span>
@ -1044,7 +1043,7 @@
<divclass="md-source-date">
<small>
Last update: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">March 30, 2021</span>
Last update: <spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 11, 2021</span>
@ -1258,7 +1258,7 @@ For example, if we mount the CA file in <code>/etc/ssl/certs/my-company-root.pem
<h4id="create-a-customized-k3d-managed-registry">Create a customized k3d-managed registry<aclass="headerlink"href="#create-a-customized-k3d-managed-registry"title="Permanent link">¶</a></h4>
<ol>
<li><codeclass="highlight">k3d registry create myregistry.localhost --port <spanclass="m">12345</span></code> creates a new registry called <code>k3d-myregistry.localhost</code> (could be used with automatic resolution of <code>*.localhost</code>, see next section - also, <strong>note the <code>k3d-</code> prefix</strong> that k3d adds to all resources it creates)</li>
<li><codeclass="highlight">k3d cluster create newcluster --registry-use k3d-myregistry.localhost:12345</code> (make sure you use the <strong><code>k3d-</code> prefix</strong> here) creates a new cluster set up to us that registry</li>
<li><codeclass="highlight">k3d cluster create newcluster --registry-use k3d-myregistry.localhost:12345</code> (make sure you use the <strong><code>k3d-</code> prefix</strong> here) creates a new cluster set up to use that registry</li>
<li>continue with step 3 and 4 from the last section for testing</li>
</ol>
<!-- Admonition to describe usage of a non-k3d-managed registry -->