Jeff
Jeff Cloud Systems Architect
1 min read

Uninstall a Grafana Plugin in Kubernetes

Uninstall a Grafana Plugin in Kubernetes

Uninstall a Grafana Plugin in Kubernetes


I just accidentally installed the `grafana-image-renderer` plugin and it blew up in my Kubernetes cluster. There are now errors of an unsupported plugin. The solution is to simply remove the plugin, however, `grafana-cli` is not accessible due to the container failing. Here is a quick and dirty way to remove a Grafana plugin via Kubernetes deployment yaml.

Update the Grafana Deployment

Find the Grafana Deployment

kubectl get deployment -A
grafana
kubectl edit deployment grafana

Edit the Deployment

We are going to override the default command to remove the bad plugin.

Here is my ~/.bash_profile

alias k="kubectl"
## Add the get_secret.sh from the scripts section
alias gs=~/scripts/get_secret.sh

And add this under

spec:
  template:
    spec:
      containers:
      - grafana
        command: ["grafana-cli"]
        args: ["plugins", "remove", "grafana-image-renderer"]

This will uninstall the plugin grafana-image-renderer. Once the plugin is uninstalled, simply remove those lines and save your deployment.