2 Commits

Author SHA1 Message Date
Michal
aea28b5a0f fix: Cilium multi-node support — auto-detect NIC, k3s agent API port, worker label
Some checks failed
CI/CD / typecheck (pull_request) Failing after 10s
CI/CD / lint (pull_request) Failing after 22s
CI/CD / test (pull_request) Failing after 7m8s
CI/CD / build (pull_request) Has been skipped
CI/CD / publish-rpm (pull_request) Has been skipped
CI/CD / publish-deb (pull_request) Has been skipped
- Remove hardcoded devices/directRoutingDevice from Cilium install (let
  Cilium auto-detect per node — needed for heterogeneous NICs like eno1 vs enP7s7)
- Set k8sServiceHost=127.0.0.1 k8sServicePort=6444 so Cilium init
  containers can reach the API via k3s agent's local LB proxy
- Add node-role.kubernetes.io/worker label to agent config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:35:51 +01:00
f3f0ea48e7 Merge pull request 'feat: provision register + k3s kubeconfig' (#8) from feat/register-and-kubeconfig into main
Some checks failed
CI/CD / lint (push) Failing after 10s
CI/CD / test (push) Failing after 10s
CI/CD / typecheck (push) Failing after 21s
CI/CD / build (push) Has been skipped
CI/CD / publish-rpm (push) Has been skipped
CI/CD / publish-deb (push) Has been skipped
2026-03-31 00:16:06 +00:00
2 changed files with 6 additions and 10 deletions

View File

@@ -35,21 +35,15 @@ export const installCilium: Operation = async (ctx): Promise<OperationResult> =>
} }
details.push(`Installed cilium CLI ${version} (${cliArch})`); details.push(`Installed cilium CLI ${version} (${cliArch})`);
// Detect default network device (avoid tailscale/wireguard)
const devResult = await ctx.ssh.exec(
"ip -4 route show default | awk '{print $5}' | head -1",
sshOpts(ctx),
);
const defaultDev = devResult.stdout.trim();
details.push(`Network device: ${defaultDev}`);
// Install Cilium // Install Cilium
// - No hardcoded devices: Cilium auto-detects per node (heterogeneous NICs like eno1 vs enP7s7)
// - k8sServiceHost/Port: k3s agents proxy the API on 127.0.0.1:6444 (not 6443)
const installResult = await ctx.ssh.exec( const installResult = await ctx.ssh.exec(
`KUBECONFIG=/etc/rancher/k3s/k3s.yaml cilium install \ `KUBECONFIG=/etc/rancher/k3s/k3s.yaml cilium install \
--set kubeProxyReplacement=true \ --set kubeProxyReplacement=true \
--set ipam.mode=kubernetes \ --set ipam.mode=kubernetes \
--set devices="${defaultDev}" \ --set k8sServiceHost=127.0.0.1 \
--set nodePort.directRoutingDevice="${defaultDev}"`, --set k8sServicePort=6444`,
{ timeoutMs: 300_000 }, { timeoutMs: 300_000 },
); );
if (installResult.exitCode !== 0) { if (installResult.exitCode !== 0) {

View File

@@ -42,6 +42,8 @@ ${tlsSans.map((s) => ` - "${s}"`).join("\n")}
function generateAgentConfig(): string { function generateAgentConfig(): string {
return `protect-kernel-defaults: true return `protect-kernel-defaults: true
node-label:
- "node-role.kubernetes.io/worker=true"
kubelet-arg: kubelet-arg:
- "protect-kernel-defaults=true" - "protect-kernel-defaults=true"
- "streaming-connection-idle-timeout=5m" - "streaming-connection-idle-timeout=5m"