Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ansible/roles/mno-post-cluster-install/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ gitops_channel: stable
migrate_ingresscontrollers: false
migrate_monitoring: false

# Apply the cluster-monitoring-config that uses the localstorage class name created either
# by controlplane_localstorage_configuration or worker_localstorage_configuration
apply_cluster_monitoring_config: false

# Set the rention period for prometheus to allow up to 15 days of data by default
prometheus_retention_period: 15d

Expand Down
10 changes: 3 additions & 7 deletions ansible/roles/mno-post-cluster-install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
block:
- name: Label the control-plane nodes
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc label no --overwrite {{ item }} localstorage=true prometheus=true
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc label no --overwrite {{ item }} localstorage=true
with_items: "{{ groups['controlplane'] }}"

- name: Install local-storage operator
Expand All @@ -149,16 +149,12 @@
delay: 2
when: localvolume2_configuration

- name: Configure OpenShift-Monitoring Prometheus to use localstorage
shell:
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc apply -f {{ bastion_cluster_config_dir }}/openshift-monitoring/cluster-monitoring-config.yml

- name: Setup worker nodes localstorage
when: worker_localstorage_configuration
block:
- name: Label the worker nodes
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc label no --overwrite {{ item }} localstorage=true prometheus=true
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc label no --overwrite {{ item }} localstorage=true
with_items: "{{ groups['worker'] }}"

- name: Install local-storage operator
Expand Down Expand Up @@ -194,7 +190,7 @@
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc patch ingresscontrollers/default --type merge -n openshift-ingress-operator -p '{"spec": {"nodePlacement": {"nodeSelector": {"matchLabels": {"node-role.kubernetes.io/master": "" }}, "tolerations": [{"effect": "NoSchedule", "key": "node-role.kubernetes.io/master"}]} }}'

- name: Apply OpenShift-Monitoring configuration options
when: migrate_monitoring or worker_localstorage_configuration
when: migrate_monitoring or (apply_cluster_monitoring_config and (controlplane_localstorage_configuration or worker_localstorage_configuration))
shell:
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc apply -f {{ bastion_cluster_config_dir }}/openshift-monitoring/cluster-monitoring-config.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,7 @@ data:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
{% else %}
prometheusOperator:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
prometheusK8s:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
retention: {{ prometheus_retention_period }}
volumeClaimTemplate:
metadata:
Expand All @@ -76,40 +65,4 @@ data:
resources:
requests:
storage: 50Gi
alertmanagerMain:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
kubeStateMetrics:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
openshiftStateMetrics:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
telemeterClient:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
k8sPrometheusAdapter:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
thanosQuerier:
nodeSelector:
prometheus: "true"
tolerations:
- effect: NoSchedule
key: "node-role.kubernetes.io/master"
{% endif %}