Giter Site home page Giter Site logo

Comments (2)

shach33 avatar shach33 commented on August 25, 2024 1

This is great. Thankyou @camilamacedo86 !

from kubebuilder.

camilamacedo86 avatar camilamacedo86 commented on August 25, 2024

Hi @shach33,

Yes, you can accomplish that. It's important to understand that when you're creating a Custom Resource Definition (CRD) and its associated controller, you're essentially managing specific aspects of your Kubernetes cluster that are tailored to your business or solution's needs. For instance, consider Controller A, which is responsible for managing a custom resource, Thing A. To effectively manage Thing A within your cluster, you would typically need to interact with various Kubernetes objects such as Services and Deployments. This management is done within Controller A, where you'll import and manage these objects.

Similarly, you can also manipulate another CRD, let's call it CRD B, from within the controller for CRD A. This is particularly useful for cases where one resource depends on another.

Therefore, in other words, when you extend the K8s API and create your OWN APIs/CRDs you can use at the same way that you use the K8S ones. So, at the same way that you for example watch a ConfigMap you can watch a "Your OWN Kind X" and go on.

Example Solution

Take, for example, a project where one CRD represents a database and another CRD represents a backup process. It wouldn't be practical to initiate a backup if the database it depends on doesn't exist. Hence, within the backup's controller, there's functionality to monitor the database CR in the cluster to ensure that backups are only attempted when the database is present and to gather necessary information from the database for the backup process.

See:

Please note that the project mentioned above is somewhat outdated and uses older syntax and Kubernetes API versions. However, it serves as a valuable example to understand the concept and the operational dynamics between different CRDs and their controllers.

To know more about:

I am closing this one, since I think the above info answer your question.
however, feel free to re-open or open new issues as you see fit.

from kubebuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.