Criei o service, conforme yml abaixo:
apiVersion: v1
kind: Service
metadata:
name: svc-pod-2
spec:
type: NodePort
ports:
- port: 80
selector:
app: segundo-pod
Porém, não consigo acessar externamente esse node:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
svc-pod-2 NodePort 10.97.65.2 <none> 80:31113/TCP 5s
Resultado:
C:\Users\User>curl http://localhost:31113/
curl: (7) Failed to connect to localhost port 31113: Connection refused
C:\Users\User>curl http://10.97.65.2:31113/
curl: (7) Failed to connect to 10.97.65.2 port 31113: Timed out