Building Kubernetes from source is suitable for studying or testing a patched component. A production cluster also requires a supported upgrade path, certificate rotation, backup recovery, networking, storage, monitoring, and incident procedures.
Object Model and API Paths #
Kubernetes models cluster operations as CRUD on resources. Each object has a UID, a type, a unique name within that type, labels for indexed selection, and annotations for non-identifying metadata.
Resources are grouped into API groups:
- the core group is exposed under
/api/v1; - named groups are exposed under
/apis/<group>/<version>.
Discovery endpoints such as GET /api, GET /apis, and /openapi/v3
describe which resources the cluster supports. A resource list entry exposes
the canonical name, kind, namespace scope, verbs, and short names such as
pvc.
The common verbs map to HTTP methods:
get,list, andwatchuseGET;createusesPOST;updateusesPUT;patchusesPATCH;deleteanddeletecollectionuseDELETE.
This object model is why a Service is a stable endpoint backed by many Pods,
while a Pod itself remains ephemeral and gets a new network identity when
recreated.
Build and Record Binaries #
Build from a tagged Kubernetes source revision with the documented Go
toolchain. Record the source commit, toolchain version, build flags, and
checksums for every binary. Build selected commands with make WHAT=... or
use the release build process; do not download arbitrary binaries into a
control-plane host.
Establish the Control Plane #
An odd-sized etcd quorum stores API state. Protect peer and client traffic with TLS, test snapshot restoration, and restrict direct client access. Start the control plane in dependency order:
- Establish etcd, certificates, service-account signing keys, and network reachability.
- Start
kube-apiserverwith its serving certificate, etcd client credentials, service CIDR, admission configuration, and audit policy. - Start
kube-controller-managerandkube-schedulerwith individual identities. - Configure an administrative kubeconfig for initial bootstrap only.
- Install a CNI implementation, then join kubelets.
The kubelet requires a node identity, API endpoint, CRI-compatible runtime, CNI configuration, and matching Pod CIDR assumptions. Service routing is implemented by kube-proxy or an alternative data plane.
The control plane components have distinct jobs:
etcdstores cluster state;kube-apiserveris the front door for all authenticated requests;kube-controller-managerreconciles desired state into actual state;kube-schedulerpicks a node for pending Pods;kubeletkeeps one node aligned with the API server;kube-proxyimplements Service routing on each node.
Secure API Requests #
The API server accepts HTTPS requests. A request path is:
- authentication, which associates the request with a username, UID, groups, and optional extra attributes through client certificates, service-account tokens, or OIDC;
- authorization, which evaluates the identity, verb, resource, namespace, and name;
- admission, which validates or mutates the request;
- persistence to etcd when the request changes cluster state.
Enable Node and RBAC authorization unless a deliberate alternative is
designed. Disable anonymous access, avoid static token files, separate
component identities, and keep private keys outside source control. Verify
/readyz, DNS, Service routing, resource enforcement, node loss, certificate
renewal, and etcd restoration before considering the cluster operational.
Comments
Read or comment on GitHub (sign-in required to comment)