Resources in Kubernetes are the fundamental units of every deployment within a Kubernetes cluster. Everything is a “resource,” whether you’re making a pod, setting limits, or describing custom objects. But what are Kubernetes resources exactly? How do they function, and what can you do to modify or keep track of them?
Controlling resources in Kubernetes is one of the most common activities for DevOps teams in the modern cloud-native world. From setting limits on CPU and memory to creating custom resource definitions (CRDs), resource management is a critical facet of ensuring the stability, scalability, and automation of applications. This guide will cover everything you need to know about Kubernetes resources, how to monitor changes in custom resources, and properly apply limits. Let’s unpack that, step by step.
What are Kubernetes Resources?
Resources are the state stuff in your cluster that you want to declare the desired state for. These can be pods, services, deployments, volumes, config maps, and even custom resources.
In Kubernetes, everything is a resource and is written to etcd. You communicate with them using kubectl or API requests.
How to Notify When the Custom Resource of Kubernetes Changes?
You can tell when a Kubernetes custom resource changes with dynamic informers in Go. Informers are watching the API server for changes and are responsible for triggering callbacks when changes happen.
This can be convenient for custom controllers and operators. Here’s how it works:
Get exclusive access to all things tech-savvy, and be the first to receive
the latest updates directly in your inbox.
- Write a dynamic informer for your CRD
- Register an event handler
- Handle Add, Update, and Delete events in Go
This way, you are notified immediately whenever your custom resource is updated.
How to Notify When the Custom Resource of Kubernetes Changes Go?
To inform Go when a Kubernetes user-defined resource changes, use the dynamicinformer.NewFilteredDynamicInformer
method from client-go
. You can now listen for events from and react to them as they occur relative to your CRD.
You need:
- A dynamic client
- A schema definition
- An informer factory
Wire up the OnAdd, OnUpdate, and OnDelete event handlers to act when things change.
What Is an Example of a Dynamic Informer in Custom Resource Kubernetes?
With Dynamic informers, you can watch and react to changes in any resource type, even if it’s custom. Here’s a simplified example:
informer := dynamicinformer.NewFilteredDynamicInformer(
dynamicClient,
gvr, // GroupVersionResource
namespace,
resyncPeriod,
cache.Indexers{},
nil,
)
informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
fmt.Println("Resource added")
},
UpdateFunc: func(oldObj, newObj interface{}) {
fmt.Println("Resource updated")
},
DeleteFunc: func(obj interface{}) {
fmt.Println("Resource deleted")
},
})
What Are Kubernetes Resource Limits, and Why Do You Need Them?
With Kubernetes resource limits, you can limit the amount of CPU or memory that a container is allowed to consume. These are defined in the pod using resources.limits and resources.requests.
Term | Description |
---|---|
Request | Minimum resource guaranteed to a pod |
Limit | Maximum resource a pod is allowed to use |
It ensures fair scheduling and prevents crashes in other pods. Both are critical for production workload stability.
What Are Kubernetes Resources, and How Can They Be Created and Managed?
You have the ability to manage Kubernetes resources using YAML files or commands with kubectl. Each type of resource (e.g, pod or deployment) has its structure.
Example of a simple pod YAML:
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: mycontainer
image: nginx
What Are Custom Resources in Kubernetes?
Custom resources enable you to extend Kubernetes beyond its built-in types. You create them with a CustomResourceDefinition (CRD).

Once you have defined them, they are used just the same as the other native resources. You can enumerate, watch, and patch them. CRDs are commonly used to declaratively manage applications by operators.
Role of CyberPanel in Managing Kubernetes Resources

CyberPanel, i.e., web hosting control panel, works well with Kubernetes to make server management and cloud app deployment easier. Though CyberPanel is not natively built for Kubernetes, its advanced users can:
- Automate CyberPanel deployments with Ansible or CI/CD scripts
- Work with Kubernetes-managed systems
- Keep an eye on containerized services that interface with CyberPanel
This is a great aid for DevOps teams looking to connect legacy hosting to modern containerization.
Frequently Asked Questions
Can I specify a request and limit for Kubernetes resources?
Yes. As a good practice, you should always set them both to make resource-efficient use of them and avoid being over-consuming.
Is it possible to watch for updates to custom resources?
Use dynamic informers in Go, or create a controller that watches for changes.
What are some standard Kubernetes built-in resources?
Pods, deployments, service, config maps, volumes, and secrets.
Final Thoughts!
If you understand Kubernetes resources, you are a master of modern infrastructure. Whether you’re writing validators, operating on CRDs, or managing controllers, resources fuel everything. Everything from scaling apps to maintaining cluster stability is all about resource definitions and lifecycle management.
Take control of your cloud-native stack—start mastering Kubernetes resources today and unlock the true power of automation.