Hey there. I have a RKE1 extension that had been w...
# extensions
c
Hey there. I have a RKE1 extension that had been working just fine, but to resolve
CVE-2025-1974
I upgraded Rancher and K8s to the most recent stable version (as of last week) and now needed to upgrade the extension. I used the migration script and wanted to test how that worked out before digging back into the extension - it seemed to work and
yarn
was able to build/package it. However, when installing the extension via Developer Load I am getting errors that Rancher
Could not load extension code
. Where might I be able to look for logs/info on what is erroring? Thank you.
b
Go to
local
cluster -
deployments
-
rancher
(click to see the details page). On this details page, there are 3 pods, for which you can check the logs (table action on 3 dotted menu, right hand side). One of those should contains some logs from the backend part. Also, check the resource
UIPlugins
(go to the header, resource search icon, search for
UIPlugins
). Extension assets should be cached. If they are not, then there might be a problem
g
@busy-ability-54059 Thanks for the reply. @cool-jewelry-75805 uninstalled the
triton
extension I deployed to our rancher instance via the Rancher UI but I still see stuff on the backend:
Copy code
ubuntu@rancher:~$ sudo docker exec -it rancher bash
bash-4.4# kubectl -n cattle-ui-plugin-system get all
NAME                                            READY   STATUS    RESTARTS       AGE
pod/rancher-extension-triton-545dbc59fb-7h6q9   1/1     Running   251 (9h ago)   237d
pod/ui-plugin-operator-7d6f75cc-tjhgk           1/1     Running   470 (9h ago)   237d

