minikube service %servicename% --url return nothing

Viewed 5446

I'm trying to expose my api so I can send request to it. However when I used the command minikube service api --url I get nothing. All my pods are running fine according to kubectl get pods so I'm abit stuck about what this could be.

api-1007925651-0rt1n       1/1       Running   0          26m
auth-1671920045-0f85w      1/1       Running   0          26m
blankit-app                1/1       Running   5          5d
logging-2525807854-2gfwz   1/1       Running   0          26m
mongo-1361605738-0fdq4     1/1       Running   0          26m


jwl:.build jakewlace$ kubectl get services

NAME         CLUSTER-IP   EXTERNAL-IP   PORT(S)     AGE
api          10.0.0.194   <none>        3001/TCP    23m
auth         10.0.0.36    <none>        3100/TCP    23m
kubernetes   10.0.0.1     <none>        443/TCP     5d
logging      10.0.0.118   <none>        3200/TCP    23m
mongo        10.0.0.132   <none>        27017/TCP   23m

jwl:.build jakewlace$
jwl:.build jakewlace$ minikube service api --url
jwl:.build jakewlace$

Any help would be massively appreciated, thank you.

I realised that the question here could be perceived as being minimal, but that is because I'm not sure what more information I could show from the tutorials I've been following it should just work. If you need more information please do let me know I will let you know.

EDIT:

api-service.yml

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: api
  name: api
spec:
  ports:
  - name: "3001"
    port: 3001
    targetPort: 3001
  selector:
    io.kompose.service: api
status:
  loadBalancer: {}

api-deployment.yml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: api
  name: api
spec:
  replicas: 1
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: api
    spec:
      containers:
      - image: blankit/web:0.0.1
        name: api
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 3001
        resources: {}
      restartPolicy: Always
status: {}
1 Answers
Related