* Conoscenza del computer >> Computer >  >> Social media

Installare Kubefwd su Windows 10 (WSL + K3s + PowerShell)

Kubefwd fa port-forward di servizi Kubernetes su localhost. Su Windows usa WSL2.

1. Abilitare WSL2

# PowerShell Admin
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# Riavvia, poi:
wsl --set-default-version 2
wsl --install -d Ubuntu

2. Installare K3s in WSL

# In WSL Ubuntu
curl -sfL https://get.k3s.io | sh -s - --docker

3. Installare kubectl (Windows)

# PowerShell
Install-Module -Name kubectl-win -Force

4. Installare Kubefwd (Windows)

Install-Module -Name kubefwd -Force

5. Verificare connettività

kubectl-win get pods -A --kubeconfig ~/.kube/config

6. Port-forward

kubefwd --kubeconfig ~/.kube/config port-forward svc/mio-servizio:80 8080

7. Accedere

Browser → https://localhost:8080.

Conclusione

Kubefwd su Windows via WSL2/K3s semplifica accesso a servizi cluster.

Social media

  • --热点Computer