Lab 3.4 - Clarification on services, endpoints, and Calico
Hey everyone, I'm looking for a bit of help understanding the following text from Lab 3.4.
Verify the service configuration. First look at the service, then the endpoint information. Note the ClusterIP is not the current endpoint. Calico provides the ClusterIP. The Endpoint is provided by kubelet and kube-proxy. Take note of the current endpoint IP. In the example below it is 192.168.1.5:80. We will use this information in a few steps.
Recall from previous labs that we install Calico and don't modify the default IP range, which seems to be:
# - name: CALICO_IPV4POOL_CIDR
# value: "192.168.0.0/16"
Inspecting a pod seems to confirm that the correct IP range is being used for the pod subnet:
$ kubectl get pod -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES nginx-7f456874f4-cx7wb 1/1 Running 0 16m 192.168.171.69 worker <none> <none>
Now, consider the service and endpoint resources:
$ kubectl get svc nginx NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE nginx ClusterIP 10.111.161.113 <none> 80/TCP 113s $ kubectl get ep nginx NAME ENDPOINTS AGE nginx 192.168.171.69:80 119s
Notice that the ClusterIP does not seem to come from the Calico IP range however the endpoint IP range does. Also, I'm not seeing any reference to a 10. range in the Calico configuration.
What am I missing about how this works? Did I do something incorrectly? My results seem to contradict the lab text. Thanks in advance for reading and any insight you can provide.
Best Answer
-
Hi @josedelarosa,
The Pod's IP address comes from the Calico network plugin, from the default 192.168.0.0/16 range.
The Service's ClusterIP is managed by the Kubernetes control plane from the default 10.96.0.0/12 network. Once a Service exposes a Pod, the Pod's IP address becomes part of the Service Endpoint, the reason why the Pod's IP and the Endpoint IP are the same.Regards,
-Chris1
Answers
-
Really helpful answer @chrispokorni, thank you! I was missing the part about the service IP coming from the
10.96.0.0/12range.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
- 4 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
- 983 Software
- 375 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)