Issue with 2/Application Deployment 2/Use Kubernetes Primitives
Rasputin2 opened this issue · comments
Hello: Love the course. Question, however. I am in 2/Application Deployment and 2/Use Kubernetes Primitives. I tried the commands for Task 1 shown in the answers, and this is a description of the service (see below). But when I try curl http://localhost: I get connection refused. I tried http and https. I also tried including the whole ip address and not just the node port. Am I missing something? Am I supposed to create a shell INTO the pod or something before I run the curl?
Name: nginx-svc
Namespace: ckad
Labels: app=nginx-deploy
Annotations:
Selector: app=nginx-deploy
Type: NodePort
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.107.49.104
IPs: 10.107.49.104
Port: 9000/TCP
TargetPort: 80/TCP
NodePort: 32543/TCP
Endpoints: 10.244.0.36:80,10.244.0.37:80,10.244.0.38:80 + 1 more...
Session Affinity: None
External Traffic Policy: Cluster
Events:
Is it obvious what I am doing wrong?
Same for me ! As it is a NodePort
service type the service is not accessible from the outside (I guess).
After changing it to LoadBalancer
it worked !
kubectl expose deploy nginx-deploy --port=9000 --target-port=80 --type=LoadBalancer --name=nginx-svc
Then
curl localhost:9000
and you should see the HTML