@@ -46,8 +46,46 @@ CA key on disk.
46
46
Instead, run the controller-manager standalone with ` --controllers=csrsigner ` and
47
47
point to the CA certificate and key.
48
48
49
- [ PKI certificates and requirements] ( /docs/setup/best-practices/certificates/ ) includes guidance on
50
- setting up a cluster to use an external CA.
49
+ There are various ways to prepare the component credentials when using external CA mode.
50
+
51
+ ### Manual preparation of component credentials
52
+
53
+ [ PKI certificates and requirements] ( /docs/setup/best-practices/certificates/ ) includes information
54
+ on how to prepare all the required by kubeadm component credentials manually.
55
+
56
+ ### Preparation of credentials by signing CSRs generated by kubeadm
57
+
58
+ kubeadm can [ generate CSR files] ( #signing-csr ) that you can sign manually with tools like
59
+ ` openssl ` and your external CA. These CSR files will include all the specification for credentials
60
+ that components deployed by kubeadm require.
61
+
62
+ ### Automated preparation of component credentials by using kubeadm phases
63
+
64
+ Alternatively, it is possible to use kubeadm phase commands to automate this process.
65
+
66
+ - Go to a host that you want to prepare as a kubeadm control plane node with external CA.
67
+ - Copy the external CA files ` ca.crt ` and ` ca.key ` that you have into ` /etc/kubernetes/pki ` on the node.
68
+ - Prepare a temporary [ kubeadm configuration file] ( /docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file )
69
+ called ` config.yaml ` that can be used with ` kubeadm init ` . Make sure that this file includes
70
+ any relevant cluster wide or host-specific information that could be included in certificates, such as,
71
+ ` ClusterConfiguration.controlPlaneEndpoint ` , ` ClusterConfiguration.certSANs ` and ` InitConfiguration.APIEndpoint ` .
72
+ - On the same host execute the commands ` kubeadm init phase kubeconfig all --config config.yaml ` and
73
+ ` kubeadm init phase certs all --config config.yaml ` . This will generate all required kubeconfig
74
+ files and certificates under ` /etc/kubernetes/ ` and its ` pki ` sub directory.
75
+ - Inspect the generated files. Delete ` /etc/kubernetes/pki/ca.key ` , delete or move to a safe location
76
+ the file ` /etc/kubernetes/super-admin.conf ` .
77
+ - On nodes where ` kubeadm join ` will be called also delete ` /etc/kubernetes/kubelet.conf ` .
78
+ This file is only required on the first node where ` kubeadm init ` will be called.
79
+ - Note that some files such ` pki/sa.* ` , ` pki/front-proxy-ca.* ` and ` pki/etc/ca.* ` are
80
+ shared between control plane nodes, You can generate them once and
81
+ [ distribute them manually] ( /docs/setup/production-environment/tools/kubeadm/high-availability/#manual-certs )
82
+ to nodes where ` kubeadm join ` will be called, or you can use the
83
+ [ ` --upload-certs ` ] ( /docs/setup/production-environment/tools/kubeadm/high-availability/#stacked-control-plane-and-etcd-nodes )
84
+ functionality of ` kubeadm init ` and ` --certificate-key ` of ` kubeadm join ` to automate this distribution.
85
+
86
+ Once the credentials are prepared on all nodes, call ` kubeadm init ` and ` kubeadm join ` for these nodes to
87
+ join the cluster. kubeadm will use the existing kubeconfig and certificate files under ` /etc/kubernetes/ `
88
+ and its ` pki ` sub directory.
51
89
52
90
## Check certificate expiration
53
91
0 commit comments