Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Grafana helm chart pod failing #4267

Closed
gabeduke opened this issue Mar 19, 2018 · 6 comments
Closed

Grafana helm chart pod failing #4267

gabeduke opened this issue Mar 19, 2018 · 6 comments

Comments

@gabeduke
Copy link

gabeduke commented Mar 19, 2018

Is this a BUG REPORT or FEATURE REQUEST?: Bug Report

Version of Helm and Kubernetes:
Helm version: 2.8.2
Kuernetes Version: 1.9.4

Which chart: stable/grafana

What happened: grafana pod fails to start with the following error.This was previously working, and discussion in the rook.io slack with @galexrt turned up that this may be related to a recent security patch in kubernetes.

chown: changing ownership of '/var/lib/grafana/dashboards/..data': Read-only file system
chown: changing ownership of '/var/lib/grafana/dashboards': Read-only file system

How to reproduce: Install the helm chart with default configurations on a node running 1.9.4

@svmaris
Copy link
Contributor

svmaris commented Mar 19, 2018

I've submitted a PR with the same strategy I used with the rabbitmq-ha chart.

It still feels a little clunky to do this, but unless containers stop writing to their configdirs or Kubernetes allows writing to ConfigMaps again (or adds some primitives to do what I did in this PR automatically), I don't see any other way.

@Yitaek
Copy link
Contributor

Yitaek commented Mar 20, 2018

For a temporary workaround, you can add the following command for the docker container in the deployment.yaml (taken from the init script)

command: ["/bin/bash", "-c", "chmod 777 /var/lib/grafana/ && gosu grafana /usr/sbin/grafana-server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini cfg:default.paths.provisioning=/etc/grafana/provisioning cfg:default.log.mode=console cfg:default.paths.data=/var/lib/grafana/ cfg:default.paths.logs=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins"]

@svmaris
Copy link
Contributor

svmaris commented Mar 21, 2018

Related: grafana/grafana-docker#141

@csabakollar
Copy link

but looks like the fix is on its way:
https://github.com/grafana/grafana-docker/blob/master/run.sh#L9

@csabakollar
Copy link

csabakollar commented Mar 21, 2018

alternative workaround:

in server object:

  extraEnv:
  - name: GF_PATHS_CONFIG
    value: /etc/grafana-cm/grafana.ini
  
  configLocalPath: /etc/grafana-cm
  dashboardLocalPath: /var/lib/grafana-dashboards

and modify grafana.ini cm:

    [dashboards.json]
    enabled = true
    path = /var/lib/grafana-dashboards

edit: i hate md

@mikesplain
Copy link
Contributor

Thanks @csabakollar and all for the tips. I've been banging my head with this for a few hours. I was able to just switch my image to grafana/grafana:master for now to solve the issue.

k8s-ci-robot pushed a commit that referenced this issue Mar 29, 2018
…figMap to an EmptyDir (#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to #4169. Fixes #4267.

* bump Chart version
rolanddb pushed a commit to Eneco/charts that referenced this issue Apr 9, 2018
…figMap to an EmptyDir (helm#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to helm#4169. Fixes helm#4267.

* bump Chart version
ichtar pushed a commit to Bestmile/charts that referenced this issue May 15, 2018
…figMap to an EmptyDir (helm#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to helm#4169. Fixes helm#4267.

* bump Chart version
voron pushed a commit to dysnix/helm-charts that referenced this issue Sep 5, 2018
…figMap to an EmptyDir (helm#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to helm#4169. Fixes helm#4267.

* bump Chart version

Signed-off-by: voron <av@arilot.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants