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

[stable/grafana] datasource provisioning with sidecar should be done trough secrets #13492

Closed
seboudry opened this issue May 3, 2019 · 12 comments · Fixed by #15331
Closed

[stable/grafana] datasource provisioning with sidecar should be done trough secrets #13492

seboudry opened this issue May 3, 2019 · 12 comments · Fixed by #15331

Comments

@seboudry
Copy link

seboudry commented May 3, 2019

We can define sidecar.datasources.enabled to deploy a sidecar that use configmaps with corresponding label for Grafana datasources provisioning.

This datasource configuration may contains sensitive data in secureJsonData field (other sensitive fields are now deprecated) : passwords, private keys, etc...

So, it'll be more secure to store these datasource configuration on Kubernetes using a secret and not a configmap.

@stale
Copy link

stale bot commented Jun 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 2, 2019
@maximbaz
Copy link
Contributor

maximbaz commented Jun 2, 2019

activity!

@stale stale bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 2, 2019
@stale
Copy link

stale bot commented Jul 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 2, 2019
@maximbaz
Copy link
Contributor

maximbaz commented Jul 2, 2019

activity!

@stale stale bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 2, 2019
@fr-ser
Copy link
Contributor

fr-ser commented Jul 2, 2019

I would like to work on this, but the upstream sidecar PR is not being merged...

kiwigrid/k8s-sidecar#32

@fr-ser
Copy link
Contributor

fr-ser commented Jul 8, 2019

Since the sidecar PR has been merged, I could take a stab at adding this feature (should be fairly easy now), if this is in line with the maintainers goals.
I wouldn't want to work on this if it is not something the repo owners want to merge...

@maximbaz
Copy link
Contributor

maximbaz commented Jul 8, 2019

To confirm that there is a desire to merge this, pinging maintainers: @zanhsieh, @rtluckie, @maorfr

@maorfr
Copy link
Member

maorfr commented Jul 8, 2019

yeah go for it!

@kyschouv
Copy link
Contributor

Would this make it possible to have most of the provisioning details in a configmap, but load just the secret values from a secret? Right now we have secrets (api keys, etc.) in Kubernetes secrets, but the rest of our details in configmaps, and it'd be great to be able to have the sidecar merge those automatically (instead of us having to write something to do it).

@fr-ser
Copy link
Contributor

fr-ser commented Jul 12, 2019

That PR (and the sidecar behind it) do not support that.

@bailsman
Copy link

https://github.com/helm/charts/blob/master/stable/grafana/templates/clusterrole.yaml and
https://github.com/helm/charts/blob/master/stable/grafana/templates/role.yaml have the following lines:

{{- if and .Values.rbac.namespaced (or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled) }}
- apiGroups: [""] # "" indicates the core API group
  resources: ["configmaps"]
  verbs: ["get", "watch", "list"]
{{- end }}

With this change, does the role need to include secrets in addition to configmaps?

@fr-ser
Copy link
Contributor

fr-ser commented Jul 22, 2019

Good point. I somehow missed the normal role and only updated the clusterrole

https://github.com/helm/charts/blob/master/stable/grafana/templates/clusterrole.yaml and
https://github.com/helm/charts/blob/master/stable/grafana/templates/role.yaml have the following lines:

{{- if and .Values.rbac.namespaced (or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled) }}
- apiGroups: [""] # "" indicates the core API group
  resources: ["configmaps"]
  verbs: ["get", "watch", "list"]
{{- end }}

With this change, does the role need to include secrets in addition to configmaps?

ThoTischner pushed a commit to bitsbeats/charts that referenced this issue Aug 13, 2019
* [stable/grafana] Allow secrets for sidecar (helm#13492)

Updated the sidecar image to version 0.0.18
This allows also using secrets for volume mounts
This way the dashboard and datasource import can be extended to those
datatypes

Signed-off-by: Sergej Herbert <[email protected]>

* [stable/grafana] Allow secret - review (helm#13492)

- keep the appVersion the same
- bump minor version
- add missing apostrophe

Signed-off-by: Sergej Herbert <[email protected]>

* [stable/grafana] Allow secret - review helm#2 (helm#13492)

- enable sidecar resource secrets and configmaps by default
- update readme to indicate secret preference for datasources

Signed-off-by: Sergej Herbert <[email protected]>
kengou pushed a commit to kengou/charts that referenced this issue Sep 18, 2019
* [stable/grafana] Allow secrets for sidecar (helm#13492)

Updated the sidecar image to version 0.0.18
This allows also using secrets for volume mounts
This way the dashboard and datasource import can be extended to those
datatypes

Signed-off-by: Sergej Herbert <[email protected]>

* [stable/grafana] Allow secret - review (helm#13492)

- keep the appVersion the same
- bump minor version
- add missing apostrophe

Signed-off-by: Sergej Herbert <[email protected]>

* [stable/grafana] Allow secret - review #2 (helm#13492)

- enable sidecar resource secrets and configmaps by default
- update readme to indicate secret preference for datasources

Signed-off-by: Sergej Herbert <[email protected]>
ramkumarvs pushed a commit to yugabyte/charts-helm-fork that referenced this issue Sep 30, 2019
* [stable/grafana] Allow secrets for sidecar (helm#13492)

Updated the sidecar image to version 0.0.18
This allows also using secrets for volume mounts
This way the dashboard and datasource import can be extended to those
datatypes

Signed-off-by: Sergej Herbert <[email protected]>

* [stable/grafana] Allow secret - review (helm#13492)

- keep the appVersion the same
- bump minor version
- add missing apostrophe

Signed-off-by: Sergej Herbert <[email protected]>

* [stable/grafana] Allow secret - review #2 (helm#13492)

- enable sidecar resource secrets and configmaps by default
- update readme to indicate secret preference for datasources

Signed-off-by: Sergej Herbert <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants