start_metrics.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ---
  2. - command: >
  3. {{openshift_client_binary}}
  4. --config={{mktemp.stdout}}/admin.kubeconfig
  5. get rc
  6. -l metrics-infra=hawkular-cassandra
  7. -o name
  8. -n {{openshift_metrics_project}}
  9. register: metrics_cassandra_rc
  10. changed_when: no
  11. - name: Start Hawkular Cassandra
  12. oc_scale:
  13. kind: rc
  14. name: "{{object.split('/')[1]}}"
  15. kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
  16. namespace: "{{openshift_metrics_project}}"
  17. replicas: 1
  18. with_items: "{{metrics_cassandra_rc.stdout_lines}}"
  19. loop_control:
  20. loop_var: object
  21. when: metrics_cassandra_rc is defined
  22. changed_when: metrics_cassandra_rc | length > 0
  23. - command: >
  24. {{openshift_client_binary}}
  25. --config={{mktemp.stdout}}/admin.kubeconfig
  26. get rc
  27. -l metrics-infra=hawkular-metrics
  28. -o name
  29. -n {{openshift_metrics_project}}
  30. register: metrics_metrics_rc
  31. changed_when: no
  32. - name: Start Hawkular Metrics
  33. oc_scale:
  34. kind: rc
  35. name: "{{object.split('/')[1]}}"
  36. kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
  37. namespace: "{{openshift_metrics_project}}"
  38. replicas: "{{openshift_metrics_hawkular_replicas}}"
  39. with_items: "{{metrics_metrics_rc.stdout_lines}}"
  40. loop_control:
  41. loop_var: object
  42. changed_when: metrics_metrics_rc | length > 0
  43. - command: >
  44. {{openshift_client_binary}}
  45. --config={{mktemp.stdout}}/admin.kubeconfig
  46. get rc
  47. -l metrics-infra=heapster
  48. -o name
  49. -n {{openshift_metrics_project}}
  50. register: metrics_heapster_rc
  51. changed_when: no
  52. - name: Start Heapster
  53. oc_scale:
  54. kind: rc
  55. name: "{{object.split('/')[1]}}"
  56. kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
  57. namespace: "{{openshift_metrics_project}}"
  58. replicas: 1
  59. with_items: "{{metrics_heapster_rc.stdout_lines}}"
  60. loop_control:
  61. loop_var: object