0

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

1 Answers1

0

I guess that the issue might be related rather with your VirtualBox network settings than anything related to Kubernetes or Minikube.

What are your VBox networking settings ? Do you use bridged adapter or host only adapter ? Or maybe you're using NAT ? And what's the address 192.168.99.1 ? So you're trying to connect to 192.168.99.1, not to 192.168.99.180 ?

I assume you're trying to access your cluster from host system, right ? If so, you need to consider using bridged adapter or host only adapter as only those two networking modes enable access from host to guest. Please refer to this article.

mario
  • 525
  • 3
  • 8