Change UI theme through helm charts - k8s

Hi, I am new to Grafana and has been assigned a task, I am trying to change the theme of grafana, by default there are only 3 themes available ( default, light, dark ) , I am trying to figure out what changes can I make in the helm chart so that i can add 2 more colors into the theme, what I can see from the the prometheus.json file are these values :

“cacheTimeout”: null,

  "colorBackground": false,

  "colorValue": true,

  "colors": [

    "rgba(50, 172, 45, 0.97)",

    "rgba(237, 129, 40, 0.89)",

    "rgba(245, 54, 54, 0.9)"

what else should i check and how should i add 2 more new colors into the background when selecting Ui theme from Preferences in the admin console of grafana.

Thanks…shappy

Hello @aqeelahmednz, welcome to the world of absolutely nonsensual developers and their crazy, half-done ideas…

Id highly advise you to leave Grafana aside and forget. Why? Developers (Team) lives in Matrix; their software is buggy as hell and the deeper you will dive in, the more you gonna realize how Im true. And the more crital you get, the more restrictions @torkel and his “friends” from dev-team will impose on your account.
Just to see for yourself what Im talking about: I advice you read my topics. And decide what you gonna do…either stay and become more & more frustrated, or leave and enjoy life…

Hi Dev11,

Thanks for it, can you please review my query and let me know what should i do to resolve it.

Cheers

shappy

sure I can :slight_smile:
please allow me some time. Will report back.

awesome… thank you so much

AFAIK its not so easy thing to add custom styling. Grafana uses SASS instead of CSS (I know, I know, SASS compiles to CSS), but there is no support for static CSS within Grafana…

Your code looks OK, but is useless in Grafana… Rewrite it in SASS and than place your file in /public/sass subdir. Everything in this folder gets compiled at buildtime of Grafana and is parsed again on every Grafana job is started (either manually by you or automatically (by cron for instance).

I found two things for this: this and this (also linked from the first one)

Hope this helps :slight_smile:

Hi dev11,

that would be helpful, but normally using K8s which uses Helm charts by default uses 3 themes, what if i can send you the config file where these configurations are stored in json, would that help.

Cheers

Hello,

Im affraid Im not exactly following your way of thinking… what would I be supposed to do with your config file(s)?

After some research I found special plugin that may be of interest to you. It allows to apply custom styling.

I have NOT tested it so be careful

where I can find this sub- dir /public/sass , we are using K8s and had deployed grafana using helm charts ? still a bit confusion what to do next :)…

OK not to worry …

Could you please tell me whats OS (Win/Linux/BSD) Grafana runs on?

OS Image: Ubuntu 16.04.6 LTS
Operating System: linux
Architecture: amd64
Container Runtime Version: docker://3.0.8
Kubelet Version: v1.14.8
Kube-Proxy Version: v1.14.8

OK @aqeelahmednz Ive done it on my test install and it worked. :slight_smile: stay tuned for detailed description

awesome … :slight_smile: :)… thnx

  1. Login to your instance via SSH (as root or other superuser)
  2. wget https://github.com/yesoreyeram/yesoreyeram-boomtheme-panel/archive/master.zip && unzip master.zip
  3. Copy whole unzipped folder to /var/lib/grafana/plugins (or wherever is your Grafana (subfolder plugins is crucial here)
  4. (since you are on Ubuntu) /etc/init.d/grafana-server restart
  5. Close SSH session, open your browser, point to Grafana, login, go to Configuration > Plugins, find Boom Theme and read whats written there…

Thats it

awesome , but one query ,normaly in the k8s environment, if the pod get restarted which then comes up with a new configuration , means the above plugin will be deleted :(…and then I again have to reconfigure and SSH into the pod…

and the pod uses alpine linux , normally doesnt recognize wget and some other basic commands :frowning:

Excuse me my stupid question, but arent pods consistent between restarts/reloads? Ive never worked in/with K8 so have no idea?

In the case of pod nopt recognizing some commands, I will be of no help, sorry, have no knowledge

not a stupid question mate, its a valid question , the pods are not consistent , so most of the time they restarted or even if get deleted ( come up with a new config ) …

Is there somewhere an option to make them consistent?