Merge: d7199d7 c83ac0a
Author: Thorsten Klein <iwilltry42@gmail.com>
Date:   Tue Jul 14 15:48:36 2020 +0200

    Merge pull request #300 from rancher/enhancement/noun-verb-syntax

    [Enhancement] NEW noun verb syntax
pull/308/head
iwilltry42 4 years ago
parent df7f7abd8f
commit dd842fcaaf
  1. 8
      faq/faq/index.html
  2. 16
      faq/v1vsv3-comparison/index.html
  3. 6
      index.html
  4. 4
      internals/networking/index.html
  5. 2
      search/search_index.json
  6. BIN
      sitemap.xml.gz
  7. 61
      usage/commands/index.html
  8. 8
      usage/guides/exposing_services/index.html
  9. 8
      usage/guides/registries/index.html
  10. 18
      usage/kubeconfig/index.html
  11. 6
      usage/multimaster/index.html

@ -629,12 +629,12 @@
<h2 id="issues-with-btrfs">Issues with BTRFS<a class="headerlink" href="#issues-with-btrfs" title="Permanent link">&para;</a></h2>
<ul>
<li>As <a href="https://github.com/jaredallard">@jaredallard</a> <a href="https://github.com/rancher/k3d/pull/48">pointed out</a>, people running <code>k3d</code> on a system with <strong>btrfs</strong>, may need to mount <code>/dev/mapper</code> into the nodes for the setup to work.</li>
<li>This will do: <code>k3d create cluster CLUSTER_NAME -v /dev/mapper:/dev/mapper</code></li>
<li>This will do: <code>k3d cluster create CLUSTER_NAME -v /dev/mapper:/dev/mapper</code></li>
</ul>
<h2 id="issues-with-zfs">Issues with ZFS<a class="headerlink" href="#issues-with-zfs" title="Permanent link">&para;</a></h2>
<ul>
<li>
<p>k3s currently has <a href="ttps://github.com/rancher/k3s/issues/66">no support for ZFS</a> and thus, creating multi-master setups (e.g. <code>k3d create cluster multimaster --masters 3</code>) fails, because the initializing master node (server flag <code>--cluster-init</code>) errors out with the following log:
<p>k3s currently has <a href="ttps://github.com/rancher/k3s/issues/66">no support for ZFS</a> and thus, creating multi-master setups (e.g. <code>k3d cluster create multimaster --masters 3</code>) fails, because the initializing master node (server flag <code>--cluster-init</code>) errors out with the following log:
<div class="highlight"><pre><span></span><code>starting kubernetes: preparing server: start cluster and https: raft_init<span class="o">()</span>: io: create I/O capabilities probe file: posix_allocate: operation not supported on socket
</code></pre></div></p>
</li>
@ -651,7 +651,7 @@
<li>Possible <a href="https://github.com/rancher/k3d/issues/133#issuecomment-549065666">fix/workaround by @zer0def</a>:<ul>
<li>use a docker storage driver which cleans up properly (e.g. overlay2)</li>
<li>clean up or expand docker root filesystem</li>
<li>change the kubelet&rsquo;s eviction thresholds upon cluster creation: <code>k3d create cluster --k3s-agent-arg '--kubelet-arg=eviction-hard=imagefs.available&lt;1%,nodefs.available&lt;1%' --k3s-agent-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'</code></li>
<li>change the kubelet&rsquo;s eviction thresholds upon cluster creation: <code>k3d cluster create --k3s-agent-arg '--kubelet-arg=eviction-hard=imagefs.available&lt;1%,nodefs.available&lt;1%' --k3s-agent-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'</code></li>
</ul>
</li>
</ul>
@ -671,7 +671,7 @@
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 4, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -592,7 +592,7 @@
- --command -&gt; planned: keep
- --shell -&gt; planned: keep (or second arg)
- auto, bash, zsh
- create -&gt; `k3d create cluster CLUSTERNAME`
- create -&gt; `k3d cluster create CLUSTERNAME`
- --name -&gt; dropped, implemented via arg
- --volume -&gt; implemented
- --port -&gt; implemented
@ -612,7 +612,7 @@
- --registry-volume -&gt; TBD
- --registries-file -&gt; TBD
- --enable-registry-cache -&gt; TBD
- (add-node) -&gt; `k3d create node NODENAME`
- (add-node) -&gt; `k3d node create NODENAME`
- --role -&gt; implemented
- --name -&gt; dropped, implemented as arg
- --count -&gt; implemented as `--replicas`
@ -623,23 +623,23 @@
- --k3s -&gt; TBD
- --k3s-secret -&gt; TBD
- --k3s-token -&gt; TBD
- delete -&gt; `k3d delete cluster CLUSTERNAME`
- delete -&gt; `k3d cluster delete CLUSTERNAME`
- --name -&gt; dropped, implemented as arg
- --all -&gt; implemented
- --prune -&gt; TBD
- --keep-registry-volume -&gt; TBD
- stop -&gt; `k3d stop cluster CLUSTERNAME`
- stop -&gt; `k3d cluster stop CLUSTERNAME`
- --name -&gt; dropped, implemented as arg
- --all -&gt; implemented
- start -&gt; `k3d start cluster CLUSTERNAME`
- start -&gt; `k3d cluster start CLUSTERNAME`
- --name -&gt; dropped, implemented as arg
- --all -&gt; implemented
- list -&gt; dropped, implemented as `k3d get clusters`
- get-kubeconfig -&gt; `k3d get kubeconfig CLUSTERNAME`
- get-kubeconfig -&gt; `k3d kubeconfig get|merge CLUSTERNAME`
- --name -&gt; dropped, implemented as arg
- --all -&gt; implemented
- --overwrite -&gt; implemented
- import-images -&gt; `k3d load image [--cluster CLUSTERNAME] [--keep] IMAGES`
- import-images -&gt; `k3d image import [--cluster CLUSTERNAME] [--keep] IMAGES`
- --name -&gt; implemented as `--cluster`
- --no-remove -&gt; implemented as `--keep-tarball`
</code></pre></div>
@ -651,7 +651,7 @@
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 4, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -727,11 +727,11 @@
</ul>
<h2 id="quick-start">Quick Start<a class="headerlink" href="#quick-start" title="Permanent link">&para;</a></h2>
<p>Create a cluster named <code>mycluster</code> with just a single master node:</p>
<div class="highlight"><pre><span></span><code>k3d create cluster mycluster
<div class="highlight"><pre><span></span><code>k3d cluster create mycluster
</code></pre></div>
<p>Get the new cluster&rsquo;s connection details merged into your default kubeconfig (usually specified using the <code>KUBECONFIG</code> environment variable or the default path <code class="highlight"><span class="nv">$HOME</span>/.kube/config</code>) and directly switch to the new context:</p>
<div class="highlight"><pre><span></span><code>k3d get kubeconfig mycluster --switch
<div class="highlight"><pre><span></span><code>k3d kubeconfig merge mycluster --switch-context
</code></pre></div>
<p>Use the new cluster with <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/"><code>kubectl</code></a>, e.g.:</p>
@ -750,7 +750,7 @@
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 18, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -664,7 +664,7 @@ Using the <code>--network STRING</code> flag upon creation to connect to an exis
Existing networks won&rsquo;t be managed by k3d together with the cluster lifecycle.</p>
<h2 id="connecting-to-docker-internalpre-defined-networks">Connecting to docker &ldquo;internal&rdquo;/pre-defined networks<a class="headerlink" href="#connecting-to-docker-internalpre-defined-networks" title="Permanent link">&para;</a></h2>
<h3 id="host-network"><code>host</code> network<a class="headerlink" href="#host-network" title="Permanent link">&para;</a></h3>
<p>When using the <code>--network</code> flag to connect to the host network (i.e. <code>k3d create cluster --network host</code>),
<p>When using the <code>--network</code> flag to connect to the host network (i.e. <code>k3d cluster create --network host</code>),
you won&rsquo;t be able to create more than <strong>one master node</strong>.
An edge case would be one master node (with agent disabled) and one worker node.</p>
<h3 id="bridge-network"><code>bridge</code> network<a class="headerlink" href="#bridge-network" title="Permanent link">&para;</a></h3>
@ -681,7 +681,7 @@ run into issues with grabbing certificates from the API-Server. Single-Node clus
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">April 28, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

