Kubernetes Resources
A Kubernetes resource is an object that represents part of the desired state of a Kubernetes cluster, while Kubernetes continuously monitors and updates its status to reflect the actual state. Resources define what exists in the cluster—such as applications, workloads, networking, or configuration. Some resources represent concrete components, such as nodes and pods; others define abstract concepts that do not correspond to anything physical, such as a deployment, which serves as a blueprint for pods. Each resource is described in a .yaml or .json file and managed by Kubernetes to ensure the actual cluster state matches the definition.
Most resources belong to a specific namespace. A namespace is a logical grouping within a Kubernetes cluster that isolates the resources and helps organize workloads. It also prevents naming conflicts and controls access between projects or environments. Resources are created in the default namespace unless you specify another. Examples of resources that are not namespaced include nodes, namespaces, and persistent volumes.
The following table lists common Kubernetes resources.
|
Resource Name |
Code |
Description |
|---|---|---|
|
Namespace |
ns |
Logical partition within a cluster that isolates and organizes resources. |
|
Node |
no |
Kubernetes abstraction of a node. |
|
Pod |
po |
Kubernetes abstraction of a pod. It defines everything the pod needs to run, including the container image, ports, environment variables, volume mounts, and resource limits. |
|
Deployment |
deploy |
Defines the blueprint for a set of identical pods, including the number of replicas, container image, ports, environment variables, volume mounts, and resource limits. |
|
Service |
svc |
Kubernetes abstraction of a service. Specifies pods or deployments to which a stable IP address is linked, and how traffic is distributed among them. |
|
Ingress |
ing |
Defines routing rules for external HTTP/HTTPS access to services. These rules are read and enforced by an ingress controller. |
|
ConfigMap |
cm |
Stores non-sensitive configuration data as key-value pairs that can be used by pods or deployments. |
|
Secret |
|
Similar to ConfigMap but used to store sensitive data, such as passwords, tokens, or API keys. |
|
PersistentVolume |
pv |
A piece of storage that can be mounted by pods and persists even when the pods restart. |