Debugging
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.
There are two tools helping with debugging local running function servers:
-
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.