Exercise 8.2 - Not able to do a curl using NodePort
Hi,
ubuntu@ip-172-31-32-211:~$ kubectl -n accounting describe services Name: service-lab Namespace: accounting Labels: system=secondary Annotations: <none> Selector: system=secondary Type: NodePort IP: 10.104.115.79 Port: <unset> 8080/TCP TargetPort: 8080/TCP NodePort: <unset> 31742/TCP Endpoints: 192.168.89.54:8080,192.168.89.55:8080 Session Affinity: None External Traffic Policy: Cluster Events: <none> ubuntu@ip-172-31-32-211:~$ kubectl cluster-info Kubernetes master is running at https://k8smaster:6443 KubeDNS is running at https://k8smaster:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. ubuntu@ip-172-31-32-211:~$ curl https://k8smaster:31742 curl: (7) Failed to connect to k8smaster port 31742: Connection refused ubuntu@ip-172-31-32-211:~$ curl http://k8smaster:31742 curl: (7) Failed to connect to k8smaster port 31742: Connection refused
Also, I see in the description that "In a previous exercise we deployed a Load Balancerwhich deployed a ClusterIP and NodePort automatically."
IIRC, In Exercise 8.1 we do not deploy a LB Service. Please correct me if I am wrong.
Comments
-
Hi @ganeshahv,
As long as the Service's
TargetPortis set to 8080, it will not be able to forward traffic to the port 80 of thenginxcontainer.I suggest reconfiguring the service and/or the yaml manifest of the
nginx-oneDeployment - which should be performed in step 13 of exercise 8.1.Regards,
-Chris2 -
Hi @chrispokorni , thanks for your suggestion. I reconfigured the services and it works fine now.
`Name: service-lab
body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; }
Namespace: accounting
Labels: system=secondary
Annotations:
Selector: system=secondary
Type: NodePort
IP: 10.99.38.30
Port: 80/TCP
TargetPort: 80/TCP
NodePort: 32204/TCP
Endpoints: 192.168.89.62:80,192.168.89.63:80
Session Affinity: None
External Traffic Policy: Cluster
Events:
ubuntu@ip-172-31-32-211:~$ curl http://k8smaster:32204
<!DOCTYPE html>
Welcome to nginx!Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.Thank you for using nginx.
ubuntu@ip-172-31-32-211:~$`0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 750 Linux Foundation IT Professional Programs
- 373 Cloud Engineer IT Professional Program
- 169 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 4 DevOps & GitOps IT Professional Program
- 99 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 1 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 5 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 2 Open Source Best Practice Training
- 1 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 769 Linux Distributions
- 81 Debian
- 68 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 955 Programming and Development
- 310 Kernel Development
- 627 Software Development
- 984 Software
- 376 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)