Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

O navegador não consegue acessar o IP do node

This site can’t be reached 192.168.99.106 refused to connect.

código yaml do service:

apiVersion: v1 
kind: Service
metadata: 
    name: svc-pod-1
spec:
    type: NodePort
    ports:
       - port: 80 
         nodePort: 30000
    selector: 
            app: primeiro-pod

código yaml do pod:

apiVersion: v1
kind: Pod
metadata:
    name: pod-1
    labels: 
        app: primeiro-pod
spec:
    containers:
        - name: container-pod-1
          image: nginx:latest
          ports:
            - containerPort: 80

Consultei o kubeyaml e ele não encontra erro algum.

Estou utilizando o Ubuntu 20.04, e editando pelo visual code

4 respostas

Oi Gustavo, tudo bem? No seu navegador você está acessando via 192.168.99.106?

Tente acessar por 192.168.99.106:30000 e veja se dá certo :)

Sim utilizei a porta 30000, e ele devolve essa msg

Qual a saída do comando kubectl describe pod pod-1?

solução!

Executei o minikube hj de manhã, e logo depois inseri o comando kubectl describe pod pod-1. Não sei pq, mas ao tentar acessar o IP 192.168.99.106 na porta 30000 agora de manhã, funcionou. De qualquer forma agradeço pela atenção :)

Segue a saída do comando:

Name: pod-1 Namespace: default Priority: 0 Node: minikube/192.168.99.106 Start Time: Mon, 21 Sep 2020 15:17:59 -0300 Labels: Annotations: Status: Running IP: 172.17.0.3 IPs: IP: 172.17.0.3 Containers: container-pod-1: Container ID: docker://d206f0475711aa6ee36ce9d1f5b2dbd78e68a4022a270566cd2f3cb7714d68b9 Image: nginx:latest Image ID: docker-pullable://nginx@sha256:c628b67d21744fce822d22fdcc0389f6bd763daac23a6b77147d0712ea7102d0 Port: 80/TCP Host Port: 0/TCP State: Running Started: Thu, 24 Sep 2020 08:30:14 -0300 Last State: Terminated Reason: Error Exit Code: 255 Started: Wed, 23 Sep 2020 13:01:17 -0300 Finished: Thu, 24 Sep 2020 08:28:01 -0300 Ready: True Restart Count: 2 Environment: Mounts: /var/run/secrets/kubernetes.io/serviceaccount from default-token-jpzmw (ro) Conditions: Type Status Initialized True Ready True ContainersReady True PodScheduled True Volumes: default-token-jpzmw: Type: Secret (a volume populated by a Secret) SecretName: default-token-jpzmw Optional: false QoS Class: BestEffort Node-Selectors: Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s node.kubernetes.io/unreachable:NoExecute op=Exists for 300s Events: Type Reason Age From Message


Normal SandboxChanged 47s kubelet, minikube Pod sandbox changed, it will be killed and re-created. Normal Pulling 34s kubelet, minikube Pulling image "nginx:latest" Normal Pulled 30s kubelet, minikube Successfully pulled image "nginx:latest" in 3.952773737s Normal Created 30s kubelet, minikube Created container container-pod-1 Normal Started 28s kubelet, minikube Started container container-pod-1