Skip to content

Instantly share code, notes, and snippets.

@fatherlinux
Created February 3, 2016 23:11
Show Gist options
  • Save fatherlinux/18a57d5ccc530218216c to your computer and use it in GitHub Desktop.
Save fatherlinux/18a57d5ccc530218216c to your computer and use it in GitHub Desktop.
Metrics Mangement
== Deploy and Test Cluster Metrics ==
=== Deploy Cluster Metrics ===
Instructions developed from the [https://docs.openshift.org/latest/install_config/cluster_metrics.html Origin Docs]. First enter the project. Then, create the metrics-deployer service account. Then, add the heapster account permissions. Then, set up secrets.
oc new-project openshift-infra
oc project openshift-infra
oc create -f - <<API
apiVersion: v1
kind: ServiceAccount
metadata:
name: metrics-deployer
secrets:
- name: metrics-deployer
API
oadm policy add-role-to-user edit system:serviceaccount:openshift-infra:metrics-deployer
oadm policy add-cluster-role-to-user cluster-reader system:serviceaccount:openshift-infra:heapster
oc secrets new metrics-deployer nothing=/dev/null
Get the yaml file
cd /root/
git clone https://github.com/fatherlinux/aep.git
Add the following line to /etc/origin/master/master-config.yaml
assetConfig:
...
metricsPublicURL: https://aep-all.dc4.crunchtools.com/hawkular/metrics
Add permission for a user to get metrics
oc policy add-role-to-user cluster-reader fatherlinux
Deploy a Router
From [[Atomic_Enterprise_Platform#Deploy_a_Router|Deploy a Router]] Instructions
Deploy the deployer
oc process -f /root/aep/config/metrics-deployer.yaml | oc create -f -
=== Test ===
First test service in a browser
https://aep-all.dc4.crunchtools.com/hawkular/metrics
Developed from instructions [https://github.com/openshift/origin-metrics/blob/master/docs/hawkular_metrics.adoc here]:
curl -k -H "Authorization: Bearer fgi3aF6vHZuOsxe4voOePpVMKlJXvqqx46HILyUNGl8" -H "Hawkular-tenant: _system" -X GET https://aep-all.dc4.crunchtools.com/hawkular/metrics/metrics | python -m json.tool
=== Cleanup Instructions ===
Developed from instructions [https://github.com/openshift/origin-metrics here]. Delete all items
oc delete all --selector=metrics-infra -n openshift-infra
oc delete secrets --selector=metrics-infra -n openshift-infra
oc delete sa --selector=metrics-infra -n openshift-infra
oc delete templates --selector=metrics-infra -n openshift-infra
oc delete sa metrics-deployer -n openshift-infra
oc delete secret metrics-deployer -n openshift-infra
systemctl restart docker
docker rm `docker ps -qa`
systemctl restart openvswitch.service
oc get pvc
oc delete pvc metrics-cassandra-1
@detiber
Copy link

detiber commented Feb 4, 2016

Staring this so that I get updates for revisions. This is going to save us a ton of time when it comes to the installer work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment