Sure! Here's a step-by-step tutorial on how to install NGINX Ingress Controller using Helm Controller in K3s, assuming that Traefik has been disabled.
✅ Prerequisites
- You have a running K3s cluster.
- Traefik is disabled (you can do this by passing
--disable=traefik when installing K3s).
- Helm Controller is enabled in your K3s setup (by default, it's enabled unless you pass
--disable-helm-controller).
🧭 Step-by-Step Guide
🔹 Step 1: Verify Helm Controller is Running
The Helm Controller is part of Rancher System Management and comes pre-enabled in K3s.
kubectl get pods -n kube-system | grep helm-controller
If it's not there, enable it by reinstalling K3s with:
curl -sfL https://get.k3s.io | sh -s - --disable traefik
🔹 Step 2: Create a Namespace for NGINX Ingress
kubectl create namespace ingress-nginx
🔹 Step 3: Add the NGINX Ingress Helm Repo
You need to add the official NGINX Ingress Helm repository.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
🔹 Step 4: Deploy NGINX Ingress Using Helm via Helm Controller
Instead of using helm install, we'll use the Helm Controller in K3s by creating a HelmChart custom resource.
📄 Create a file called nginx-ingress.yaml
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: nginx-ingress
namespace: ingress-nginx
spec:
chart: ingress-nginx
version: 4.8.1 # Use latest version from https://github.com/kubernetes/ingress-nginx/releases
targetNamespace: ingress-nginx
repo: https://kubernetes.github.io/ingress-nginx
valuesContent: |
controller:
service:
type: LoadBalancer
annotations:
metallb.universe.tf/address-pool: default # Optional: if using MetalLB
💡 If you're using MetalLB, make sure the annotation matches your pool name.
For cloud providers like AWS/GCP, LoadBalancer will provision an external IP automatically.
Apply the manifest:
kubectl apply -f nginx-ingress.yaml
🔹 Step 5: Wait for Deployment
Check the status of the deployment:
kubectl get all -n ingress-nginx
Once the pod is running and the service has an external IP:
kubectl get svc -n ingress-nginx
Output should look like:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
ingress-nginx LoadBalancer 10.43.123.45 192.168.1.100 80:30080/TCP,443:30443/TCP
🔹 Step 6: Test Your Ingress Setup
Create a simple test application and expose it through an Ingress.
📄 Create a test app:
# test-app.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-app
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: test-app
template:
metadata:
labels:
app: test-app
spec:
containers:
- name: test-app
image: containous/whoami
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: test-app-svc
namespace: default
spec:
selector:
app: test-app
ports:
- protocol: TCP
port: 80
targetPort: 80
Apply it:
kubectl apply -f test-app.yaml
📄 Create an Ingress for the test app:
# test-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-ingress
namespace: default
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: test-app-svc
port:
number: 80
Apply it:
kubectl apply -f test-ingress.yaml
🔹 Step 7: Access the App
Now visit the external IP or hostname mapped to the NGINX Ingress Controller.
curl http://<EXTERNAL-IP>
You should see something like:
Hostname: test-app-...
IP: 127.0.0.1
...
🧠 Troubleshooting Tips
- Check NGINX Ingress Pod logs:
kubectl logs -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx
- Make sure Ingress class is set correctly if multiple controllers exist.
- Ensure no other ingress controllers are installed.
- If using NodePort, access via node IP + port.
✅ Summary
| Step | Description |
|---|
| 1 | Ensure Helm Controller is active |
| 2 | Create namespace for NGINX Ingress |
| 3 | Add NGINX Ingress Helm repo |
| 4 | Deploy using HelmChart CRD |
| 5 | Monitor rollout and check service |
| 6 | Deploy sample app and Ingress |
| 7 | Test access |
Let me know if you'd like to also include TLS support, DNS integration, or MetalLB configuration!