Kubernetes Fundamentals

Kubernetes Resources

In Kubernetes, resources are like building blocks used to create and manage your cluster. Each resource is an object with metadata (such as names and labels) and a desired state that defines its behavior. All objects in Kubernetes are managed by an API and stored in the etcd database.

For example, a Pod resource defines how to run a group of containers, while a Service resource manages network access to those containers. Everything you can manage with kubectl or the Kubernetes API - like workloads, storage, or configuration - is a resource, making them essential for defining and controlling your cluster's behavior.

The following command lists all the resources that can be managed in a Kubernetes cluster, including their names, short names, API versions, and whether they are namespaced:

kubectl api-resources

The most relevant resources for the KCNA exam are marked red

Resource Overview

Core Resources

Workloads

Networking

RBAC (Role-Based Access Control)

Storage

Admission Control

API Extensions

Authentication and Authorization

Autoscaling

Certificates

Coordination

Discovery

Events

Flow Control

Node Management

Policies

Scheduling

Kubernetes Architecture

Control Plane:

  1. API Server (kube-apiserver)
  2. etcd
  3. Controller Manager (kube-controller-manager)
  4. Scheduler (kube-scheduler)
  5. Cloud Controller Manager (optional)

Node (Worker Node):

  1. Kubelet
  2. Kube Proxy
  3. Container Runtime (z. B. containerd, CRI-O, Docker)

image.png

Kubernetes API

Kubernetes is an object based system - everything is managed and stored in objects, and it also provides the tools to manage those objects.

Each object contains of three parts:

  1. Metadata: Information about the object, like its name and labels.
  2. Specification (spec): What you want Kubernetes to do—your "desired state." For example, "run 3 replicas of my app."
  3. Status: What's actually happening right now—Kubernetes updates this as it works to match the current state to the desired state.

This interaction with objects happens through the Kubernetes API, which is the core interface of Kubernetes. The Kubernetes API provides a universal way for users, automation tools, and Kubernetes itself to interact with the objects stored in the system. It allows you to create, update, delete, and retrieve information about the various object resources (like Pods, Deployments, Services, etc.) within a Kubernetes cluster.

Containers

Scheduling