I'm pretty new to Kubernetes and was exploring Services to try and access my application running inside a MiniKube. This just a default HTTP server that responds with Hello World.
Now I know about the Minikube command to get a bridge to my application but I was trying to replicate this myself by using Services and Endpoints to no avail.
Below are my configuration files that I used and some info about the networks, this is just for a local test environment and I don't have access to any cloud providers. I would just like to be able to go to 192.168.99.1 and connect
vboxnet0: 192.168.99.x/24
hello-node-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-node
labels:
app: hello-node
spec:
selector:
matchLabels:
app: hello-node
template:
metadata:
labels:
app: hello-node
spec:
containers:
- name: hello-node
image: gcr.io/hello-minikube-zero-install/hello-node
ports:
- containerPort: 8080
hello-node-serviceport.yaml
kind: Service
apiVersion: v1
metadata:
name: http-service-nodeport
spec:
type: NodePort
selector:
app: hello-node
ports:
- nodePort: 30163
port: 8080
targetPort: 80
externalIPs: ["192.168.99.180"]
hello-node-endpoint.yaml
kind: Endpoints
apiVersion: v1
metadata:
name: http-service-nodeport
subsets:
- addresses:
- ip: 192.168.99.180
ports:
- port: 80