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
- 178 LFX Mentorship
- 178 LFX Mentorship: Linux Kernel
- 773 Linux Foundation IT Professional Programs
- 383 Cloud Engineer IT Professional Program
- 175 Advanced Cloud Engineer IT Professional Program
- 75 DevOps IT Professional Program - Discontinued
- 7 DevOps & GitOps IT Professional Program
- 102 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 9 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 29 Cloud & Containers Training
- 3 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 2 Networking Training
- 2 Open Source Best Practice Training
- 5 System Administration Training
- 1 System Engineering Training
- 4 Web & Application Development Training
- 798 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 92 Storage
- 771 Linux Distributions
- 81 Debian
- 68 Fedora
- 23 Linux Mint
- 13 Mageia
- 24 openSUSE
- 151 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 469 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 101 Linux Security
- 79 Network Management
- 101 System Management
- 46 Web Management
- 151 Mobile Computing
- 20 Android
- 116 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 404 Off Topic
- 126 Introductions
- 34 Study Material
- 1K Programming and Development
- 310 Kernel Development
- 717 Software Development
- 1K Software
- 416 Applications
- 182 Command Line
- 5 Compiling/Installing
- 71 Games
- 320 Installation
- Archived
- 183 Small Talk
- 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)