This example contains a basic custom extension that queries all deployments of a selected namespace of your cluster. Additionally, it retrieves the current weather data for Munich, Germany, from an external weather API.
To set up and deploy your own custom Busola extension, follow these steps.
- Enable custom extensions in your cluster:
kubectl apply -f busola-config.yaml
- Adjust the static HTML content.
Edit the ui.html
file to define the static HTML content for your custom extension.
- Configure dynamic components.
Set up dynamic or behavioral components by modifying the custom element defined in the script.js
file.
-
Accessing Kubernetes resources: Use the
fetchWrapper
function to interact with cluster resources through the Kubernetes API. -
Making external API requests: Use the
proxyFetch
function to handle requests to external APIs that are subject to CORS regulations.
- Define extension metadata
Update the general.yaml
file to define metadata for your custom extension.
[! WARNING] Ensure that the
general.customElement
property matches the name of the custom element defined inscript.js
. The script is loaded only once, and this property is used to determine whether the custom element is already defined.
- Deploy your extension
Before running the deployment command, ensure that your kubeconfig
is correctly exported and points to the desired cluster. You can check the current context by running:
kubectl config current-context
Run ./deploy-custom-extension.sh
to create a ConfigMap and deploy it to your cluster
Alternatively, you can use the following command:
kubectl kustomize . | kubectl apply -n kyma-system -f -
Run npm start
to start the development server.