I have Mac OS and local Docker Desktop with Kubernetes enabled. I want to have a service in local Kubernetes connected to my local java app running on port 8087.
Here is what I have so far:
- Service
apiVersion: v1
kind: Service
metadata:
name: auth
spec:
selector:
app: app-auth
ports:
- protocol: TCP
port: 80
targetPort: 8087
---
kind: Endpoints
apiVersion: v1
metadata:
name: auth
subsets:
- addresses:
- ip: <127.0.0.1 outside of cluster>
ports:
- port: 8087
- Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: router
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: localhost
http:
paths:
- path: /api/user
pathType: Prefix
backend:
service:
name: auth
port:
number: 80
I already checked this, but without success since I am not using either minikube either virtual box access-mysql-running-on-localhost-from-minikube how-to-access-hosts-localhost-from-inside-kubernetes-cluster
The Question: what IP should I use for my to-os-localhost-service? Thank you