Research repository, see the origin page for official example
- https://github.com/openshift/openshift-ansible/tree/master/roles/openshift_grafana
- https://github.com/openshift/origin/tree/master/examples/grafana
- openshift cluster metrics
- node exporter metrics
Note: make sure to have openshift prometheus deployed. (https://github.com/openshift/origin/tree/master/examples/prometheus)
./setup-grafana.sh -n prometheus -a -e
when you being asked to type username \ password, type 'grafana' and login with the same cerdentials
Note: when using oauth make sure your user has permission to browse grafana.
- add a openshift user htpasswd
htpasswd -c /etc/origin/master/htpasswd gfadmin
- use the HTPasswdPasswordIdentityProvider as described here - https://docs.openshift.com/enterprise/3.0/admin_guide/configuring_authentication.html
- make sure point the provider file to /etc/origin/master/htpasswd.
or using this example cmd:
sed -ie 's|AllowAllPasswordIdentityProvider|HTPasswdPasswordIdentityProvider\n file: /etc/origin/master/htpasswd|' /etc/origin/master/master-config.yaml
- add view role to user
oc adm policy add-cluster-role-to-user cluster-reader gfadmin
- restart master api
systemctl restart atomic-openshift-master-api.service
- get the grafana url by
oc get route
- discover your openshift dashboard.
(https://github.com/openshift/origin/tree/master/examples/prometheus)
oc create project grafana
oc new-app -f grafana-ocp.yaml
oc expose svc grafana-ocp
- grab the grafana url
oc get route |awk 'NR==2 {print $2}'
- grab the ocp token, from openshift master run:
oc sa get-token management-admin -n management-infra
- browse to grafana via browser and add new prometheus DS to grafana.
- paste the token string at the token field.
- checkout the TLS checkbox.
- save & test and make sure all green.
docker pull docker.io/mrsiano/openshift-grafana
docker run -d -ti -p 3000:3000 mrsiano/openshift-grafana "./bin/grafana-server"
docker build -t grafana-ocp .
docker run -d -ti -p 3000:3000 grafana-ocp "./bin/grafana-server"
- example video https://youtu.be/srCApR_J3Os
- deploy openshift prometheus https://github.com/openshift/origin/tree/master/examples/prometheus