Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
added deploying metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
christianh814 committed Nov 7, 2017
1 parent ddcb964 commit 5452af9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Standalone Labs
* [Installing and Using Cockpit](installing_and_using_cockpit.md)
* [Deploying Cockpit as a container](deploying_cockpit_as_a_container.md)
* [Creating Persistent Volume](creating_persistent_volume.md)
* [Deploying Metrics](deploying_metrics.md)

## Extended Lab Exercises

Expand Down
49 changes: 38 additions & 11 deletions deploying_metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ In this lab you will learn how to deploy metrics. Deployment of metrics need a b

## Step 1

Metrics needs a backend storage for the database. You'll need a `pvc` before you proceed.
Switch to the `openshift-infra` project

```
oc project openshift-infra
```

Metrics needs a backend storage for the database. You'll need a `pvc` before you proceed. Below is an example using [cns](cns.md) as the backend storage (your `pvc` might differ).

Below is an example using [cns](cns.md) as the backend storage (your `pvc` might differ).
```yaml
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -29,26 +34,48 @@ $ oc create -f metrics-storage-pvc.yaml
persistentvolumeclaim "metrics-storage" created
```

Wait for it to go from "Pending" to "
Wait for it to go from "Pending" to "Bound"
```
$ oc get pvc
NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE
metrics-storage Pending gluster-block 7s
$ oc get pvc
NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE
metrics-storage Bound pvc-5ea4435f-c410-11e7-8f74-029fe14a0ff8 20Gi RWO gluster-block 3s
```

## Step 2

Using the ansible playbook provided by OpenShift, deploy the metrics stack and make you change these options to what makes sense to you.
Using the ansible playbook provided by OpenShift, deploy the metrics stack and make you change these options to what makes sense to you. Take note of the options `openshift_metrics_cassandra_storage_type` and `openshift_metrics_cassandra_pvc_size`. The size must match the claim you had above.

```
ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/openshift-metrics.yml \
-e openshift_metrics_install_metrics=True \
-e openshift_metrics_hawkular_hostname=hawkular.apps.example.com \
-e openshift_metrics_cassandra_storage_type=dynamic \
-e openshift_metrics_cassandra_pvc_size=25Gi
-e openshift_metrics_cassandra_storage_type=pv \
-e openshift_metrics_cassandra_pvc_size=20Gi
```

This will take a while.

## Step X
There is a known issue where you'll have two `pvc`'s show up. Overwrite the the `rc` with the right value.
```
oc volume rc/hawkular-cassandra-1 --add --overwrite --name=cassandra-data -t pvc --claim-name=metrics-storage
```

## Step X
And delete the other `pvc`
```
$ oc delete pvc metrics-cassandra-1
persistentvolumeclaim "metrics-cassandra-1" deleted
```

## Conclusion

In this lab you learned how to ...
In this lab you learned how to set up metrics with a backend storage. You should now have metrics collection running.

```
$ oc get pods
NAME READY STATUS RESTARTS AGE
hawkular-cassandra-1-08jnc 1/1 Running 0 2m
hawkular-metrics-19vs0 1/1 Running 0 7m
heapster-90862 1/1 Running 0 7m
```

0 comments on commit 5452af9

Please sign in to comment.