Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend.minikube.local does not start #13

Closed
MarkKharitonov opened this issue Sep 4, 2020 · 12 comments
Closed

frontend.minikube.local does not start #13

MarkKharitonov opened this issue Sep 4, 2020 · 12 comments

Comments

@MarkKharitonov
Copy link

Hi,
I had to delete my linux VM in the middle and recreate it with higher specs and so I might have forgotten some important step, but it does not seem so.
Please, observe:

mark@minikube-vm:~/pluralsight-phcollignon-helm3/lab5_helm_chart_version1_begin/guestbook$ helm get manifest demo-guestbook
---
# Source: guestbook/templates/frontend-service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    name: frontend
  name: frontend
spec:
  ports:
    - protocol: "TCP"
      port: 80
      targetPort: 4200
  selector:
    app: frontend
---
# Source: guestbook/templates/frontend.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend 
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
      - image: phico/frontend:1.0
        imagePullPolicy: Always
        name: frontend
        ports:
        - name: frontend
          containerPort: 4200
---
# Source: guestbook/templates/ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: guestbook-ingress
spec:
  rules:
  - host: frontend.minikube.local
    http:
      paths:
      - path: /
        backend:
          serviceName: frontend
          servicePort: 80
  - host: backend.minikube.local
    http:
      paths:
      - path: /
        backend:
          serviceName: backend
          servicePort: 80

mark@minikube-vm:~/pluralsight-phcollignon-helm3/lab5_helm_chart_version1_begin/guestbook$ ping frontend.minikube.local
PING frontend.minikube.local (192.168.99.100) 56(84) bytes of data.
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=1 ttl=64 time=0.378 ms
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=2 ttl=64 time=0.482 ms
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=3 ttl=64 time=0.318 ms
^C
--- frontend.minikube.local ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2029ms
rtt min/avg/max/mdev = 0.318/0.392/0.482/0.071 ms
mark@minikube-vm:~/pluralsight-phcollignon-helm3/lab5_helm_chart_version1_begin/guestbook$ minikube ip
192.168.99.100
mark@minikube-vm:~/pluralsight-phcollignon-helm3/lab5_helm_chart_version1_begin/guestbook$ kubectl get pod -l app=frontend
NAME                        READY   STATUS    RESTARTS   AGE
frontend-56577ccc6d-q7pc4   1/1     Running   0          23m
mark@minikube-vm:~/pluralsight-phcollignon-helm3/lab5_helm_chart_version1_begin/guestbook$ 

Yet when I navigate to frontend.minikube.local I get an error:

mark@minikube-vm:~/pluralsight-phcollignon-helm3/lab5_helm_chart_version1_begin/guestbook$ wget http://frontend.minikube.local
--2020-09-04 19:37:07--  http://frontend.minikube.local/
Resolving frontend.minikube.local (frontend.minikube.local)... 192.168.99.100
Connecting to frontend.minikube.local (frontend.minikube.local)|192.168.99.100|:80... failed: Connection refused.

What am I missing?

Thank you.

@phcollignon
Copy link
Owner

phcollignon commented Sep 8, 2020

Hello, the ip address of your minikube node might have changed .. Please could you check what returns "minikube ip" command ?

@MarkKharitonov
Copy link
Author

It is as expected:

mark@minikube-vm:~/helm/lab7_helm_template_final/chart$ minikube ip
192.168.99.100
mark@minikube-vm:~/helm/lab7_helm_template_final/chart$ helm list
NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
demo-guestbook  default         1               2020-09-07 15:30:43.612544026 +0000 UTC deployed        guestbook-1.2.0 2.0
mark@minikube-vm:~/helm/lab7_helm_template_final/chart$ ping frontend.minikube.local
PING frontend.minikube.local (192.168.99.100) 56(84) bytes of data.
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=1 ttl=64 time=1.17 ms
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=2 ttl=64 time=0.308 ms
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=3 ttl=64 time=0.539 ms
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=4 ttl=64 time=0.381 ms
64 bytes from frontend.minikube.local (192.168.99.100): icmp_seq=5 ttl=64 time=0.339 ms
^C
--- frontend.minikube.local ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4074ms
rtt min/avg/max/mdev = 0.308/0.548/1.177/0.325 ms
mark@minikube-vm:~/helm/lab7_helm_template_final/chart$ wget http://frontend.minikube.local
--2020-09-08 14:59:39--  http://frontend.minikube.local/
Resolving frontend.minikube.local (frontend.minikube.local)... 192.168.99.100
Connecting to frontend.minikube.local (frontend.minikube.local)|192.168.99.100|:80... failed: Connection refused.
mark@minikube-vm:~/helm/lab7_helm_template_final/chart$

The minikube dashboard shows the application is running. The backend fails, but it is expected (I am on lab 7).

So, all works as you describe in the course, except I am unable to navigate the application itself. I suppose it has to do with some absent configuration on my fresh new linux VM.

@MarkKharitonov
Copy link
Author

MarkKharitonov commented Sep 8, 2020

A quick update. I installed wordpress as instructed in the last chapter and it worked.
I think the instructions to run the guestbook are lacking something.

@phcollignon
Copy link
Owner

Hello, could you check the ingress is enabled with minikube addons enable ingress command ?
Are their any logs for the frontend pod with kubectl logs --previous ?
Make sure there is no old K8s ressources before installing again with Helm.
You could also try to set the frontend service to NodePort type and try to access it with the NodePort to see if it can be accessed.

@MarkKharitonov
Copy link
Author

That is what was missing - minikube addons enable ingress.
Apparently, after recreating the VM I have not run this command.
Interesting though why it was not needed for the wordpress application?

@phcollignon
Copy link
Owner

OK I close the issue. Wordpress is not using the ingress but we access it using a Nodeport (as mentioned in the demo at 1'56")

@arthursoas
Copy link

Is there any configuration to enable the host minikube.local?
I cannot reach that host. Ingress is enables on minikube

image

@phcollignon
Copy link
Owner

phcollignon commented May 12, 2021

Hello, you should resolve the frontend and backend dns names to the minikube ip in the hosts file (as showed in the course at the end of the environnement setup)

@maxmantz
Copy link

I'm having a similar issue. This is my manifest

# Source: guestbook/templates/frontend-service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    name: frontend
  name: frontend
spec:
  ports:
    - protocol: "TCP"
      port: 80
      targetPort: 4200
  selector:
    app: frontend
---
# Source: guestbook/templates/frontend.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
      - image: phico/frontend:1.0
        imagePullPolicy: Always
        name: frontend
        ports:
        - name: frontend
          containerPort: 4200
---
# Source: guestbook/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: guestbook-ingress
spec:
  rules:
    - host: frontend.minikube.local
      http:
        paths:
          - pathType: Prefix
            path: "/"
            backend:
              service:
                name: frontend
                port:
                  number: 80
    - host: backend.minikube.local
      http:
        paths:
          - pathType: Prefix
            path: "/"
            backend:
              service:
                name: backend
                port:
                  number: 80

I've added my minikube IP to the host file, but when I ping the address it times out:

Pinging frontend.minikube.local [192.168.49.2] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.49.2:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

I've tried restarting minikube and kubernetes, as well as reinstalling the chart but to no effect. Please adivse!

@maxmantz
Copy link

I've solved the issue by running minikube tunnel and changing my hosts file entries to 127.0.0.1 instead of the minikube IP.

@peeyushmittal
Copy link

This solution of replacing miikube ip with 127.0.0.1 in hosts works.. Thanks..

@abondar24
Copy link

Should I change something for microk8s?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants