Olá,
mesmo configurando o POD adequadamente e vinculando o mesmo a um Service NodPort, não consigo acessá-lo pelo host hospedeiro.
A conexão é recusada. Meu firewall está aberto e não vejo listen abrir na porta 30000 (porta indicada para o serviço ser acessado externamente no Linux).
Segue saída:
[kubs@ol8-kubs-teste mini-proj]$ kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME minikube Ready master 8d v1.18.3 *172.17.0.2 * Ubuntu 19.10 5.4.17-2136.316.7.el8uek.x86_64 docker://19.3.2
[kubs@ol8-kubs-teste mini-proj]$ curl -i -k http://172.17.0.2 curl: (7) Failed to connect to 172.17.0.2 port 80: Conexão recusada
[kubs@ol8-kubs-teste mini-proj]$ curl -i -k http://172.17.0.2:30000 curl: (7) Failed to connect to 172.17.0.2 port 30000: Conexão recusada
** Descrição do POD vinculado ao SVC NodePort: ** [kubs@ol8-kubs-teste mini-proj]$ kubectl describe pod pod-1 Name: pod-1 Namespace: default Priority: 0 Service Account: default Node: minikube/172.17.0.2 Start Time: Tue, 04 Apr 2023 10:35:41 -0300 Labels: app=primeiro-pod Annotations: Status: Running IP: 172.18.0.3 IPs: IP: 172.18.0.3 Containers: container-pod-1: Container ID: docker://2dbb613e7504e9654bb1aa7cd1bd89b43390fa332b04d446f7021d960336b087 Image: nginx:latest Image ID: docker-pullable://nginx@sha256:2ab30d6ac53580a6db8b657abf0f68d75360ff5cc1670a85acb5bd85ba1b19c0 Port: 80/TCP Host Port: 0/TCP State: Running Started: Tue, 04 Apr 2023 10:35:44 -0300 Ready: True Restart Count: 0 Environment: Mounts: /var/run/secrets/kubernetes.io/serviceaccount from default-token-sjcdv (ro) Conditions: Type Status Initialized True Ready True ContainersReady True PodScheduled True Volumes: default-token-sjcdv: Type: Secret (a volume populated by a Secret) SecretName: default-token-sjcdv 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:
** Descrição SVC NodePort: ** [kubs@ol8-kubs-teste mini-proj]$ kubectl describe svc svc-pod-1 Name: svc-pod-1 Namespace: default Labels: Annotations: Selector: app=primeiro-pod Type: NodePort IP Families: IP: 10.108.52.210 IPs: Port: 80/TCP TargetPort: 80/TCP NodePort: 30000/TCP Endpoints: 172.18.0.3:80 Session Affinity: None External Traffic Policy: Cluster Events: