🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
⚠️ Malware / Trojaner / VirenVorsicht: Android-Malware verschlüsselt Ihre Handys und nimmt heimlich Fotos auf(11.09.2026 um 09:35 Uhr)
🕵️ SicherheitslückenMicrosoft geht endlich eines der nervigsten Probleme von Windows 11 an(11.09.2026 um 11:58 Uhr)
💾 IT Security ToolsSysinternals Suite(11.09.2026 um 12:00 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)
🔧 AI Nachrichten Stealing AI Reasoning Traces(08.09.2026 um 12:20 Uhr)
🔧 AI Nachrichten AIs as Modern Genies(08.09.2026 um 19:12 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
⚠️ Malware / Trojaner / VirenVorsicht: Android-Malware verschlüsselt Ihre Handys und nimmt heimlich Fotos auf(11.09.2026 um 09:35 Uhr)
🕵️ SicherheitslückenMicrosoft geht endlich eines der nervigsten Probleme von Windows 11 an(11.09.2026 um 11:58 Uhr)
💾 IT Security ToolsSysinternals Suite(11.09.2026 um 12:00 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)
🔧 AI Nachrichten Stealing AI Reasoning Traces(08.09.2026 um 12:20 Uhr)
🔧 AI Nachrichten AIs as Modern Genies(08.09.2026 um 19:12 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 4 Min Lesezeit
0

Customizing Kubernetes Configurations with Custom Resource Definitions (CRDs)

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Customizing Kubernetes configurations using Custom Resource Definitions (CRDs) allows you to extend Kubernetes capabilities by defining your own resources. This is especially useful when you need to manage custom objects that are not natively supported by Kubernetes.






Overview of CRDs



A Custom Resource Definition (CRD) is a way to define custom resources in a Kubernetes cluster. Once a CRD is created, you can create, manage, and manipulate instances of the custom resource, just like any other built-in Kubernetes resource (such as pods, services, etc.).






Key Components of CRDs





  1. Definition: The CRD itself is defined in a YAML file and includes specifications about the custom resource's name, API version, kind, and its schema.


  2. Custom Resource: After defining a CRD, you can create instances of your custom resource.






Steps for Customizing Kubernetes with CRDs






1. Define a CRD



To define a custom resource, you first need to define a CRD. Below is an example of how to create a CRD for a "Database" resource.




CODE
# crd-database.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: databases.example.com
spec:
group: example.com
names:
kind: Database
plural: databases
singular: database
shortNames:
- db
scope: Namespaced
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
databaseName:
type: string
databaseType:
type: string
replication:
type: boolean






This CRD defines a custom resource named Database with fields for databaseName, databaseType, and replication. These fields represent the properties of a database instance.






2. Apply the CRD to the Cluster



To create the CRD, apply the YAML file to your Kubernetes cluster:




CODE
kubectl apply -f crd-database.yaml






This will register the Database resource in your cluster.






3. Create Instances of Your Custom Resource



Once the CRD is created, you can start creating instances of your custom resource. Here's an example of creating a Database instance:




CODE
# db-instance.yaml
apiVersion: example.com/v1
kind: Database
metadata:
name: my-database
spec:
databaseName: mydb
databaseType: postgres
replication: true






To create the custom resource instance, apply the file:




CODE
kubectl apply -f db-instance.yaml






This will create a Database object named my-database with the specified specifications.






4. Access the Custom Resource



You can interact with your custom resource just like any other Kubernetes resource. For example:




CODE
kubectl get databases
kubectl describe database my-database






These commands will retrieve and describe the custom resource my-database.






5. Managing the Custom Resource



You can also update or delete the custom resource instance:





  • Update: Modify the db-instance.yaml and re-apply it:




CODE
  kubectl apply -f db-instance.yaml








  • Delete: To remove the custom resource:




CODE
  kubectl delete database my-database









6. CRDs with Controllers



A controller is typically used to manage the lifecycle of the custom resources. Controllers watch for changes in custom resources and take action based on those changes.



You can build a custom controller using the Kubernetes client libraries in Go, Python, or other languages. The controller can automate tasks like deploying resources, performing health checks, or scaling resources when certain conditions are met.



For example, a database controller might automatically deploy a PostgreSQL pod when a new Database resource is created.






Use Cases for CRDs





  • Application Configuration: You might use CRDs to define complex configurations for an application that Kubernetes does not natively support.


  • Automation: Create CRDs for resources that need to be managed outside the scope of standard Kubernetes objects (e.g., logging configurations, monitoring settings).


  • Extending Kubernetes: CRDs allow you to introduce new types of resources into your cluster that can be integrated with other Kubernetes components, such as the scheduler, controllers, and networking.






Conclusion



CRDs are a powerful feature in Kubernetes that allow you to extend the cluster's native capabilities by defining custom resources. This can help you manage complex applications, infrastructure, and other configurations that are not covered by standard Kubernetes resources. By combining CRDs with controllers, you can automate the management of these resources in a declarative and scalable way.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
OpenAI Targets Work of Wall Street Junior Bankers
1 Quelle
Altman Considers Slowing Down AI Development
1 Quelle
JSCeal Malware Can Bypass Google Authentication Using Stolen Session Cookies
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Customizing Kubernetes Configurations with Custom Resource Definitions (CRDs)

Thematisch verwandte Begriffe: Customizing, Kubernetes, Configurations, with · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...