kubernetes-training

Certificates

  1. Server cert: configured on the server
  2. Client cert: configured by client
  3. Root cert: configured by CA server

    [!Note] Private key have key in them

Server Certificate

CA

Certificate Creation

Certificate Authority (CA)

  1. Generate keys
    openssl genrsa -out ca.key 2048 --> this will give ca.key
    
  2. Certificate Signing Request: all signing details w/o signatures
    openssl req -new -key ca.key -subj "CN=KUBERNETES-CA" -out ca.csr 
    
  3. Sign certificates
    openssl x509 -req -in ca.csr -signkey ca.key -out ca.crt
    

Client Certificate

Same procedure, the only difference is when doing Sign Certificates, you specify CA cert and CA key

Kube Scheduler

Kube-Controller-Manager

Kube-proxy: similar to controller mnger and admin

[!Note] For client to be able to be verified using certificates, all components of the cluster needs a copy of the public cert of the CA

Kubelet (being client talking to kubeapi-server)

kube api server

kubelet server

  1. To authenticate with kube-api server
curl https://kube-apiserver:6443/api/v1/pods \ 
--key admin.key  --cert admin.crt --cacert ca.crt
  1. Use them in kube-config.yaml

View Cert

openssl x509 in /etc/kubernetes/pki/apiserver.crt -text -noout

Healthcheck