Hi everyone, I'm working on a Rancher UI extensio...
# general
b
Hi everyone, I'm working on a Rancher UI extension and was wondering if it's possible to integrate a Golang HTTP server with it. Is this kind of integration supported? If so, could anyone point me to documentation or examples that demonstrate how to set it up? Thanks in advance!
s
UI extensions will be able to make http requests to any endpoint served under the same domain that the ui lives under.
w
To add a little more context. You could create a "backend" chart which implements any type of server you want and the extensions could make calls to it through the k8s proxy. We don't have any docs for setting up your specific case, but, Kubewarden and ElementalUI are both examples of extensions that have a backend which you could look into.
b
This backend will be deployed in the "local" cluster?
"through the k8s proxy" - the apiserver proxy?
w
This backend will be deployed in the "local" cluster?
It can be in any cluster including the local cluster.
"through the k8s proxy" - the apiserver proxy?
Yeah. An example of how kubewarden does it https://github.com/rancher/kubewarden-ui/blob/80d4a9a02dc4c34c4cc52ff96988f30982188ddd/pkg/kubewarden/utils/service.ts#L4 And depending on your situation or how you want to handle things, you don't even need to have the server within rancher itself. There is a mechanism to proxy requests outside of rancher https://extensions.rancher.io/extensions/next/usecases/node-driver/proxying
s
note that proxying via rancher is only supported for use when writing custom node drivers. otherwise it's important to keep the service within the same domain as rancher. this avoids COR related issues