How cloudwithvarjosh/tls-in-kubernetes-masterclass works
Project Type and Purpose
• This repository is not an application codebase but a training/reference project that explains TLS/mTLS in Kubernetes.
• Its goal is to teach how Kubernetes components (kubectl, API server, etcd, scheduler, kubelet) use asymmetric and symmetric encryption, certificate authorities, kubeconfig, and RBAC to secure in-cluster communication and external access.
Main Components
a. Certificate Authorities (CAs)
• Cluster Root CA (signs API server, scheduler, controller-manager certs)
• etcd-CA (signs etcd server and apiserver-etcd-client certs)
• External/Public CA (e.g., Let's Encrypt) for ingress (optional)
b. Clients
• kubectl (human user Seema)
• kube-scheduler, kube-controller-manager, kube-proxy
• API server when it acts as a client to etcd and kubelet
c. Servers
• kube-apiserver (serves API, validates client certs)
• etcd (persistent store, serves data to API server)
• kubelet (node agent, serves logs/exec endpoints)
d. User and External Access
• Seema’s workstation with kubeconfig, CSR flow, certificate issuance, RBAC
Relationships and Interactions
• One-way TLS: kubectl → API server (server authenticates via apiserver.crt)
• mTLS:
• Scheduler → API server
• Controller-manager → API server
• API server → etcd
• API server → kubelet
• CSR Flow for external user:
• User → CSR → API server → Approval → Signed certificate → kubeconfig
Architectural Patterns and Principles
• PKI Model: Root CA signs intermediate CAs and component certificates
• Mutual TLS: Both client and server present certs for authentication
• Layered Security:
• Control Plane (API server, scheduler, controller) uses cluster CA
• etcd uses dedicated etcd-CA
• Node services (kubelet) use TLS bootstrapping and NodeRestriction
• Separation of Concerns: Each component has its own key pair and kubeconfig
Technologies, Frameworks, Libraries
• Kubernetes core components: kube-apiserver, etcd, kubelet, scheduler, controller-manager, kube-proxy
• TLS/OpenSSL for certificates and CRLs
• kubectl & kubeconfig for user-to-cluster authentication
• RBAC API to bind certificates to users/namespaces
• CertificateSigningRequest Kubernetes API