I'm developing a physical cluster with Load Balancer, Ingress and Ingress Controller for academic purposes using single-board computers (Raspberry Pi and Orange Pi) with K3s. The deployment and service are working as expected, but I'm stuck in the final part because I don't know if the kind of Ingress configuration is enough to access my application with the custom url "cluster.example.com" or if I need to change all configuration files.
The final purpose of this cluster project is to add a simple website, accessed through "cluster.example.com" from another local machine in the same network. As I own 4 single-boards I believe that I need to create some Ingress Controller for solve this question together with an Ingress configuration, but I'm not sure.
Meanwhile, I did these steps:
K3s installation on the server and workers disabling Traefik;
Create a deployment file and apply it to the cluster;
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: front-app
name: front-app
spec:
revisionHistoryLimit: 2
replicas: 3
selector:
matchLabels:
app: front-app
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: front-app
spec:
containers:
- image: my_user/frontend_app:latest
name: front-app
ports:
- containerPort: 80
name: server
- Create a service file and apply it to the cluster;
apiVersion: v1
kind: Service
metadata:
name: front-app-service
labels:
app: front-app
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: front-app
type: NodePort
I don't know if it's correct, but I've copied an Ingress Controller configuration file from the Ingress Nginx official repository on Github.
To finish my configurations, I've created an ingress configuration file.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: front-app-ingress
annotations:
spec:
ingressClassName: nginx
rules:
- host: cluster.example.com
http:
paths:
- path: "/"
pathType: Exact
backend:
service:
name: front-app-service
port:
number: 80
As a final step, I applied all configuration files, and unfortunately, I cannot access my cluster with a custom address from another computer in the same local network.
Is there a way to fix this?