main.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. # https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html/monitoring/configuring-user-workload-monitoring
  27. #
  28. # TODO: Wait for components to start up?
  29. # app.kubernetes.io/component=controller (prometheus operator)
  30. # app.kubernetes.io/component=prometheus (prometheus pods)
  31. # app.kubernetes.io/name=thanos-ruler (thanos pods)
  32. # alertmanager=user-workload (alertmanager pods)
  33. #
  34. - name: Ensure that the main configmap is defined.
  35. kubernetes.core.k8s:
  36. kubeconfig: tmp/kubeconfig-ocp4
  37. validate_certs: no
  38. api_version: v1
  39. kind: configmap
  40. namespace: openshift-monitoring
  41. name: cluster-monitoring-config
  42. resource_definition:
  43. data:
  44. config.yaml: |
  45. enableUserWorkload: true
  46. alertmanagerMain:
  47. enableUserAlertmanagerConfig: true
  48. - name: Ensure that the uwm alertmanager configmap is defined.
  49. kubernetes.core.k8s:
  50. kubeconfig: tmp/kubeconfig-ocp4
  51. validate_certs: no
  52. api_version: v1
  53. kind: configmap
  54. namespace: openshift-user-workload-monitoring
  55. name: user-workload-monitoring-config
  56. resource_definition:
  57. data:
  58. config.yaml: |
  59. alertmanager:
  60. enabled: true
  61. enableAlertmanagerConfig: true
  62. ...