1

Error starting tunneling of service.

OS: mac os
minikube version: v1.25.2
kubectl version: 1.24.1.

and using docker desktop

The following script is the configuration of the /zipkin directory.

# service.yaml
apiVersion: v1
kind: Service
metadata:
  name: zipkin
spec:
  selector:
    app: zipkin
  ports:
    - port: 9411
      targetPort: 9411
      protocol: TCP
  type: LoadBalancer
# statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: zipkin
  labels:
    app: zipkin
spec:
  serviceName: zipkin
  replicas: 1
  template:
    metadata:
      name: zipkin
      labels:
        app: zipkin
    spec:
      containers:
        - name: zipkin
          image: openzipkin/zipkin
          imagePullPolicy: Always
          ports:
            - containerPort: 9411
              protocol: TCP
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: 200m
              memory: 256Mi
      restartPolicy: Always
  selector:
    matchLabels:
      app: zipkin

kubectl apply -f zipkin

kubectl get po
NAME         READY   STATUS    RESTARTS   AGE
zipkin-0   1/1     Running   0          49m
minikube service zipkin --url

  starting tunnel for service zipkin
❗  Because you are using a Docker driver on darwin, the terminal needs to be open to run it.

it is not wokring. I can't figure out what the problem is.

expected like this: enter image description here

2 Answers2

2

I too had the same issue but then figured out from minikube documentation: https://minikube.sigs.k8s.io/docs/handbook/accessing/#example-of-nodeport

In one terminal do this:

minikube service customer-node --url                                                     

  Starting tunnel for service customer-node.
❗  Because you are using a Docker driver on darwin, the terminal needs to be open to run it.

Open another terminal and check SSH Tunnel

ps -ef | grep docker@127.0.0.1                                                 
  501 81040 81027   0  6:35PM ttys001    0:00.02 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -N docker@127.0.0.1 -p 56541 -i /Users/johndoe/.minikube/machines/minikube/id_rsa -L 64013:10.104.68.137:80

Check for the port at the end of the output or you can use this command to find the tunnel port

ps -ef | grep docker@127.0.0.1 | head -1 | awk '{print $NF}' | awk -F ":" '{print $1}'
  64013

You can use then use this port to form this URL for your browser

http://127.0.0.1:64013
Mervyn
  • 121
  • 1
  • 5
1

From the question, I don't see a service with the name rabbitmq. Your service name is zipkin. Try running You can also specify external IP

kind: Service
apiVersion: v1
metadata:
  name: zipkin
spec:
  selector:
    app: zipkin
  ports:
  - protocol: "TCP"
    port: 8081
    targetPort: 80
  type: LoadBalancer
  externalIPs:
  - 192.168.64.2

Then you can use http://192.168.64.2:8081/ to access

Naveen Kulkarni
  • 633
  • 6
  • 16
  • It's a typo. The contents have been corrected, and it does not run normally. –  Jun 10 '22 at 06:31
  • Modified my answer, can you try ? – Naveen Kulkarni Jun 10 '22 at 06:34
  • Sorry, your answer is not the intent of my question. The problem I have is that tunneling the service fails. `127.0.0.1:~` should come out like this. I have attached a photo to the text. –  Jun 10 '22 at 06:37
  • I am sure what you are expecting ( i.e, reach service on localhost ) can be achieved. Even the official documentation of minikube for service type LB mentions to use external IP ( https://minikube.sigs.k8s.io/docs/handbook/accessing/ ) – Naveen Kulkarni Jun 10 '22 at 06:40
  • i mean i want `Run service tunnel` and it is exposed by `127.0.0.1:~~` –  Jun 10 '22 at 12:40