main.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. # Ensures user workload monitoring is enabled.
  3. #
  4. # XXX: Only needed for the TODO items below.
  5. #- name: Load the main configmap if it is there already.
  6. # kubernetes.core.k8s_info:
  7. # kubeconfig: tmp/kubeconfig-ocp4
  8. # validate_certs: no
  9. # api_version: v1
  10. # kind: configmap
  11. # namespace: openshift-monitoring
  12. # name: cluster-monitoring-config
  13. # register: cmc_is_there
  14. #
  15. # TODO
  16. #- name: Extract the contents of config.yaml from cm if it existed.
  17. #
  18. # TODO
  19. #- name: Merge the existing config.yaml and our additions.
  20. #
  21. # TODO: do the same for uwm-alertmanager
  22. #
  23. # TODO: might want to add alert-routing-edit rolebinding to create-ichp-project/templates/project-template.yml
  24. #
  25. # XXX: Exclude projects by adding "openshift.io/user-monitoring=false" label.
  26. #
  27. # TODO: Wait for components to start up?
  28. # app.kubernetes.io/component=controller (prometheus operator)
  29. # app.kubernetes.io/component=prometheus (prometheus pods)
  30. # app.kubernetes.io/name=thanos-ruler (thanos pods)
  31. # alertmanager=user-workload (alertmanager pods)
  32. #
  33. - name: Ensure that the main configmap is defined.
  34. kubernetes.core.k8s:
  35. kubeconfig: tmp/kubeconfig-ocp4
  36. validate_certs: no
  37. api_version: v1
  38. kind: configmap
  39. namespace: openshift-monitoring
  40. name: cluster-monitoring-config
  41. resource_definition:
  42. data:
  43. config.yaml: |
  44. enableUserWorkload: true
  45. alertmanagerMain:
  46. enableUserAlertmanagerConfig: true
  47. - name: Ensure that the uwm alertmanager configmap is defined.
  48. kubernetes.core.k8s:
  49. kubeconfig: tmp/kubeconfig-ocp4
  50. validate_certs: no
  51. api_version: v1
  52. kind: configmap
  53. namespace: openshift-user-workload-monitoring
  54. name: user-workload-monitoring-config
  55. resource_definition:
  56. data:
  57. config.yaml: |
  58. alertmanager:
  59. enabled: true
  60. enableAlertmanagerConfig: true
  61. ...