I want to know what are production alternatives to make http://192.168.49.2:30001 this accessible http://host_machine_ip:8007 here
I have set up minikube cluster with mobile-api service on it.
minikube service mobile-api-service --url this returns http://192.168.49.2:30001
curl http://192.168.49.2:30001 returns
{"mobileApi/dashboard":"http://192.168.49.2:30001/mobileApi/dashboard/",
"mobileApi/notification":"http://192.168.49.2:30001/mobileApi/notification/",
"mobileApi/feedback":"http://192.168.49.2:30001/mobileApi/feedback/"}
so my API is accessible on http://192.168.49.2:30001 from the host machine.
but i want to make it accessible http://host_machine_ip:8007.
when I do
kubectl port-forward --address 0.0.0.0 service/mobile-api-service 8007:8007
it makes http://host_machine_ip:8007 work as I want but I am sure this is not a production-like case.
Update
apiVersion: v1
kind: Service
metadata:
name: mobile-api-service
spec:
selector:
app: mobile-api
type: LoadBalancer
ports:
- protocol: TCP
port: 8007
targetPort: 8007
nodePort: 30001
this is service it is loadBalancer