Absolutely! Here’s a step-by-step tutorial for installing NGINX Ingress on a K3s cluster using the Helm Controller (also known as Helm Operator or Helm Controller in Flux v2 ), after disabling Traefik (the default K3s ingress controller).
Step 1: Install K3s with Traefik Disabled
When installing K3s, disable Traefik by adding --disable traefik:
bash Copy code
curl -sfL https://get.k3s.io | sh -s - --disable traefik
Step 2: Install Helm Controller
Option A: Using Flux v2 Helm Controller (Recommended)
Install Flux CLI:
bash Copy code
curl -s https://fluxcd.io/install.sh | sudo bash
Install Flux components (including Helm Controller):
bash Copy code
flux install
This will install the Helm Controller in the flux-system namespace.
Step 3: Create a HelmRelease for NGINX Ingress
1. Create a Namespace for NGINX Ingress
bash Copy code
kubectl create namespace ingress-nginx
2. Create a HelmRepository Resource
Create a file named nginx-helm-repo.yaml:
yaml Copy code
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: ingress-nginx
namespace: flux-system
spec:
url: https://kubernetes.github.io/ingress-nginx
Apply it:
bash Copy code
kubectl apply -f nginx-helm-repo.yaml
3. Create a HelmRelease Resource
Create a file named nginx-helmrelease.yaml:
yaml Copy code
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: ingress-nginx
namespace: ingress-nginx
spec:
interval: 5m
chart:
spec:
chart: ingress-nginx
version: "4.10.1" # Use the latest stable version
sourceRef:
kind: HelmRepository
name: ingress-nginx
namespace: flux-system
values:
controller:
replicaCount: 1
service:
type: LoadBalancer
Apply it:
bash Copy code
kubectl apply -f nginx-helmrelease.yaml
Step 4: Verify the Installation
Check the status of the HelmRelease:
bash Copy code
kubectl -n ingress-nginx get helmrelease
Check the pods:
bash Copy code
kubectl -n ingress-nginx get pods
Check the service (get the external IP):
bash Copy code
kubectl -n ingress-nginx get svc
Step 5: Test the Ingress Controller
Deploy a test app and an Ingress resource to verify NGINX is working.
Summary
K3s installed with Traefik disabled.
Flux Helm Controller installed.
HelmRepository and HelmRelease created for NGINX Ingress.
NGINX Ingress is now managing ingress traffic in your K3s cluster.
Let me know if you need a sample test app and ingress resource, or if you want to use the legacy Helm Operator instead!