Skip to content

Creating doc with basic patterns in controllers we should consider for architecture #1095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
csviri opened this issue Mar 28, 2022 · 1 comment

Comments

@csviri
Copy link
Collaborator

csviri commented Mar 28, 2022

This is mainly needed for reasoning and to agree what use cases operators should cover. Will serve as an input document for dependent resources workflows and other architectural decisions

@csviri
Copy link
Collaborator Author

csviri commented Apr 7, 2022

Started to work on this but outcome came out very simple. Basically every situation is already covered by the design here:
#850

In short we can describe like this:

The goals is to enumerate and explore of resource management patters in a reconciler.

We can have two types of resource in general external and internal. And either there is a depends on relation between them or not.

  • Kubernetes Resource in this context means that any well known Kubernetes resource (pod, deployment, config map,...)
    or any custom resource.

  • External Resource is any non Kubernetes resource, in other words any resource that is managed by an API call
    outside of Kubernetes (samples: GitHub repository, S3 bucket, Jenkins Pipeline, Database Schema) by a controller.

  • A depends on B means that the resource needs to be created or updated first and it's output values might be used as an input for other resource. This is typically values from a status of a resource, like any status from
    custom resource or ip from a service:

      apiVersion: v1
      kind: Service
      metadata:
          name: my-service
      spec:
          selector:
              app: MyApp
          ports:
          - protocol: TCP
            port: 80
            targetPort: 9376
          clusterIP: 10.0.171.239
          type: LoadBalancer
      status:
          loadBalancer:
              ingress:
              - ip: 192.0.2.127

Situtations

  1. Independent Resources (both External and Kubernetes)

  2. Non Independent Kubernetes Resources

  3. External Resource depending on a Kubernetes Resource

  4. Kubernetes Resource depends on External Resource

  5. External Resource depends on other External Resource

But basically if resources are independent (thus all values are derived from primary resource) can be created in whatever order usually. If those are dependent on each other, the one should be reconciled first, the other after (in case even wating for a state to be in, see the mentioned issue)

@csviri csviri closed this as completed Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant