Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kube-Scheduler 和 Kube-Controller-Manager 证书是否需要hosts字段 ?? #638

Open
NoMoneyToRaisePigs opened this issue Jan 9, 2022 · 4 comments

Comments

@NoMoneyToRaisePigs
Copy link

文档版本
K8S v1.16

现象描述
只是好奇问一下,网上找不到我想要的答案,scheduler和controller manager的cfssl生成的证书csr请求里有hosts字段,如果scheduler和controller只是作为client访问api-server而不对外提供任何服务,是否还需要提供hosts字段??

还是我理解有误?其实scheduler和controller也需要对方提供https访问需求?据我所知他们只访问api-server而不对外提供服务.

@dyrnq
Copy link

dyrnq commented Jan 16, 2022

You can refer to kube-scheduler POD && kube-controller POD installed and configed by kubeadm
they have host localhost and 127.0.0.1 at least

check on my k8s cluster installed by kubeadm

echo | openssl s_client -showcerts -connect 127.0.0.1:10259 2>/dev/null | openssl x509 -noout -text | grep -A5 'X509v3 Subject'
            X509v3 Subject Alternative Name:
                DNS:localhost, IP Address:127.0.0.1, IP Address:127.0.0.1
echo | openssl s_client -showcerts -connect 127.0.0.1:10257 2>/dev/null | openssl x509 -noout -text | grep -A5 'X509v3 Subject'
            X509v3 Subject Alternative Name:
                DNS:localhost, IP Address:127.0.0.1, IP Address:127.0.0.1

@dyrnq
Copy link

dyrnq commented Jan 16, 2022

supplement

there have two kind of cert :
one is client of kube-apiserver (configed in /etc/kubernetes/controller-manager.conf client-certificate-data:)
antoher is self server tls by options --tls-cert-file and --tls-private-key-file

sometimes they can be combined and used :)

@NoMoneyToRaisePigs
Copy link
Author

@dyrnq
Thanks for your reply, so those basically means the kube-controller-manager and kube-scheduler do not serve others except for themselves, as you said "self server tls", and the SAN of localhost and 127.0.0.1 are for the purpose of self serving, aren't they ?

@dyrnq
Copy link

dyrnq commented Jan 21, 2022

YES,self server tls SAN of localhost and 127.0.0.1 for https health check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants