You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Glue` is the heart of the operator. Note that `GlueOperator` controller just creates a new `Glue` with a related resource,
12
-
for each parent custom resource. `Glue` defines `resources` (sometimes referred to as managed resources) and `related resources`:
12
+
for each parent custom resource. `Glue` defines `childResources` (sometimes referred to as managed resources) and `related resources`:
13
13
14
-
### Managed resources
14
+
### Child Resources
15
15
16
16
#### Attributes
17
17
18
-
The `resources` section is a list of resources to be reconciled. It has several attributes:
18
+
The `childResources` section is a list of resources to be reconciled (created, updated, deleted by controller).
19
+
It has several attributes:
19
20
20
21
-**`name`** - is a mandatory unique (unique also regarding related resources) attribute.
21
22
The resource is referenced by this name from other places, typically other resource templates and `JSCondition`.
22
23
If it is used in a `JSCondition` the `name` must be a valid JavaScript variable name.
23
24
-**`resource`** - is the desired state of the resource applied by default using Server Side Apply. The resource is templated using
24
25
[qute templating engine](https://quarkus.io/guides/qute-reference), other resources can be referenced from the templates, see below.
25
-
There is a restriction, that the managed resource is namespaced, and the namespace is always the same as the namespace of the `Glue`
26
+
There is a restriction, that the child resource is namespaced, and the namespace is always the same as the namespace of the `Glue`
26
27
(and/or parent for `GlueOperator`), so the `namespace` field in resource **metadata should not be specified**.
27
-
-**`dependsOn`** - is a list of names of other managed resources (not related resources). The resource is not reconciled until all the resources
28
+
-**`dependsOn`** - is a list of names of other child resources (not related resources). The resource is not reconciled until all the resources
28
29
which it depends on are not reconciled and ready (if there is a `readyPostCondition` present).
29
30
Note that during the cleanup phase (when a `Glue` is deleted) resources are cleaned up in reverse order.
30
31
-**`condition`** - a condition to specify if the resource should be there or not, thus even if the condition is evaluated to be `true`
@@ -39,17 +40,17 @@ At the moment there are two types of built-in conditions provided:
39
40
40
41
-**`ReadyCondition`** - check if a resource is up and running. Use it only as a `readyPostCondition`. See sample usage [here](https://github.com/csviri/kubernetes-glue-operator/blob/main/src/test/resources/sample/mutation/mutation.glue.yaml#L24-L25).
41
42
-**`JSCondition`** - a generic condition, that allows writing conditions in JavaScript. As input, all the resources are available which
42
-
are either managed or related. The script should return a boolean value.
43
+
are either child or related. The script should return a boolean value.
43
44
See accessing the related resource in [WebPage sample](https://github.com/csviri/kubernetes-glue-operator/blob/main/src/test/resources/sample/webpage/webpage.operator.yaml#L62-L64),
44
45
and cross-referencing resources [here](https://github.com/csviri/kubernetes-glue-operator/blob/main/src/test/resources/glue/TwoResourcesAndCondition.yaml#L23-L28).
45
46
46
47
### Related resources
47
48
48
-
Related resources are resources that are not managed (not created, updated, or deleted) during reconciliation, but serve as an input for it.
49
+
Related resources are resources that are not reconciled (not created, updated, or deleted) during reconciliation, but serve as an input for it.
49
50
See sample usage within `Glue`[here](https://github.com/csviri/kubernetes-glue-operator/blob/main/src/test/resources/glue/RelatedResourceSimpleWithCondition.yaml)
50
51
The following attributes can be defined for a related resource:
51
52
52
-
-**`name`** - same as for managed resource, unique identifier, used to reference the resource.
53
+
-**`name`** - same as for child resource, unique identifier, used to reference the resource.
53
54
-**`apiVersion`** - Kubernetes resource API Version of the resource
54
55
-**`kind`** - Kubernetes kind property of the resource
55
56
-**`resourceNames`** - list of string of the resource names within the same namespace as `Glue`.
@@ -71,9 +72,9 @@ In addition to that in `GlueOperator` the **`parent`** attribute can be used to
71
72
72
73
### Reconciliation notes
73
74
74
-
The reconciliation is triggered either on a change of the `Glue` or any managed or related resources.
75
+
The reconciliation is triggered either on a change of the `Glue` or any child or related resources.
75
76
76
-
On every reconciliation, each managed resource is reconciled, and if a resource is updated, it is added to a cache, so it is available for templating
77
+
On every reconciliation, each child resource is reconciled, and if a resource is updated, it is added to a cache, so it is available for templating
77
78
for a resource that depends on it.
78
79
79
80
The `DependentResource` implementation of JOSDK makes all kinds of optimizations on the reconciliation which are utilized (or will be also here).
@@ -98,7 +99,7 @@ While we will provide more options, users are encouraged to enhance/adjust this
98
99
99
100
Since the project is a meta-controller, it needs to have access rights to all the resources it manages.
100
101
When creating specialized roles for a deployment, roles should contain the union of required access rights
101
-
for all the managed resources, specifically: `["list", "watch", "create", "patch", "delete"]`
102
+
for all the child resources, specifically: `["list", "watch", "create", "patch", "delete"]`
102
103
and `["list", "watch"]` for related resources.
103
104
104
105
The project is mainly tested with cluster-scoped deployment, however, QOSDK namespace-scoped deployments are also supported.
0 commit comments