File diff suppressed because one or more lines are too long

Binary file not shown.

@ -535,10 +535,14 @@
<h1 id="command-tree">Command Tree<a class="headerlink" href="#command-tree" title="Permanent link">&para;</a></h1>
<div class="highlight"><pre><span></span><code>k3d
--runtime <span class="c1"># choose the container runtime (default: docker)</span>
--verbose <span class="c1"># enable verbose (debug) logging (default: false)</span>
create
cluster <span class="o">[</span>CLUSTERNAME<span class="o">]</span> <span class="c1"># default cluster name is &#39;k3s-default&#39;</span>
--version <span class="c1"># show k3d and k3s version</span>
-h, --help <span class="c1"># show help text</span>
version <span class="c1"># show k3d and k3s version</span>
<span class="nb">help</span> <span class="o">[</span>COMMAND<span class="o">]</span> <span class="c1"># show help text for any command</span>
completion <span class="o">[</span>bash <span class="p">|</span> zsh <span class="p">|</span> <span class="o">(</span>psh <span class="p">|</span> powershell<span class="o">)]</span> <span class="c1"># generate completion scripts for common shells</span>
cluster <span class="o">[</span>CLUSTERNAME<span class="o">]</span> <span class="c1"># default cluster name is &#39;k3s-default&#39;</span>
create
-a, --api-port <span class="c1"># specify the port on which the cluster will be accessible (e.g. via kubectl)</span>
-i, --image <span class="c1"># specify which k3s image should be used for the nodes</span>
--k3s-agent-arg <span class="c1"># add additional arguments to the k3s agent (see https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/#k3s-agent-cli-help)</span>
@ -554,48 +558,45 @@
-v, --volume <span class="c1"># specify additional bind-mounts</span>
--wait <span class="c1"># enable waiting for all master nodes to be ready before returning</span>
-w, --workers <span class="c1"># specify how many worker nodes you want to create</span>
node NODENAME <span class="c1"># Create new nodes (and add them to existing clusters)</span>
start CLUSTERNAME <span class="c1"># start a (stopped) cluster</span>
-a, --all <span class="c1"># start all clusters</span>
--wait <span class="c1"># wait for all masters and master-loadbalancer to be up before returning</span>
--timeout <span class="c1"># maximum waiting time for &#39;--wait&#39; before canceling/returning</span>
stop CLUSTERNAME <span class="c1"># stop a cluster</span>
-a, --all <span class="c1"># stop all clusters</span>
delete CLUSTERNAME <span class="c1"># delete an existing cluster</span>
-a, --all <span class="c1"># delete all existing clusters</span>
list <span class="o">[</span>CLUSTERNAME <span class="o">[</span>CLUSTERNAME ...<span class="o">]]</span>
--no-headers <span class="c1"># do not print headers</span>
--token <span class="c1"># show column with cluster tokens</span>
node
create NODENAME <span class="c1"># Create new nodes (and add them to existing clusters)</span>
-c, --cluster <span class="c1"># specify the cluster that the node shall connect to</span>
-i, --image <span class="c1"># specify which k3s image should be used for the node(s)</span>
--replicas <span class="c1"># specify how many replicas you want to create with this spec</span>
--role <span class="c1"># specify the node role</span>
--wait <span class="c1"># wait for the node to be up and running before returning</span>
--timeout <span class="c1"># specify a timeout duration, after which the node creation will be interrupted, if not done yet</span>
delete
cluster CLUSTERNAME <span class="c1"># delete an existing cluster</span>
-a, --all <span class="c1"># delete all existing clusters</span>
node NODENAME <span class="c1"># delete an existing node</span>
start NODENAME <span class="c1"># start a (stopped) node</span>
stop NODENAME <span class="c1"># stop a node</span>
delete NODENAME <span class="c1"># delete an existing node</span>
-a, --all <span class="c1"># delete all existing nodes</span>
start
cluster CLUSTERNAME <span class="c1"># start a (stopped) cluster</span>
-a, --all <span class="c1"># start all clusters</span>
--wait <span class="c1"># wait for all masters and master-loadbalancer to be up before returning</span>
--timeout <span class="c1"># maximum waiting time for &#39;--wait&#39; before canceling/returning</span>
node NODENAME <span class="c1"># start a (stopped) node</span>
stop
cluster CLUSTERNAME <span class="c1"># stop a cluster</span>
-a, --all <span class="c1"># stop all clusters</span>
node <span class="c1"># stop a node</span>
get
cluster <span class="o">[</span>CLUSTERNAME <span class="o">[</span>CLUSTERNAME ...<span class="o">]]</span>
list NODENAME
--no-headers <span class="c1"># do not print headers</span>
--token <span class="c1"># show column with cluster tokens</span>
node NODENAME
--no-headers <span class="c1"># do not print headers</span>
kubeconfig <span class="o">(</span>CLUSTERNAME <span class="o">[</span>CLUSTERNAME ...<span class="o">]</span> <span class="p">|</span> --all<span class="o">)</span>
kubeconfig
get <span class="o">(</span>CLUSTERNAME <span class="o">[</span>CLUSTERNAME ...<span class="o">]</span> <span class="p">|</span> --all<span class="o">)</span> <span class="c1"># get kubeconfig from cluster(s) and save it into a file in $HOME/.k3d</span>
-a, --all <span class="c1"># get kubeconfigs from all clusters</span>
merge <span class="o">(</span>CLUSTERNAME <span class="o">[</span>CLUSTERNAME ...<span class="o">]</span> <span class="p">|</span> --all<span class="o">)</span> <span class="c1"># get kubeconfig from cluster(s) and merge it/them into an existing kubeconfig</span>
-a, --all <span class="c1"># get kubeconfigs from all clusters</span>
--output <span class="c1"># specify the output file where the kubeconfig should be written to</span>
--overwrite <span class="c1"># [Careful!] forcefully overwrite the output file, ignoring existing contents</span>
-s, --switch-context <span class="c1"># switch current-context in kubeconfig to the new context</span>
-u, --update <span class="c1"># update conflicting fields in existing kubeconfig (default: true)</span>
-d, --merge-default-kubeconfig <span class="c1"># update the default kubeconfig (usually $KUBECONFIG or $HOME/.kube/config)</span>
load
image <span class="o">[</span>IMAGE <span class="p">|</span> ARCHIVE <span class="o">[</span>IMAGE <span class="p">|</span> ARCHIVE ...<span class="o">]]</span> <span class="c1"># Load one or more images from the local runtime environment or tar-archives into k3d clusters</span>
image
import <span class="o">[</span>IMAGE <span class="p">|</span> ARCHIVE <span class="o">[</span>IMAGE <span class="p">|</span> ARCHIVE ...<span class="o">]]</span> <span class="c1"># Load one or more images from the local runtime environment or tar-archives into k3d clusters</span>
-c, --cluster <span class="c1"># clusters to load the image into</span>
-k, --keep-tarball <span class="c1"># do not delete the image tarball from the shared volume after completion</span>
completion SHELL <span class="c1"># Generate completion scripts</span>
version <span class="c1"># show k3d build version</span>
<span class="nb">help</span> <span class="o">[</span>COMMAND<span class="o">]</span> <span class="c1"># show help text for any command</span>
</code></pre></div>
@ -605,7 +606,7 @@
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 22, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -606,7 +606,7 @@ Therefore, we have to create the cluster in a way, that the internal port 80 (wh
<ol>
<li>
<p>Create a cluster, mapping the ingress port 80 to localhost:8081</p>
<p><code class="highlight">k3d create cluster --api-port <span class="m">6550</span> -p <span class="m">8081</span>:80@loadbalancer --workers <span class="m">2</span></code></p>
<p><code class="highlight">k3d cluster create --api-port <span class="m">6550</span> -p <span class="m">8081</span>:80@loadbalancer --workers <span class="m">2</span></code></p>
<div class="admonition info">
<p class="admonition-title">Good to know</p>
<ul>
@ -624,7 +624,7 @@ Therefore, we have to create the cluster in a way, that the internal port 80 (wh
</li>
<li>
<p>Get the kubeconfig file</p>
<p><code class="highlight"><span class="nb">export</span> <span class="nv">KUBECONFIG</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>k3d get kubeconfig k3s-default<span class="k">)</span><span class="s2">&quot;</span></code></p>
<p><code class="highlight"><span class="nb">export</span> <span class="nv">KUBECONFIG</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>k3d kubeconfig get k3s-default<span class="k">)</span><span class="s2">&quot;</span></code></p>
</li>
<li>
<p>Create a nginx deployment</p>
@ -663,7 +663,7 @@ Therefore, we have to create the cluster in a way, that the internal port 80 (wh
<ol>
<li>
<p>Create a cluster, mapping the port 30080 from worker-0 to localhost:8082</p>
<p><code class="highlight">k3d create cluster mycluster -p <span class="m">8082</span>:30080@worker<span class="o">[</span><span class="m">0</span><span class="o">]</span> --workers <span class="m">2</span></code></p>
<p><code class="highlight">k3d cluster create mycluster -p <span class="m">8082</span>:30080@worker<span class="o">[</span><span class="m">0</span><span class="o">]</span> --workers <span class="m">2</span></code></p>
<ul>
<li>Note: Kubernetes&rsquo; default NodePort range is <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport"><code>30000-32767</code></a></li>
</ul>
@ -705,7 +705,7 @@ Therefore, we have to create the cluster in a way, that the internal port 80 (wh
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 18, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -724,7 +724,7 @@
<h1 id="registries">Registries<a class="headerlink" href="#registries" title="Permanent link">&para;</a></h1>
<h2 id="registries-configuration-file">Registries configuration file<a class="headerlink" href="#registries-configuration-file" title="Permanent link">&para;</a></h2>
<p>You can add registries by specifying them in a <code>registries.yaml</code> and mounting them at creation time:
<code class="highlight">k3d create cluster mycluster --volume /home/YOU/my-registries.yaml:/etc/rancher/k3s/registries.yaml</code>.</p>
<code class="highlight">k3d cluster create mycluster --volume /home/YOU/my-registries.yaml:/etc/rancher/k3s/registries.yaml</code>.</p>
<p>This file is a regular <a href="https://rancher.com/docs/k3s/latest/en/installation/private-registry/">k3s registries configuration file</a>, and looks like this:</p>
<div class="highlight"><pre><span></span><code><span class="nt">mirrors</span><span class="p">:</span>
<span class="s">&quot;my.company.registry:5000&quot;</span><span class="p p-Indicator">:</span>
@ -768,7 +768,7 @@ For example, if we mount the CA file in <code>/etc/ssl/certs/my-company-root.pem
</code></pre></div>
<p>Finally, we can create the cluster, mounting the CA file in the path we specified in <code>ca_file</code>:</p>
<p><code class="highlight">k3d create cluster --volume <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/.k3d/my-registries.yaml:/etc/rancher/k3s/registries.yaml --volume <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/.k3d/my-company-root.pem:/etc/ssl/certs/my-company-root.pem</code></p>
<p><code class="highlight">k3d cluster create --volume <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/.k3d/my-registries.yaml:/etc/rancher/k3s/registries.yaml --volume <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/.k3d/my-company-root.pem:/etc/ssl/certs/my-company-root.pem</code></p>
<h2 id="using-a-local-registry">Using a local registry<a class="headerlink" href="#using-a-local-registry" title="Permanent link">&para;</a></h2>
<h3 id="using-the-k3d-registry">Using the k3d registry<a class="headerlink" href="#using-the-k3d-registry" title="Permanent link">&para;</a></h3>
<div class="admonition info">
@ -866,7 +866,7 @@ sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
</pre>
<p>and then mount it at <code>/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl</code> (where <code>containerd</code> in your k3d nodes will load it) when creating the k3d cluster:</p>
<div class="highlight"><pre><span></span><code>k3d create cluster mycluster <span class="se">\</span>
<div class="highlight"><pre><span></span><code>k3d cluster create mycluster <span class="se">\</span>
--volume <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/.k3d/config.toml.tmpl:/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl
</code></pre></div>
@ -877,7 +877,7 @@ sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 2, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -623,27 +623,27 @@ To get a kubeconfig set up for you to connect to a k3d cluster, you can go diffe
<h2 id="getting-the-kubeconfig-for-a-newly-created-cluster">Getting the kubeconfig for a newly created cluster<a class="headerlink" href="#getting-the-kubeconfig-for-a-newly-created-cluster" title="Permanent link">&para;</a></h2>
<ol>
<li>Create a new kubeconfig file <strong>after</strong> cluster creation<ul>
<li><code class="highlight">k3d get kubeconfig mycluster</code></li>
<li><code class="highlight">k3d kubeconfig get mycluster</code></li>
<li><em>Note:</em> this will create (or update) the file <code>$HOME/.k3d/kubeconfig-mycluster.yaml</code></li>
<li><em>Tip:</em> Use it: <code class="highlight"><span class="nb">export</span> <span class="nv">KUBECONFIG</span><span class="o">=</span><span class="k">$(</span>k3d get kubeconfig mycluster<span class="k">)</span></code></li>
<li><em>Tip:</em> Use it: <code class="highlight"><span class="nb">export</span> <span class="nv">KUBECONFIG</span><span class="o">=</span><span class="k">$(</span>k3d kubeconfig get mycluster<span class="k">)</span></code></li>
</ul>
</li>
<li>Update your default kubeconfig <strong>upon</strong> cluster creation<ul>
<li><code class="highlight">k3d create cluster mycluster --update-kubeconfig</code><ul>
<li><code class="highlight">k3d cluster create mycluster --update-kubeconfig</code><ul>
<li><em>Note:</em> this won&rsquo;t switch the current-context (append <code>--switch-context</code> to do so)</li>
</ul>
</li>
</ul>
</li>
<li>Update your default kubeconfig <strong>after</strong> cluster creation<ul>
<li><code class="highlight">k3d get kubeconfig mycluster --merge-default-kubeconfig</code><ul>
<li><code class="highlight">k3d kubeconfig merge mycluster --merge-default-kubeconfig</code><ul>
<li><em>Note:</em> this won&rsquo;t switch the current-context (append <code>--switch-context</code> to do so)</li>
</ul>
</li>
</ul>
</li>
<li>Update a different kubeconfig <strong>after</strong> cluster creation<ul>
<li><code class="highlight">k3d get kubeconfig mycluster --output some/other/file.yaml</code><ul>
<li><code class="highlight">k3d kubeconfig merge mycluster --output some/other/file.yaml</code><ul>
<li><em>Note:</em> this won&rsquo;t switch the current-context</li>
</ul>
</li>
@ -655,13 +655,13 @@ To get a kubeconfig set up for you to connect to a k3d cluster, you can go diffe
<p class="admonition-title">Switching the current context</p>
<p>None of the above options switch the current-context by default.
This is intended to be least intrusive, since the current-context has a global effect.
You can switch the current-context directly with the <code>get kubeconfig</code> command by adding the <code>--switch-context</code> flag.</p>
You can switch the current-context directly with the <code>kubeconfig merge</code> command by adding the <code>--switch-context</code> flag.</p>
</div>
<h2 id="removing-cluster-details-from-the-kubeconfig">Removing cluster details from the kubeconfig<a class="headerlink" href="#removing-cluster-details-from-the-kubeconfig" title="Permanent link">&para;</a></h2>
<p><code class="highlight">k3d delete cluster mycluster</code> will always remove the details for <code>mycluster</code> from the default kubeconfig.
<p><code class="highlight">k3d cluster delete mycluster</code> will always remove the details for <code>mycluster</code> from the default kubeconfig.
It will also delete the respective kubeconfig file in <code>$HOME/.k3d/</code> if it exists.</p>
<h2 id="handling-multiple-clusters">Handling multiple clusters<a class="headerlink" href="#handling-multiple-clusters" title="Permanent link">&para;</a></h2>
<p><code>k3d get kubeconfig</code> let&rsquo;s you specify one or more clusters via arguments <em>or</em> all via <code>--all</code>.
<p><code>k3d kubeconfig merge</code> let&rsquo;s you specify one or more clusters via arguments <em>or</em> all via <code>--all</code>.
All kubeconfigs will then be merged into a single file if <code>--merge-default-kubeconfig</code> or <code>--output</code> is specified.
If none of those two flags was specified, a new file will be created per cluster and the merged path (e.g. <code>$HOME/.k3d/kubeconfig-cluster1.yaml:$HOME/.k3d/cluster2.yaml</code>) will be returned.
Note, that with multiple cluster specified, the <code>--switch-context</code> flag will change the current context to the cluster which was last in the list.</p>
@ -673,7 +673,7 @@ Note, that with multiple cluster specified, the <code>--switch-context</code> fl
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 22, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

@ -605,12 +605,12 @@
<h2 id="embedded-dqlite">Embedded dqlite<a class="headerlink" href="#embedded-dqlite" title="Permanent link">&para;</a></h2>
<p>Create a cluster with 3 master nodes using k3s&rsquo; embedded dqlite database.
The first master to be created will use the <code>--cluster-init</code> flag and k3d will wait for it to be up and running before creating (and connecting) the other master nodes.</p>
<div class="highlight"><pre><span></span><code> k3d create cluster multimaster --masters <span class="m">3</span>
<div class="highlight"><pre><span></span><code> k3d cluster create multimaster --masters <span class="m">3</span>
</code></pre></div>
<h2 id="adding-master-nodes-to-a-running-cluster">Adding master nodes to a running cluster<a class="headerlink" href="#adding-master-nodes-to-a-running-cluster" title="Permanent link">&para;</a></h2>
<p>In theory (and also in practice in most cases), this is as easy as executing the following command:</p>
<div class="highlight"><pre><span></span><code> k3d create node newmaster --cluster multimaster --role master
<div class="highlight"><pre><span></span><code> k3d node create newmaster --cluster multimaster --role master
</code></pre></div>
<div class="admonition important">
@ -626,7 +626,7 @@ That&rsquo;s because the initial master node was not started with the <code>--cl
<div class="md-source-date">
<small>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">May 16, 2020</span>
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 14, 2020</span>
</small>
</div>

Loading…
Cancel
Save