NAME                                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/rancher-extension-triton-svc   ClusterIP   10.43.45.146    <none>        8080/TCP   237d
service/ui-plugin-operator             ClusterIP   10.43.191.192   <none>        80/TCP     279d

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/rancher-extension-triton   1/1     1            1           237d
deployment.apps/ui-plugin-operator         1/1     1            1           279d

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/rancher-extension-triton-545dbc59fb   1         1         1       237d
replicaset.apps/rancher-extension-triton-7dfbc4bb6d   0         0         0       237d
replicaset.apps/rancher-extension-triton-9b6bf5b4     0         0         0       237d
replicaset.apps/ui-plugin-operator-7d6f75cc           1         1         1       279d
Could that be causing problems with doing a developer load on a new version of the same extension? Do we need to manually delete the triton resources above?
Also, I didn't find any useful logs from
kubectl -n cattle-ui-plugin-system logs deploy/ui-plugin-operator
,
kubectl -n cattle-ui-plugin-system logs pod/ui-plugin-operator-7d6f75cc-tjhgk
, etc.
Copy code
bash-4.4# kubectl -n cattle-ui-plugin-system logs pod/ui-plugin-operator-7d6f75cc-tjhgk
time="2025-05-28T07:09:48Z" level=info msg="No access to list CRDs, assuming CRDs are pre-created."
I0528 07:09:48.753592       1 leaderelection.go:248] attempting to acquire leader lease cattle-ui-plugin-system/plugin-operator-lock...
I0528 07:09:48.887147       1 leaderelection.go:258] successfully acquired lease cattle-ui-plugin-system/plugin-operator-lock
E0528 07:09:49.308883       1 memcache.go:206] couldn't get resource list for <http://ext.cattle.io/v1|ext.cattle.io/v1>: the server is currently unable to handle the request
E0528 07:09:49.326903       1 memcache.go:104] couldn't get resource list for <http://ext.cattle.io/v1|ext.cattle.io/v1>: the server is currently unable to handle the request
time="2025-05-28T07:09:49Z" level=info msg="All controllers have been started"
time="2025-05-28T07:09:49Z" level=info msg="Starting <http://catalog.cattle.io/v1|catalog.cattle.io/v1>, Kind=UIPlugin controller"
bash-4.4#
image.png
Copy code
bash-4.4# kubectl get apiservices | grep <http://ext.cattle.io|ext.cattle.io>
<http://v1.ext.cattle.io|v1.ext.cattle.io>                  cattle-system/imperative-api-extension   False (MissingEndpoints)   7d20h
b
ah, wait
is this airgapped?
g
Can you remind us what that means?
b
air gapped is a system that doesn’t communicate with the internet. To install extensions is totally different procedure
g
Oh no, this is not airgapped then
👍 1
@cool-jewelry-75805 upgraded Rancher from version 2.8.5 to 2.11.1 about 7 days ago so I'm wondering if that
cattle-system/imperative-api-extension
error above is related
b
Ok, so my area is frontend, so those k8s resources created I don’t know much about, tbh… I got a 2.10.3 Rancher system on which I have a couple of extensions installed and I don’t have any pods, services or replicaSets for those installations. Only a UIPlugin resource per extension
the backend that installs and handles extension might have evolved a lot from that point it time
g
I originally developed the extension and installed it on version 2.8.5, so I'm wondering if we need to manually delete all these triton related resources under the
cattle-ui-plugin-system
namespace since the uninstall through the UI didn't remove them
b
I would say nuke them…. but take this with a huge grain of salt since it’s not my expertise the actual k8s part
It’s on you 😛
😂 1
g
There's not much risk for us since we don't have any prod systems on here yet so we'll try that
b
go for it then
g
Would you be able to show us
kubectl get apiservices | grep <http://ext.cattle.io|ext.cattle.io>
on your rancher instance?
b
sure
g
Wondering if we need to do something to address that as well
b
I got nothing (no output) . My 2.10.3 is quite recent (a couple of weeks) and used only for dev purposes so I barely have new stuff installed, except extensions
<https://github.com/rancher/elemental-ui>
branch
gh-pages
add this repo to Rancher as an example of a working, triple checked extension (Elemental), version
3.x.x
needs to install fine.
let me know if it solved your issues
c
Sorry for the delay. Got the Elemental extension installed without issue so I’m going to clear out the old resources and try again.
👍 1
g
@busy-ability-54059 When @cool-jewelry-75805 installed the elemental extension we noticed that
kubectl -n cattle-ui-plugin-system get all
didn't show any resources for that extension like it does for our triton extension. I'm wondering if that's because of a change in the backend extension handling or if it's because the extensions are published differently. We use the Manually Publishing an Extension Catalog Image method.
b
ah, that explains all the resources you had! If Rancher isn’t air-gapped, then you should be publishing a helm chart and adding that repo. You should definitely be using the automatic approach for this: https://extensions.rancher.io/extensions/next/publishing#automatic-approach---triggering-a-github-workflow-on-tagged-release Elemental has this github worflow, like the documentation above, then I release it by creating a tag on the repo. By default it publishes to
gh-pages
. You should enable that
g
Ok we’ll try out that method once the testing succeeds but the developer load is still not working even after deleting those resources.
b
Is there a repo that you could DM me so I can check the code?
c
This is our extension that was developed for Rancher v2.8.3 (IIRC) and before much else I wanted to try using the migration script on this page from the extension documentation.
b
Since 2.10 is going to enter maintenance mode already soon, unless you guys have some specific users on Rancher using your extension, you don’t have to worry about 2.8 and 2.9, so depending on this you might not even need to maintain different versions of the extension. But if you had to, here’s the information on how we usually do it: https://extensions.rancher.io/extensions/next/rancher-2.10-support#how-to-maintain-different-extension-versions (I used this for Elemental and with the workflows to automatically build and release the extension to
gh-pages
, you can just do a tag and target the correct branch you want to build. Ofc each branch has a slightly modified version of the workflow https://github.com/rancher/elemental-ui - branches
release-2.8.x
,
release-2.9.x
and
main
)
c
Thank you @busy-ability-54059. I started from a clean slate by reverting any changes I had to the JSON files, deleting
node_modules
and making the changes you had suggested above. At first it didn’t work, and I had thought maybe there was more to do to get it working on Rancher v2.11.1. However, it turns out having
yarn.lock
with it’s previous changes had caused some issues - after
git checkout HEAD yarn.lock
, cleaning up
node_modules
again, I was able to rebuild, serve and successfully Developer Load the extension and see it working.
g
Oh awesome, thanks @busy-ability-54059. So does that mean the migration script was not needed?
Also, if we were to add it to the community catalog, does that make it easier to install the extension?
b
two questions: • migration script was not needed, that’s correct. The syntax used was already compliant with vue3, so no problems there • in the community catalog you’ll only be featured in the list of extensions in the extensions docs page in the
community
part https://extensions.rancher.io/extensions/next/catalog
g
Ok great. So
vCloud Director UI
is the only contributed community extension so far?
b
that’s the only being featured in our docs, from the community
check my DM
👍 1
g
Thanks for all the help on this and in the past when you helped me with issues during the initial development of this extension. We appreciate it!
🫡 1
b
Glad to help 🙏
c
@busy-ability-54059 we’re running into this now. Might you have any suggestions?
b
Even though the build appeared as successful, it failed, hence why the error you saw: https://github.com/vrcis/rancher-extension-triton/actions/runs/15333029235/job/43144110219 This build fail appearing as “successful” on the pipeline is, unfortunately, a know bug but one which has a lot of implications and this is why I haven’t been able to address it properly 😅 Can you clean up the
gh-pages
branch (totally empty) and tag the release again? Let’s see how that goes
👍 1
g
Looks like the
gh-pages
branch has all the same content as the
main
branch so maybe @cool-jewelry-75805 created it from the
main
branch but it's supposed to be empty, right?
b
It should start empty, yes. I don’t know if that’s going to fix it, but at least it’s a starting point because I suspect it’s trying to do some verifications on that
gh-pages
which I think it shouldn’t 😛 maybe starting empty will clear them
g
Ok, Nick will try that out and report back
c
Ah yep, when I created the branch I had it use the main branch as a starting point. I’ll clean that up and try again. Thank you for the info!
Same error unfortunately after recreating
gh-pages
as an empty branch.
Ok got it, it was a problem with how I was running the automation. Instead of recreating the release I was manually starting the action which meant it was using
main
(I may have been able to change it to use the tag but had missed that). After deleting and recreating the release it built successfully.
g
Awesome!
c
@busy-ability-54059 sorry to ping you again, but I’ve run into another issue 😕 I was able to add the
gh-pages
branch as a repository, and our extension shows up as one to install, but after installing and reloading the page it shows
An error occurred loading the code for this Extension
for the extension. Edit: After some time, the error message has now gone away and the extension is working as intended. Weird. Edit 2: now that it’s working, I’ve discovered that the UI icon is showing on the Create Cluster page but not on the extensions page. Did I miss something to have the icon showing in both places?
b
g
That worked, thanks.
👍 1