Merge: 8278e8d 18bc8b8
Author: Thorsten Klein <iwilltry42@gmail.com>
Date:   Wed Jul 8 15:22:51 2020 +0200

    Merge pull request #288 from rancher/kubeconfig-default

    [Enhancement] New kubeconfig defaults
pull/308/head
iwilltry42 4 years ago
parent eb7ac322bd
commit 499d73b031
  1. 2
      faq/faq/index.html
  2. 2
      faq/v1vsv3-comparison/index.html
  3. 2
      index.html
  4. 16
      internals/defaults/index.html
  5. 2
      internals/networking/index.html
  6. 2
      search/search_index.json
  7. 20
      sitemap.xml
  8. BIN
      sitemap.xml.gz
  9. 9
      usage/commands/index.html
  10. 4
      usage/guides/exposing_services/index.html
  11. 2
      usage/guides/registries/index.html
  12. 26
      usage/kubeconfig/index.html
  13. 2
      usage/multimaster/index.html

@ -671,7 +671,7 @@
<div class="md-source-date">
<small>
Last update: June 4, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 4, 2020</span>
</small>
</div>

@ -651,7 +651,7 @@
<div class="md-source-date">
<small>
Last update: June 4, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 4, 2020</span>
</small>
</div>

@ -750,7 +750,7 @@
<div class="md-source-date">
<small>
Last update: June 8, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 18, 2020</span>
</small>
</div>

@ -535,21 +535,27 @@
<h1 id="defaults">Defaults<a class="headerlink" href="#defaults" title="Permanent link">&para;</a></h1>
<ul>
<li>multiple master nodes</li>
<li>multiple master nodes<ul>
<li>by default, when <code>--master</code> &gt; 1 and no <code>--datastore-x</code> option is set, the first master node (master-0) will be the initializing master node<ul>
<li>the initializing master node will have the <code>--cluster-init</code> flag appended</li>
<li>all other master nodes will refer to the initializing master node via <code>--server https://&lt;init-node&gt;:6443</code></li>
</ul>
</li>
<li>API-Ports</li>
</ul>
</li>
<li>API-Ports<ul>
<li>by default, we don&rsquo;t expose any API-Port (no host port mapping)</li>
<li>kubeconfig</li>
<li>if no output is set explicitly (via the <code>--output</code> flag), we use the default loading rules to get the default kubeconfig:<ul>
</ul>
</li>
<li>kubeconfig<ul>
<li>if <code>--[update|merge]-default-kubeconfig</code> is set, we use the default loading rules to get the default kubeconfig:<ul>
<li>First: kubeconfig specified via the KUBECONFIG environment variable (error out if multiple are specified)</li>
<li>Second: default kubeconfig in home directory (e.g. <code>$HOME/.kube/config</code>)</li>
</ul>
</li>
</ul>
</li>
</ul>
@ -558,7 +564,7 @@
<div class="md-source-date">
<small>
Last update: April 28, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 22, 2020</span>
</small>
</div>

@ -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: April 28, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">April 28, 2020</span>
</small>
</div>

File diff suppressed because one or more lines are too long

@ -1,43 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>https://k3d.io/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/usage/commands/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/usage/kubeconfig/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/usage/multimaster/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/usage/guides/exposing_services/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/usage/guides/registries/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/internals/defaults/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/internals/networking/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/faq/faq/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://k3d.io/faq/v1vsv3-comparison/</loc>
<lastmod>2020-06-29</lastmod>
<lastmod>2020-07-08</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

@ -549,8 +549,8 @@
-p, --port <span class="c1"># add some more port mappings</span>
--token <span class="c1"># specify a cluster token (default: auto-generated)</span>
--timeout <span class="c1"># specify a timeout, after which the cluster creation will be interrupted and changes rolled back</span>
--update-kubeconfig <span class="c1"># enable the automated update of the default kubeconfig with the details of the newly created cluster (also sets &#39;--wait=true&#39;)</span>
--switch <span class="c1"># (implies --update-kubeconfig) automatically sets the current-context of your default kubeconfig to the new cluster&#39;s context</span>
--update-default-kubeconfig <span class="c1"># enable the automated update of the default kubeconfig with the details of the newly created cluster (also sets &#39;--wait=true&#39;)</span>
--switch-context <span class="c1"># (implies --update-default-kubeconfig) automatically sets the current-context of your default kubeconfig to the new cluster&#39;s context</span>
-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>
@ -586,8 +586,9 @@
-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 <span class="c1"># switch current-context in kubeconfig to the new context</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>
-c, --cluster <span class="c1"># clusters to load the image into</span>
@ -604,7 +605,7 @@
<div class="md-source-date">
<small>
Last update: June 4, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 22, 2020</span>
</small>
</div>

@ -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 --name<span class="o">=</span><span class="s1">&#39;k3s-default&#39;</span><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 get kubeconfig k3s-default<span class="k">)</span><span class="s2">&quot;</span></code></p>
</li>
<li>
<p>Create a nginx deployment</p>
@ -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: May 11, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 18, 2020</span>
</small>
</div>

@ -877,7 +877,7 @@ sandbox_image = "{{ .NodeConfig.AgentConfig.PauseImage }}"
<div class="md-source-date">
<small>
Last update: June 2, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 2, 2020</span>
</small>
</div>

@ -622,16 +622,22 @@ To get a kubeconfig set up for you to connect to a k3d cluster, you can go diffe
</details>
<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><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>
</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><em>Note:</em> this won&rsquo;t switch the current-context</li>
<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</code><ul>
<li><em>Note:</em> this won&rsquo;t switch the current-context</li>
<li><code class="highlight">k3d get kubeconfig 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>
@ -647,16 +653,18 @@ To get a kubeconfig set up for you to connect to a k3d cluster, you can go diffe
</ol>
<div class="admonition info">
<p class="admonition-title">Switching the current context</p>
<p>None of the above options switch the current-context.
<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</code> flag.</p>
You can switch the current-context directly with the <code>get kubeconfig</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>
<p><code class="highlight">k3d delete cluster 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>.
All kubeconfigs will then be merged into a single file, which is either the default kubeconfig or the kubeconfig specified via <code>--output FILE</code>.
Note, that with multiple cluster specified, the <code>--switch</code> flag will change the current context to the cluster which was last in the list.</p>
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>
@ -665,7 +673,7 @@ Note, that with multiple cluster specified, the <code>--switch</code> flag will
<div class="md-source-date">
<small>
Last update: May 11, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">June 22, 2020</span>
</small>
</div>

@ -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: May 16, 2020
Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">May 16, 2020</span>
</small>
</div>

Loading…
Cancel
Save