This message was deleted.
# extensions
a
This message was deleted.
🔥 1
s
Extensions are primarily the view layer of the application and interact with existing infrastructure. For your case think maybe just a kube ConfigMap would be best. I'm assuming this is setup info available to all users of your extension?
m
Yep, thats true! Thanks, but how can the extensions interact with the API of kubernetes in order to create/read configmaps? Can I use the API layer of Rancher? Is there any docs/example?
s
Is your extension located within the
Cluster Explorer
section, a
Global App
or something different?
m
Global App
s
Ok, you'll need to save / access your configmap in the upstream /
local
cluster by dispatching
create
/
find
actions in the
management
store. There's some more info here, specifically half way down https://rancher.github.io/dashboard/code-base-works/api-resources-and-schemas . For your use case you'd roughly need to 1. dispatch
management/create
with the configmap type. 2. populate the object it returns with your required values 3. call
await <object>.save()
to persist 4. on subsequent loads you can access it via dispatching a
management/find
action this assumes the user who's signed in to the dashboard has the required rights to save config maps
other users of the dashboard who need to access your extension would need read rights on that confimap map too
m
thanks you 😄 I'll try!!
s
No problem, let us know how you get on