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

Adding Kubelet Serving Certificate using serverTLSBootstrap: true #1635

Closed
munai-das opened this issue Jun 24, 2019 · 7 comments
Closed

Adding Kubelet Serving Certificate using serverTLSBootstrap: true #1635

munai-das opened this issue Jun 24, 2019 · 7 comments
Labels
area/security kind/support Categorizes issue or PR as a support question.

Comments

@munai-das
Copy link

munai-das commented Jun 24, 2019

What keywords did you search in kubeadm issues before filing this one?

Versions

kubeadm version (use kubeadm version): v1beta1

Environment:

  • Kubernetes version (use kubectl version): kubernetes 1.14.1
  • Cloud provider or hardware configuration: AWS
  • OS (e.g. from /etc/os-release): CentOS Linux 7 (Core)
  • Kernel (e.g. uname -a): 3.10.0-957.21.3.el7.x86_64
  • Others:
    Container-Runtime: docker://18.6.2

What happened?

Added the below to make Kubelet Serving Certificate work.

As a part of KubeletConfiguration in master0(3 master setup)

rotateCertificates: true
featureGates:
  RotateKubeletClientCertificate: true
  RotateKubeletServerCertificate: true
serverTLSBootstrap: true

& kubelet-certificate-authority: "/etc/kubernetes/pki/ca.crt" to kube-apiserver

Additionally, I added below to nodeRegistration of worker JoinConfiguration

rotate-certificates: "true"
    rotate-server-certificates: "true"
    feature-gates: "RotateKubeletClientCertificate=true,RotateKubeletServerCertificate=true"

Moreover, I also made sure that I added -node-ip to all my kubelets.
(Refering https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/#non-public-ip-used-for-containers)
I forked and modified CoreOS’ kapprovers to auto-approve CSR requests by kubelets.

What you expected to happen?

Kubelet Serving Certificates to be issued by CSR API.

kubectl logs stopped working with the error
Error from server: Get https://XXXX:10250/containerLogs/: dial tcp XXXX:10250: connect: no route to host

How to reproduce it (as minimally and precisely as possible)?

Add the flags as described in What Happened above.

Anything else we need to know?

No.

@neolit123
Copy link
Member

neolit123 commented Jun 24, 2019

/triage support
/area security

hi, this doesn't look like a kubeadm problem, per se.
kubeadm already provides you with all the settings to use the RotateKubeletServerCertificate feature.

have you looked at the kubelet logs for any errors?

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. area/security labels Jun 24, 2019
@neolit123
Copy link
Member

neolit123 commented Jun 24, 2019

i think the CSR is not being issued because the certificate is still being self-signed:
https://godoc.org/k8s.io/kubelet/config/v1beta1#KubeletConfiguration

// tlsCertFile is the file containing x509 Certificate for HTTPS. (CA cert,
    // if any, concatenated after server cert). If tlsCertFile and
    // tlsPrivateKeyFile are not provided, a self-signed certificate
    // and key are generated for the public address and saved to the directory
    // passed to the Kubelet's --cert-dir flag.
    // Dynamic Kubelet Config (beta): If dynamically updating this field, consider that
    // it may disrupt components that interact with the Kubelet server.

try passing those settings too.
i haven't played with serverTLSBootstrap.

@munai-das
Copy link
Author

Thanks for the comment. I will check this.

@munai-das
Copy link
Author

The issue was --node-ip not getting added to two of the masters. As it is not possible to add via KubeletConfiguration, I added it using sed. Closing the issue.

@funkypenguin
Copy link

@munai-das I'm trying to do the same thing - can you share your changes to kapprovers?

@munai-das
Copy link
Author

I have internally refactored the kapprovers piece. I will ask the concerned person in the office and open source it.

@funkypenguin
Copy link

funkypenguin commented Jul 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

4 participants