Skip to content

Grafana 8.14.2 init-chown-data restart failure #3699

Open
@Kimi450

Description

@Kimi450

Grafana 8.14.2 init-chown-data fails upon pod restart

After installing the chart, if grafana pod restarts it fails to come up. I suspect it is because the first start chowns the dir and then the subsequent restarts try to chown a dir that they do not own. root tries to change something owned by something else but since only "CHOWN" is provided to the container as the security context and all else is explicitly dropped, it fails to override.

How to reproduce

  1. Install the chart
    helm upgrade -i my-release grafana/grafana --set initChownData.enabled=true --set persistence.enabled=true --wait
    
  2. Once the pod is running, delete it
  3. Observe that it cannot restart because the initcontainer fails with
    19:52:08 dell-e7440 [--0] ~  $ k logs -c init-chown-data my-release-grafana-846948d9f4-vgxm7
    chown: /var/lib/grafana/csv: Permission denied
    chown: /var/lib/grafana/png: Permission denied
    chown: /var/lib/grafana/pdf: Permission denied
    19:52:16 dell-e7440 [--0] ~  $
    

Workaround

chmod 777 the contents of the PV[C] (I tried this with a hostpath PV mount)

or

Delete the drop: {ALL} section from the init container's security context section.

Related issues/links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions