I have a question regarding this question in the CKA Networking - Exploring Envi . . .

Talal Humaidi:
I have a question regarding this question in the CKA Networking - Exploring Environment practice test :
The question is “What is the port the kube-scheduler is listening on in the master node?”
when i run

controlplane $ netstat -natpul | grep -i sch

i get this output

tcp        0      0 127.0.0.1:10259         0.0.0.0:*               LISTEN      2519/kube-scheduler 
tcp        0      0 172.17.0.34:54836       172.17.0.34:6443        ESTABLISHED 2519/kube-scheduler 
tcp        0      0 172.17.0.34:55036       172.17.0.34:6443        ESTABLISHED 2519/kube-scheduler 
tcp6       0      0 :::10251                :::*                    LISTEN      2519/kube-scheduler 

why is the correct answer is 10251 now i can see that there is 2 listens here! more specific is the 127.0.0.1:10259 because we route the traffic from 10251 in the master node to 10259 or is there any other reason ?
thanks in advance

Mohamed Ayman:

Fernando Jordan Silva:
Kube-scheduler uses 2 ports: 10251 for insecure communications (deprecated) & 10259 for secure comms

Fernando Jordan Silva:
by default, all the communications are not securized, so the “main port” is 10251

Talal Humaidi:
thanks

Talal Humaidi:
@Mohamed Ayman nothing changed in the result there is two ports in your result

I think there is a disjoint somewhere.

Both screenshots clearly show that:

ipv4: uses port 10259
ipv6: uses port 10251

The answer given by @fjordansilva seems to suggest that you cannot have secure communications if ipv6 is disabled!

@ak.cka – I don’t know anything about any relationship between IPv6 and whether the scheduler is secure or not; that’s a new one for me. The docs say that 10259 is the default secure port for the scheduler. Not sure who is using 10251 or why; I have the lab up right now and nothing appears to be listening on that port.

Hi @rob_kodekloud.

Your environment and mine concurr in that since I do not have have ipv6 enabled, there’s only one kube-scheduler process listening on ip 127.0.0.1 (ipv4) on port 10259.

But looking at the screenshots posted by the OP and the first reply, they both appear to be running ipv6 in addition to ipv4. In that situation, I’d say both answers would be correct.

I did a bit of looking around, and it appears that the use of port 10251 was deprecated some time ago. I’m not sure why the lab does not set up IPv6, but it does not, so I’d guess that 10259 would have to be the answer.