<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How-to on KubeClaw</title><link>https://projectious-work.github.io/kubeclaw/docs/how-to/</link><description>Recent content in How-to on KubeClaw</description><generator>Hugo</generator><language>en</language><atom:link href="https://projectious-work.github.io/kubeclaw/docs/how-to/index.xml" rel="self" type="application/rss+xml"/><item><title>SSH Keys with Passphrase</title><link>https://projectious-work.github.io/kubeclaw/docs/how-to/ssh-keys-with-passphrase/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://projectious-work.github.io/kubeclaw/docs/how-to/ssh-keys-with-passphrase/</guid><description>&lt;h2 id="why-use-a-passphrase"&gt;Why use a passphrase?&lt;/h2&gt;
&lt;p&gt;An SSH key without a passphrase is like a house key without a lock on the key cabinet. If your laptop or key file is stolen, the attacker gains immediate access to your cluster.&lt;/p&gt;
&lt;h2 id="creating-keys-with-a-passphrase"&gt;Creating keys with a passphrase&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Control node key&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh-keygen -t ed25519 -f ~/.ssh/k8s-cluster_control-node_key -C &lt;span class="s2"&gt;&amp;#34;k8s-control&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Enter a strong passphrase when prompted&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Worker node key&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh-keygen -t ed25519 -f ~/.ssh/k8s-cluster_worker-node_key -C &lt;span class="s2"&gt;&amp;#34;k8s-worker&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Enter a passphrase when prompted&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="using-ssh-agent"&gt;Using ssh-agent&lt;/h2&gt;
&lt;p&gt;Since Terraform and Ansible cannot directly use encrypted keys, you must use ssh-agent:&lt;/p&gt;</description></item><item><title>Store SSH Keys in Password Manager</title><link>https://projectious-work.github.io/kubeclaw/docs/how-to/store-ssh-keys-in-password-manager/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://projectious-work.github.io/kubeclaw/docs/how-to/store-ssh-keys-in-password-manager/</guid><description>&lt;p&gt;Storing SSH keys in a password manager provides a secure backup that survives hardware failures and makes it easy to restore access from a new machine.&lt;/p&gt;
&lt;h2 id="general-workflow"&gt;General workflow&lt;/h2&gt;
&lt;p&gt;This workflow applies to any password manager that supports secure notes or file attachments (Dashlane, 1Password, Bitwarden, etc.).&lt;/p&gt;
&lt;h3 id="1-create-keys-locally"&gt;1. Create keys locally&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh-keygen -t ed25519 -f ~/.ssh/k8s-cluster_control-node_key -C &lt;span class="s2"&gt;&amp;#34;control-node&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh-keygen -t ed25519 -f ~/.ssh/k8s-cluster_worker-node_key -C &lt;span class="s2"&gt;&amp;#34;worker-node&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="2-save-to-your-password-manager"&gt;2. Save to your password manager&lt;/h3&gt;
&lt;p&gt;Create a secure note or vault entry:&lt;/p&gt;</description></item><item><title>Manual Setup (Alternative)</title><link>https://projectious-work.github.io/kubeclaw/docs/how-to/manual-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://projectious-work.github.io/kubeclaw/docs/how-to/manual-setup/</guid><description>&lt;div class="alert alert-primary" role="alert"&gt;&lt;div class="h4 alert-heading" role="heading"&gt;This guide is an alternative to OpenTofu&lt;/div&gt;


This guide shows the manual steps that OpenTofu automates. Use this if you want to understand what happens behind the scenes, or if you prefer to set up infrastructure manually via the Hetzner Cloud Console. For the automated approach, see [Infrastructure (OpenTofu)](/kubeclaw/docs/guide/infrastructure/).

&lt;/div&gt;

&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;This setup creates a secure server infrastructure with the following properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No public IPv4/IPv6 addresses&lt;/strong&gt; (after setup)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSH access exclusively via Cloudflare Tunnel&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internal communication via Hetzner Private Network&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hardened SSH configuration with fail2ban and UFW&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="architecture"&gt;Architecture&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────────────┐
│ Internet │
└─────────────────────────────────────────────────────────────────┘
 │
 ▼
┌─────────────────────────────────────────────────────────────────┐
│ Cloudflare Tunnel │
│ console.yourdomain.org │
└─────────────────────────────────────────────────────────────────┘
 │
 ▼
┌─────────────────────────────────────────────────────────────────┐
│ Hetzner Cloud │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Private Network (10.0.0.0/24) │ │
│ │ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ │ │
│ │ │ control-node │ │ worker-node │ │ │
│ │ │ 10.0.0.2 │◄─────►│ 10.0.0.3 │ │ │
│ │ │ (cloudflared) │ │ (isolated) │ │ │
│ │ └─────────────────┘ └─────────────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Hetzner Cloud account&lt;/li&gt;
&lt;li&gt;Cloudflare account with your own domain&lt;/li&gt;
&lt;li&gt;macOS/Linux machine with SSH&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cloudflared&lt;/code&gt; installed locally (&lt;code&gt;brew install cloudflared&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="step-1-create-hetzner-private-network"&gt;Step 1: Create Hetzner Private Network&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.hetzner.cloud"&gt;Hetzner Cloud Console&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Select your project&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Networks&lt;/strong&gt; &amp;gt; &lt;strong&gt;Create Network&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Configure:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name&lt;/strong&gt;: &lt;code&gt;k8s-network&lt;/code&gt; (or any name)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IP Range&lt;/strong&gt;: &lt;code&gt;10.0.0.0/8&lt;/code&gt; (Hetzner requires &lt;code&gt;/8&lt;/code&gt; for the network object)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Network&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;Subnet&lt;/strong&gt;: &lt;code&gt;10.0.0.0/24&lt;/code&gt; in zone &lt;code&gt;eu-central&lt;/code&gt; (this is the actual range used by nodes)&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="step-2-generate-ssh-keys"&gt;Step 2: Generate SSH keys&lt;/h2&gt;
&lt;p&gt;Create a separate SSH key for each server:&lt;/p&gt;</description></item></channel></rss>