For our application, we will need to have installed:
(In case you encounter a "permission denied" error while starting Docker, you can use this solution)
Instructions to run the app:
- Port 80 must be exposed on our machine (and 443 for https traffic).
- Clone the repository by running the command "git clone https://github.com/siamsot/nginx-rproxy-k8s"
- Start Minikube with "minikube start --extra-config=apiserver.service-node-port-range=1-65535" This is done because we've set the nodePort to 80 which isn't in the default range
- Navigate to the directory where our configuration yaml file is with "cd nginx-rproxy-k8s"
- Edit the config.yaml file and change the {ip or domain} field to your machine's IP address
- Deploy our application with "kubectl apply -f config.yaml"
- Run the command "sudo kubectl --address 0.0.0.0 port-forward svc/hello-service 80:80" It's needed to run the command with sudo privileges in order to expose the service to port 80
This solution was chosen over a solution with docker compose as it is closer to a production environment