kind.html (3763B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <!-- Sep 03, 2024 --> 5 <meta charset="utf-8" /> 6 <meta name="viewport" content="width=device-width, initial-scale=1" /> 7 <title>kind</title> 8 <meta name="author" content="Vincent Demeester" /> 9 <meta name="keywords" content="post" /> 10 <meta name="generator" content="Org Mode" /> 11 <link rel="stylesheet" type="text/css" href="/css/2022.css" /> 12 <link rel="stylesheet" type="text/css" href="/css/syntax.css" /> 13 <link rel='icon' type='image/x-icon' href='/images/favicon.ico'/> 14 <meta name='viewport' content='width=device-width, initial-scale=1'> 15 </head> 16 <body> 17 <main id="content" class="content"> 18 <header> 19 <h1 class="title">kind</h1> 20 </header><p> 21 <a href="https://kind.sigs.k8s.io/"><code>kind</code></a> runs <a href="kubernetes.html">Kubernetes</a> in <a href="docker.html">Docker</a> containers, and maybe more in the future. 22 </p> 23 <section id="outline-container-Multi-node%20setup" class="outline-2"> 24 <h2 id="Multi-node%20setup">Multi-node setup</h2> 25 <div class="outline-text-2" id="text-Multi-node%20setup"> 26 <p> 27 I am using the following configuration to be able to run a <code>kind</code> cluster on one of my local 28 server and target it from my laptop. 29 </p> 30 31 <div class='drawer note'> 32 <h6>Note</h6> 33 <p> 34 wakasu.home IP is <code>192.168.1.77</code> 35 </p> 36 </div> 37 38 <div class="org-src-container"> 39 <pre class="src src-yaml">kind: Cluster 40 apiVersion: kind.x-k8s.io/v1alpha4 41 networking: 42 apiServerAddress: "192.168.1.77" 43 apiServerPort: 8443 44 containerdConfigPatches: 45 - |- 46 [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"] 47 endpoint = ["http://sakhalin.home:5000"] 48 nodes: 49 - role: control-plane 50 kubeadmConfigPatches: 51 - | 52 kind: InitConfiguration 53 nodeRegistration: 54 kubeletExtraArgs: 55 node-labels: "ingress-ready=true" 56 extraPortMappings: 57 - containerPort: 80 58 hostPort: 80 59 protocol: TCP 60 - containerPort: 443 61 hostPort: 443 62 protocol: TCP 63 - role: worker 64 - role: worker 65 </pre> 66 </div> 67 68 <p> 69 Then, to provision this and get the configuration file, it’s a matter of 2 commands. 70 </p> 71 72 <div class="org-src-container"> 73 <pre class="src src-shell">ssh wakasu.home kind create cluster --config ~/var/kind/wakasu.kind.yaml --name wakasu 74 ssh wakasu.home kind get kubeconfig --name wakasu > ~/.kube/config.wakasu.kind 75 cat <<EOF | kubectl --kubeconfig=$<span class="org-variable-name">HOME</span>/.kube/config.wakasu.kind apply -f - 76 <span class="org-sh-heredoc">apiVersion: v1</span> 77 <span class="org-sh-heredoc">kind: ConfigMap</span> 78 <span class="org-sh-heredoc">metadata:</span> 79 <span class="org-sh-heredoc"> name: local-registry-hosting</span> 80 <span class="org-sh-heredoc"> namespace: kube-public</span> 81 <span class="org-sh-heredoc">data:</span> 82 <span class="org-sh-heredoc"> localRegistryHosting.v1: |</span> 83 <span class="org-sh-heredoc"> host: "localhost:5000"</span> 84 <span class="org-sh-heredoc"> help: "https://kind.sigs.k8s.io/docs/user/local-registry/"</span> 85 <span class="org-sh-heredoc">EOF</span> 86 </pre> 87 </div> 88 </div> 89 </section> 90 </main> 91 <footer id="postamble" class="status"> 92 <footer> 93 <small><a href="/" rel="history">Index</a> • <a href="/sitemap.html">Sitemap</a> • <a href="https://dl.sbr.pm/">Files</a></small><br/> 94 <small class='questions'>Questions, comments ? Please use my <a href="https://lists.sr.ht/~vdemeester/public-inbox">public inbox</a> by sending a plain-text email to <a href="mailto:~vdemeester/public-inbox@lists.sr.ht">~vdemeester/public-inbox@lists.sr.ht</a>.</small><br/> 95 <small class='copyright'> 96 Content and design by Vincent Demeester 97 (<a rel='licence' href='http://creativecommons.org/licenses/by-nc-sa/3.0/'>Some rights reserved</a>) 98 </small><br /> 99 </footer> 100 </footer> 101 </body> 102 </html>