From 2263aeaa38b55fe49b131a0f05d31ab0a0e5397e Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 7 Aug 2023 15:12:36 +0900 Subject: [PATCH] docs: update readme (#276) --- .../controller-runtime/reconciler/README.md | 4 + .../reconciler/diagram.drawio.svg | 198 ++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 contents/kubernetes-operator/controller-runtime/reconciler/diagram.drawio.svg diff --git a/contents/kubernetes-operator/controller-runtime/reconciler/README.md b/contents/kubernetes-operator/controller-runtime/reconciler/README.md index a89fb11b..ea51df14 100644 --- a/contents/kubernetes-operator/controller-runtime/reconciler/README.md +++ b/contents/kubernetes-operator/controller-runtime/reconciler/README.md @@ -1,7 +1,11 @@ # [Reconciler](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile) +![](diagram.drawio.svg) + Controller logic is implemented in terms of Reconcilers ([pkg/reconcile](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile)). A Reconciler implements a function which takes a reconcile Request containing the name and namespace of the object to reconcile, reconciles the object, and returns a Response or an error indicating whether to requeue for a second round of processing. +As you can see in the diagram above, a Reconciler is part of a Controller. A Controller has a function to watch changes of the target resources, put change events into the queue, and call **Reconcile** function with an queue item, and requeue the item if necessary. + ## Types diff --git a/contents/kubernetes-operator/controller-runtime/reconciler/diagram.drawio.svg b/contents/kubernetes-operator/controller-runtime/reconciler/diagram.drawio.svg new file mode 100644 index 00000000..266d737e --- /dev/null +++ b/contents/kubernetes-operator/controller-runtime/reconciler/diagram.drawio.svg @@ -0,0 +1,198 @@ + + + + + + + +
+
+
+ Controller +
+
+
+
+ + Controller + +
+
+ + + + + + +
+
+
+ Reconcile() +
+
+
+
+ + Reconcile() + +
+
+ + + + + + +
+
+
+ Request +
+
+
+
+ + Request + +
+
+ + + + + +
+
+
+ requeue if necessary +
+
+
+
+ + requeue if necessary + +
+
+ + + + +
+
+
+ Response +
+
+
+
+ + Response + +
+
+ + + + + + +
+
+
+ Reconciler +
+ interface +
+
+
+
+ + Reconciler... + +
+
+ + + + + +
+
+
+ trigger Reconcile +
+
+
+
+ + trigger Reconcile + +
+
+ + + + + +
+
+
+ WorkQueue +
+
+
+
+ + WorkQueue + +
+
+ + + + + + + + +
+
+
+ Reflector +
+
+
+
+ + Reflector + +
+
+ + + + +
+
+
+ Kube API Server +
+
+
+
+ + Kube API Server + +
+
+
+ + + + + Text is not SVG - cannot display + + + +