-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lifecycle to main grafana container #575
Comments
Personally I'm not a fan of this idea, I think it will be a great source of potential issues and I think it will be hard to maintain. If you want to add users declaratively (something I want as well) we should do it through the controller. If you want a workaround a friend of mine have done this workaround: I have remove a bunch of config so it won't work out of the box but I think you will get the idea. apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-extra-config
data:
script.sh: |
# Create screen user and playlist
until curl -vvv -X POST -H "Content-Type: application/json" --data "{\"name\":\"screen\",\"email\":\"screen@example.com\",\"login\":\"screen\",\"password\":\"${GF_SCREEN_PASSWORD}\"}" ${GF_SECURITY_ADMIN_USER}:${GF_SECURITY_ADMIN_PASSWORD}@localhost:3000/api/admin/users
do
echo "retry create screen user"
sleep 2
done
tail -f /dev/null # wait forever
---
apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
name: grafana
spec:
containers:
- name: extra-config
image: curlimages/curl
command: ["/bin/sh", "/tmp/script/script.sh"]
envFrom:
- secretRef:
name: grafana-admin-credentials
- secretRef:
name: grafana-screen-credentials
volumeMounts:
- name: grafana-extra-config
mountPath: /tmp/script
deployment:
extraVolumeMounts:
- name: tmp
mountPath: /tmp
extraVolumes:
- name: tmp
emptyDir: {}
- name: grafana-extra-config
configMap:
name: grafana-extra-config So please create a new issue with what you actually need or +1 one of the existing issues that you might need so we know what to prioritise. |
Hey @aivanov-citc We're going to reject this issue, we don't see this as something crucial to the operator, we are also hesitant to allow commands to be run from within the container in a lifecycle way, but it seems like your issue is closer to #408, in the way you want to manage users with the operator. Please leave your feedback or further suggestions on that issue. |
We use a similar solution. It is inconvenient when creating multiple users. |
Hi.
Please add handlers lifecycle events to the main grafana container.
This will allow us to run commands after grafana starts. For example, add users declaratively, referring to api grafana
The text was updated successfully, but these errors were encountered: