Rancher Extension how-to
Rancher Extensions is a feature introduced in Rancher v2.7.
Create the extension
Follow Getting started:
# creates skeleton
yarn create @rancher/app rancher-extensions-samples
cd rancher-extensions-samples
rm .vscode/settings.json
Look at existing extensions
Run locally
Start a Rancher instance:
docker run --name local_rancher --privileged -d --restart=unless-stopped -p 3001:443 -p 3000:80 rancher/rancher:v2.7-head
docker logs local_rancher 2>&1 | grep "Bootstrap Password:"
Open the local Rancher instance on localhost:3001 in a browser and enabled Extensions from the Configuration sub-menu.
Run a local environment:
yarn install
API=https://localhost:3001 yarn dev
Open the instance in a browser (the link is displayed in previous command output)
Clean-up:
docker stop local_rancher
docker rm local_rancher
Troubleshoot issues
yarn
must be installed, if not run:
npm install -g yarn
By default, yarn install
won't work on recent Node.js version (for exemple in March 2023, expected version if 16, doesn't work Node.JS 19, see releases), in that case run:
yarn install --ignore-engines
# (optional) shows why a package is required
yarn why @achrinza/node-ipc