KevsRobots Learning Platform
55% Percent Complete
By Kevin McAleer, 3 Minutes
Page last updated May 24, 2025

By default, Kubernetes services are only accessible inside the cluster. To make apps available on your local network or the internet, youβll need to use Services and optionally an Ingress controller.
K3s includes Traefik as its default ingress controller, which makes this easy to configure.
A Kubernetes Service is an abstraction that exposes a set of pods to other services or users.
| Type | Use Case |
|---|---|
| ClusterIP | Internal-only (default) |
| NodePort | Exposes app on a fixed port |
| LoadBalancer | Cloud environments (external IP) |
Letβs say you have a deployment called hello-world (like from Lesson 8). You can expose it:
kubectl expose deployment hello-world --port=80 --type=NodePort
Check the assigned port:
kubectl get svc hello-world
Then open http://<node-ip>:<nodePort> in your browser.
Ingress is a more flexible way to expose multiple services using a reverse proxy and host/path routing.
Example:
http://pi.local/app1 β nginx apphttp://pi.local/app2 β another serviceK3s ships with Traefik, a built-in Ingress controller.
Create a file called hello-ingress.yaml:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-ingress
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
rules:
- host: hello.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello-world
port:
number: 80
Apply it:
kubectl apply -f hello-ingress.yaml
On your workstation, edit /etc/hosts:
192.168.1.100 hello.local
Replace 192.168.1.100 with your master node IP.
Now try visiting:
http://hello.local
Check if the Ingress was created:
kubectl get ingress
Check Traefik logs (optional):
kubectl logs -n kube-system -l app=traefik
K3s and Traefik support automated HTTPS with Letβs Encrypt β but youβll need a real domain and port 80/443 open.
If youβd like to add this, let me know and I can walk you through it.
You now know how to:
NodePort to expose services to the LANNext up: Deploying Apps
You can use the arrows β β on your keyboard to navigate between lessons.
Comments