-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from vshn/change/xplane114_docs
Adjust docs for crossplane 1.14
- Loading branch information
Showing
5 changed files
with
122 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 16 additions & 3 deletions
19
docs/modules/ROOT/pages/explanations/comp-functions/debug.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
= Debugging | ||
|
||
If the GRPC server is in devmode, it will save the funcIOs of each function to configMaps in the default namespace. It will always keep two configMaps per composite and function. One contains the previous and one the current state. For example for VSHNPostgreSQL this could result in up to four configMaps; two for the postgresql function and two for the miniodev function (which provides the local S3 bucket). | ||
The function server can be started in an insecure mode. | ||
This mode will make it listen on plain http on port 9443. | ||
Any valid Composition Function GRPC request can be redirected to this port. | ||
|
||
These configMaps can be used to see the state of the whole FuncIO and should help with local debugging. Additionally, the GRPC server now prints a diff of those configMaps on each reconcile. | ||
There are two tools helping with debugging local running function servers: | ||
|
||
The configMaps and the diffs will only rotate on `.spec` changes on the claim/composite, it uses the generation to track current and previous states. This way we can track the "logical" diff of a change, even if it needs multiple reconcile loops to be applied fully. | ||
* Crank renderer (github.com/crossplane/crossplane/cmd/crank beta render) | ||
* Function proxy | ||
The crank rendered will take the given xr, composition and function as yaml files. | ||
It then sends the given XR to the function server where it will handle accordingly. | ||
It's also possible to add observed objects via a folder with their yaml definitions. | ||
This method of debugging is handy when the raw output of the function needs to be inspected. | ||
|
||
The function proxy on the other hand, is a running function server instance on the cluster itself. | ||
It will then only redirect any given GRPC call to the given endpoint. | ||
This given endpoint can then be the local running function server. | ||
The function server can run in a debug session, so stepping through the execution is supported. |
35 changes: 20 additions & 15 deletions
35
docs/modules/ROOT/pages/explanations/comp-functions/runtime.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
= Runtime Library | ||
|
||
The runtime library helps to facilitate the implementation of transformation go functions. | ||
It allows to operate on underlying function-io resources and composites. There are 2 objects accessible | ||
from a runtime object: | ||
The runtime library helps to facilitate the implementation of go functions. | ||
It allows to operate on underlying managed resources and composites. | ||
|
||
- `Observed` - the observed state of the XR and any existing composed resources. | ||
- `Desired` - the desired state of the XR and any composed resources. | ||
For more information on how function-io operates check the https://docs.crossplane.io/knowledge-base/guides/composition-functions/#functionio[documentation] | ||
For more information on how composition functions operate check the https://docs.crossplane.io/knowledge-base/guides/composition-functions/[documentation] | ||
from Crossplane. | ||
|
||
== Desired Object | ||
== Desired Objects | ||
|
||
The runtime desired object has methods to obtain and update desired resources from function-io. | ||
The desired objects are tracked in the `ServiceRuntime` until all steps finished. | ||
The `ServiceRuntime` will then generate the response GRPC object for Crossplane.All objects that have been added to the desired objects map will be applied by Crossplane. | ||
If an object is not added to the desired map, and it exists on the cluster, it will be removed. | ||
So always add all necessary objects on each reconcile. | ||
|
||
== Observed Object | ||
== Observed Objects | ||
|
||
The runtime observed object has methods to obtain observed resources from function-io. | ||
Are the objects as applied to the cluster. | ||
They contain any external injected information, as well as the status object. | ||
|
||
== Result Object | ||
|
||
Any transformation go function expects a `runtime.Result` object. This object type wraps the Crossplane | ||
own Result type. The runtime library has simple functions that allows creation of `runtime.Result` objects | ||
in various states - `fatal`, `warning` or `normal`. To understand the difference between these states | ||
consult crossplane https://docs.crossplane.io/knowledge-base/guides/composition-functions/#functionio[documentation]. | ||
Any service step expects a `*xfnproto.Result` return object. | ||
This object type is Crossplane's own Result type. | ||
The runtime library has simple functions that allows creation of `*xfnproto.Result` objects | ||
in various states - `fatal`, `warning` or `normal`. | ||
Please note that a fatal result will mark the whole composition as failed. | ||
It should only be used if the error is sever enough for the composition to actually work properly. | ||
|
||
For further information, please consult the Crossplane docs. | ||
consult crossplane https://docs.crossplane.io/knowledge-base/guides/composition-functions/[documentation]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters