Port forward service in minikube after using minikube tunnel

9/27/2019

I have started a Kubernetes cluster with minikube:

$ minikube start --kubernetes-version v1.15.3
  minikube v1.4.0 on Ubuntu 16.04
  Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
  Pulling images ...
  Launching Kubernetes ... 
  Done! kubectl is now configured to use "minikube"

$ kubectl cluster-info
kubectl cluster-info
Kubernetes master is running at https://<IP ADDRESS>:<PORT>
KubeDNS is running at https://<IP ADDRESS>:<PORT>/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

I then initialise helm:

$ helm init
$HELM_HOME has been configured at /home/SERILOCAL/<USERNAME>/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
To prevent this, run `helm init` with the --tiller-tls-verify flag.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!

$ kubectl rollout status deploy/tiller-deploy -n kube-system
deployment "tiller-deploy" successfully rolled out

and install ambassador:

$ helm install stable/ambassador --name ambassador
[...]
Congratuations! You've successfully installed Ambassador.

But now, ambassador is stuck in state <pending>:

$ kubectl get svc -n default ambassador
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
ambassador   LoadBalancer   10.96.221.84   <pending>     80:32030/TCP,443:31427/TCP   89s

This answer suggests using minikube tunnel. Alright, I start that up in a different terminal. Now, ambassador is no longer in state <pending>:

$ kubectl get svc -n default ambassador
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP    PORT(S)                      AGE
ambassador   LoadBalancer   10.96.221.84   10.96.221.84   80:32030/TCP,443:31427/TCP   5m7s

But, if I try to port it forwards, it says it is!

$ kubectl port-forward svc/ambassador 80:80
error: unable to forward port because pod is not running. Current status=Pending

How can I port forward this service?


EDIT:

$ kubectl get pods --all-namespaces
NAMESPACE     NAME                               READY   STATUS             RESTARTS   AGE
default       ambassador-54555d58f6-l8xx7        0/1     ImagePullBackOff   0          11m
default       ambassador-54555d58f6-lpd6b        0/1     ImagePullBackOff   0          11m
default       ambassador-54555d58f6-prnlv        0/1     ImagePullBackOff   0          11m
kube-system   coredns-5c98db65d4-9lkhn           1/1     Running            1          20m
kube-system   coredns-5c98db65d4-wlbfp           1/1     Running            1          20m
kube-system   etcd-minikube                      1/1     Running            0          19m
kube-system   kube-addon-manager-minikube        1/1     Running            0          19m
kube-system   kube-apiserver-minikube            1/1     Running            0          19m
kube-system   kube-controller-manager-minikube   1/1     Running            0          19m
kube-system   kube-proxy-b7mn7                   1/1     Running            0          20m
kube-system   kube-scheduler-minikube            1/1     Running            0          19m
kube-system   storage-provisioner                1/1     Running            0          20m
kube-system   tiller-deploy-d4f7577b4-sp54f      1/1     Running            0          15m

EDIT2: output of kubectl describe pod (note: I restarted everything, so the names are slightly different, but I repeated the steps above)

kubectl describe pod ambassador-5c76696fcc-bgvc6
Name:               ambassador-5c76696fcc-bgvc6
Namespace:          default
Priority:           0
PriorityClassName:  <none>
Node:               minikube/10.0.2.15
Start Time:         Fri, 27 Sep 2019 14:58:51 +0100
Labels:             app.kubernetes.io/instance=ambassador
                    app.kubernetes.io/name=ambassador
                    app.kubernetes.io/part-of=ambassador
                    pod-template-hash=5c76696fcc
Annotations:        checksum/config: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
Status:             Pending
IP:                 172.17.0.6
Controlled By:      ReplicaSet/ambassador-5c76696fcc
Containers:
  ambassador:
    Container ID:   
    Image:          quay.io/datawire/ambassador:0.81.0
    Image ID:       
    Ports:          8080/TCP, 8443/TCP, 8877/TCP
    Host Ports:     0/TCP, 0/TCP, 0/TCP
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Liveness:       http-get http://:admin/ambassador/v0/check_alive delay=30s timeout=1s period=3s #success=1 #failure=3
    Readiness:      http-get http://:admin/ambassador/v0/check_ready delay=30s timeout=1s period=3s #success=1 #failure=3
    Environment:
      HOST_IP:                (v1:status.hostIP)
      AMBASSADOR_NAMESPACE:  default (v1:metadata.namespace)
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from ambassador-token-5qpdp (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  ambassador-token-5qpdp:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  ambassador-token-5qpdp
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                 From               Message
  ----     ------     ----                ----               -------
  Normal   Scheduled  2m11s               default-scheduler  Successfully assigned default/ambassador-5c76696fcc-bgvc6 to minikube
  Normal   Pulling    47s (x4 over 2m9s)  kubelet, minikube  Pulling image "quay.io/datawire/ambassador:0.81.0"
  Warning  Failed     47s (x4 over 2m9s)  kubelet, minikube  Failed to pull image "quay.io/datawire/ambassador:0.81.0": rpc error: code = Unknown desc = Error response from daemon: Get https://quay.io/v2/: Forbidden
  Warning  Failed     47s (x4 over 2m9s)  kubelet, minikube  Error: ErrImagePull
  Normal   BackOff    24s (x6 over 2m8s)  kubelet, minikube  Back-off pulling image "quay.io/datawire/ambassador:0.81.0"
  Warning  Failed     11s (x7 over 2m8s)  kubelet, minikube  Error: ImagePullBackOff
-- EuRBamarth
docker
kubectl
kubernetes
load-balancing
minikube

0 Answers