CheckCertificatePeriodValidity takes a certificate and prints a warning if its period is not valid related to the current time. It does so only if the certificate was not validated already by keeping track with a cache.
CreateCACertAndKeyFiles generates and writes out a given certificate authority. The certSpec should be one of the variables from this package.
CreateCSR creates a certificate signing request
func CreateCertAndKeyFilesWithCA(certSpec *KubeadmCert, caCertSpec *KubeadmCert, cfg *kubeadmapi.InitConfiguration) error
CreateCertAndKeyFilesWithCA loads the given certificate authority from disk, then generates and writes out the given certificate and key. The certSpec and caCertSpec should both be one of the variables from this package.
CreateDefaultKeysAndCSRFiles is used in ExternalCA mode to create key files and adjacent CSR files.
CreatePKIAssets will create and write to disk all PKI assets necessary to establish the control plane. If the PKI assets already exists in the target folder, they are used only if evaluated equal; otherwise an error is returned.
func CreateServiceAccountKeyAndPublicKeyFiles(certsDir string, keyType x509.PublicKeyAlgorithm) error
CreateServiceAccountKeyAndPublicKeyFiles creates new public/private key files for signing service account users. If the sa public/private key files already exist in the target folder, they are used only if evaluated equals; otherwise an error is returned.
LoadCertificateAuthority tries to load a CA in the given directory with the given name.
func NewCSR(certSpec *KubeadmCert, cfg *kubeadmapi.InitConfiguration) (*x509.CertificateRequest, crypto.Signer, error)
NewCSR will generate a new CSR and accompanying key
SharedCertificateExists verifies if the shared certificates - the certificates that must be equal across control-plane nodes: ca.key, ca.crt, sa.key, sa.pub + etcd/ca.key, etcd/ca.crt if local/stacked etcd Missing keys are non-fatal and produce warnings.
UsingExternalCA determines whether the user is relying on an external CA. We currently implicitly determine this is the case when the CA Cert is present but the CA Key is not. This allows us to, e.g., skip generating certs or not start the csr signing controller. In case we are using an external front-proxy CA, the function validates the certificates signed by front-proxy CA that should be provided by the user.
UsingExternalFrontProxyCA determines whether the user is relying on an external front-proxy CA. We currently implicitly determine this is the case when the front proxy CA Cert is present but the front proxy CA Key is not. In case we are using an external front-proxy CA, the function validates the certificates signed by front-proxy CA that should be provided by the user.
CertificateMap is a flat map of certificates, keyed by Name.
CertTree returns a one-level-deep tree, mapping a CA cert to an array of certificates that should be signed by it.
CertificateTree is represents a one-level-deep tree, mapping a CA to the certs that depend on it.
CreateTree creates the CAs, certs signed by the CAs, and writes them all to disk.
Certificates is a list of Certificates that Kubeadm should create.
GetCertsWithoutEtcd returns all of the certificates kubeadm needs when etcd is hosted externally.
GetDefaultCertList returns all of the certificates kubeadm requires to function.
AsMap returns the list of certificates as a map, keyed by name.
KubeadmCert represents a certificate that Kubeadm will create to function properly.
KubeadmCertAPIServer is the definition of the cert used to serve the Kubernetes API.
KubeadmCertEtcdAPIClient is the definition of the cert used by the API server to access etcd.
KubeadmCertEtcdCA is the definition of the root CA used by the hosted etcd server.
KubeadmCertEtcdHealthcheck is the definition of the cert used by Kubernetes to check the health of the etcd server.
KubeadmCertEtcdPeer is the definition of the cert used by etcd peers to access each other.
KubeadmCertEtcdServer is the definition of the cert used to serve etcd to clients.
KubeadmCertFrontProxyCA is the definition of the CA used for the front end proxy.
KubeadmCertFrontProxyClient is the definition of the cert used by the API server to access the front proxy.
KubeadmCertKubeletClient is the definition of the cert used by the API server to access the kubelet.
KubeadmCertRootCA is the definition of the Kubernetes Root CA for the API Server and kubelet.
func (k *KubeadmCert) CreateAsCA(ic *kubeadmapi.InitConfiguration) (*x509.Certificate, crypto.Signer, error)
CreateAsCA creates a certificate authority, writing the files to disk and also returning the created CA so it can be used to sign child certs.
func (k *KubeadmCert) CreateFromCA(ic *kubeadmapi.InitConfiguration, caCert *x509.Certificate, caKey crypto.Signer) error
CreateFromCA makes and writes a certificate using the given CA cert and key.
GetConfig returns the definition for the given cert given the provided InitConfiguration