Exercise 6.6 loadBalancer external IP in pending
Hello
During exercise 6.6 I am doing something wrong with my load balancer config; While the load balancer appears working correctly (I am able to access the nginx server from outside the node by web and by curl locally using both service and pod IPs), the service is listed as having a pending external IP and I dont know if this is normal (I don't see necesarly to specify the node IP as external IP in the yaml). Any help?
Yaml:
apiVersion: v1
kind: Service
metadata:
name: lb
spec:
selector:
type: nserver
ports:
- port: 80
targetPort: 80
protocol: TCP
nodePort: 31000
type: LoadBalancer
kubectl get svc:
lb LoadBalancer 10.111.157.39 <pending> 80:31000/TCP 9m18s
kubectl describe service lb
Name: lb
Namespace: default
Labels:
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"lb","namespace":"default"},"spec":{"ports":[{"nodePort":31000,"po...
Selector: type=nserver
Type: LoadBalancer
IP: 10.111.157.39
Port: 80/TCP
TargetPort: 80/TCP
NodePort: 31000/TCP
Endpoints: 192.168.159.113:80
Session Affinity: None
External Traffic Policy: Cluster
Events:
Thanks in advance!
Stefan
Best Answer
-
Hi Stefan,
Unless your Kubernetes release is configured to talk to the underlying infrastructure, such as a manager Kubernetes service, you may not have an external service listening for API requests for an external Load Balancer.
You can read more about it here:
https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
Regards,
-Chris5
Answers
-
Hi Chris,
Five years later, I stumbled upon the same issue, which is that exercise 6.6 requests us to create a LoadBalancer Service, even though we are working with a simple two VM setup, without configurations in place to talk to underlying infrastructure to create a LoadBalancer.
Should the exercise not be updated to ask the student to create a different type of Service instead?Regards,
-Muhammed0 -
To follow up, I got it work with the LoadBalancer Service type by manually creating a Load Balancer (in my case on Huawei Cloud), then manually adding a Listener to said Load Balancer, which will forward traffic on port 80 to the two VMs to the NodePort that was created by the LoadBalancer Service.
Finally I also patched the Service so that Kubernetes would no longer say that there is no external-IP by running
kubectl patch svc nginx-6 -p '{"spec": {"type": "LoadBalancer", "externalIPs": ["xyz.xyz.xyz.xyz"]}}'However, it seems this exercise causes confusion to more people, judging by that a search for "LoadBalancer" shows several entries about exercise 6.6
Regards,
-Muhammed0 -
Hi @muhammed55053,
You are correct, this exercise, together with a few others introduced later throughout training, collectively present the three service types - ClusterIP, NodePort, LoadBalancer. The implementation of the LoadBalancer type still depends on a managed Kubernetes platform model, but can be successfully implemented manually such as you have, to capture external traffic for the cluster-external load balancing. A similar implementation can leverage self managed load balancer services (on premises or cloud) with self managed Kubernetes platforms.
Regards,
-Chris0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 754 Linux Foundation IT Professional Programs
- 374 Cloud Engineer IT Professional Program
- 170 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 5 DevOps & GitOps IT Professional Program
- 100 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 2 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
- 2 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 794 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 89 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
- 112 Mobile Computing
- 20 Android
- 77 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 393 Off Topic
- 121 Introductions
- 182 Small Talk
- 29 Study Material
- 976 Programming and Development
- 310 Kernel Development
- 648 Software Development
- 990 Software
- 382 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)