Resource

A Kubernetes resource is an API object that represents part of a cluster, such as a Pod, Deployment, Service, ConfigMap, Secret, or Job, defined declaratively and managed by Kubernetes.

Table of Contents

Table of Contents

Common Kubernetes resource types

Resources are the building blocks of Kubernetes automation. Teams define what they want, and Kubernetes makes it so.

Resource What it does Example use
Pod Runs one or more containers A test or app instance
Deployment Keeps a set of pods running A web service
Service Gives pods a stable network address Internal API endpoint
ConfigMap Stores non-secret configuration Feature flags, URLs
Secret Stores sensitive data API tokens, passwords
Job Runs pods to completion A test run or migration
Namespace Groups and isolates resources Team or environment boundary

How Kubernetes manages resources

  1. A team declares the resource in a YAML or JSON manifest.
  2. The manifest is applied through kubectl, Helm, or GitOps.
  3. The API server stores the desired state.
  4. Controllers compare desired state with actual state.
  5. Kubernetes reconciles any difference automatically.

Why resources matter in Kubernetes

Resources give the cluster the abstractions it needs to manage workloads safely.

  • Declarative management: define desired states instead of running manual commands
  • Automation: Kubernetes continuously reconciles resources
  • Modularity: each resource handles one job, such as networking or storage
  • Scaling: Deployments and ReplicaSets adjust workloads to demand
  • Access control: RBAC policies secure resources
  • Separate config: ConfigMaps and Secrets keep settings out of images

Consider a SaaS team that stores API keys in container images. Moving them into Secrets lets them rotate keys without rebuilding anything.

Common challenges with Kubernetes resources

  • Resource sprawl: unused or duplicate resources pile up
  • Misconfiguration: YAML mistakes cause failures
  • Access management: loose permissions create security risk
  • Missing limits: no CPU or memory limits leads to evictions
  • Dependencies: pods fail when required ConfigMaps or Secrets are missing
  • Debugging: tracing links between resource types takes time

Governance, automation, and monitoring keep resources healthy.

How resources relate to Testkube

Testkube builds on standard Kubernetes resources. Tests run in isolated, scalable environments with clear cleanup.

  • Pods: each test runs in its own pod
  • Jobs and CronJobs: manage test lifecycles and schedules
  • ConfigMaps and Secrets: hold variables and credentials securely
  • Namespaces: keep test resources scoped by team or environment
  • Automatic cleanup: temporary resources removed after each run
  • Resource metrics: data from Kubernetes and Prometheus for analysis
  • Multi-cluster: resources coordinated across clusters

Real-world examples

  • Isolated runs: a QA engineer runs many Testkube tests, each in its own pod
  • Progress tracking: a DevOps team watches Testkube Job resources during suites
  • Capacity tuning: a platform engineer sets requests and limits for large runs
  • Secure config: a developer keeps API tokens in Secrets used by test pods
  • Audits: a compliance team reviews namespaces and resources Testkube creates

Frequently Asked Questions (FAQs)

What is a resource in Kubernetes?

A resource is any API object in a cluster, such as a Pod, Service, Secret, or Job.

What are resource requests and limits?

Requests reserve CPU and memory for a container. Limits cap how much it can use.

What is a custom resource?

A custom resource extends the Kubernetes API with new object types, defined by a CustomResourceDefinition.

Which resources does Testkube use?

Testkube uses Pods, Jobs, CronJobs, ConfigMaps, Secrets, and Namespaces to run and manage tests.

Does Testkube clean up resources after tests?

Yes. Temporary resources are removed after each run unless retention is configured.

How do I avoid resource sprawl?

Label resources, set owners, and audit regularly. Automate cleanup for temporary resources.

Related Terms and Concepts

No items found.