Explorar el Código

Remove all references to prometheus storage via NFS

It's not supported storage backend.
Scott Dodson hace 7 años
padre
commit
0af51e9edc

+ 9 - 70
inventory/hosts.example

@@ -685,76 +685,15 @@ debug_level=2
 #openshift_hosted_prometheus_deploy=true
 #
 # Prometheus storage config
-# Option A - NFS Host Group
-# An NFS volume will be created with path "nfs_directory/volume_name"
-# on the host within the [nfs] host group.  For example, the volume
-# path using these options would be "/exports/prometheus"
-#openshift_prometheus_storage_kind=nfs
-#openshift_prometheus_storage_access_modes=['ReadWriteOnce']
-#openshift_prometheus_storage_nfs_directory=/exports
-#openshift_prometheus_storage_nfs_options='*(rw,root_squash)'
-#openshift_prometheus_storage_volume_name=prometheus
-#openshift_prometheus_storage_volume_size=10Gi
-#openshift_prometheus_storage_labels={'storage': 'prometheus'}
-#openshift_prometheus_storage_type='pvc'
-#openshift_prometheus_storage_class=glusterfs-storage
-# For prometheus-alertmanager
-#openshift_prometheus_alertmanager_storage_kind=nfs
-#openshift_prometheus_alertmanager_storage_access_modes=['ReadWriteOnce']
-#openshift_prometheus_alertmanager_storage_nfs_directory=/exports
-#openshift_prometheus_alertmanager_storage_nfs_options='*(rw,root_squash)'
-#openshift_prometheus_alertmanager_storage_volume_name=prometheus-alertmanager
-#openshift_prometheus_alertmanager_storage_volume_size=10Gi
-#openshift_prometheus_alertmanager_storage_labels={'storage': 'prometheus-alertmanager'}
-#openshift_prometheus_alertmanager_storage_type='pvc'
-#openshift_prometheus_alertmanager_storage_class=glusterfs-storage
-# For prometheus-alertbuffer
-#openshift_prometheus_alertbuffer_storage_kind=nfs
-#openshift_prometheus_alertbuffer_storage_access_modes=['ReadWriteOnce']
-#openshift_prometheus_alertbuffer_storage_nfs_directory=/exports
-#openshift_prometheus_alertbuffer_storage_nfs_options='*(rw,root_squash)'
-#openshift_prometheus_alertbuffer_storage_volume_name=prometheus-alertbuffer
-#openshift_prometheus_alertbuffer_storage_volume_size=10Gi
-#openshift_prometheus_alertbuffer_storage_labels={'storage': 'prometheus-alertbuffer'}
-#openshift_prometheus_alertbuffer_storage_type='pvc'
-#openshift_prometheus_alertbuffer_storage_class=glusterfs-storage
-#
-# Option B - External NFS Host
-# NFS volume must already exist with path "nfs_directory/_volume_name" on
-# the storage_host. For example, the remote volume path using these
-# options would be "nfs.example.com:/exports/prometheus"
-#openshift_prometheus_storage_kind=nfs
-#openshift_prometheus_storage_access_modes=['ReadWriteOnce']
-#openshift_prometheus_storage_host=nfs.example.com
-#openshift_prometheus_storage_nfs_directory=/exports
-#openshift_prometheus_storage_volume_name=prometheus
-#openshift_prometheus_storage_volume_size=10Gi
-#openshift_prometheus_storage_labels={'storage': 'prometheus'}
-#openshift_prometheus_storage_type='pvc'
-#openshift_prometheus_storage_class=glusterfs-storage
-# For prometheus-alertmanager
-#openshift_prometheus_alertmanager_storage_kind=nfs
-#openshift_prometheus_alertmanager_storage_access_modes=['ReadWriteOnce']
-#openshift_prometheus_alertmanager_storage_host=nfs.example.com
-#openshift_prometheus_alertmanager_storage_nfs_directory=/exports
-#openshift_prometheus_alertmanager_storage_volume_name=prometheus-alertmanager
-#openshift_prometheus_alertmanager_storage_volume_size=10Gi
-#openshift_prometheus_alertmanager_storage_labels={'storage': 'prometheus-alertmanager'}
-#openshift_prometheus_alertmanager_storage_type='pvc'
-#openshift_prometheus_alertmanager_storage_class=glusterfs-storage
-# For prometheus-alertbuffer
-#openshift_prometheus_alertbuffer_storage_kind=nfs
-#openshift_prometheus_alertbuffer_storage_access_modes=['ReadWriteOnce']
-#openshift_prometheus_alertbuffer_storage_host=nfs.example.com
-#openshift_prometheus_alertbuffer_storage_nfs_directory=/exports
-#openshift_prometheus_alertbuffer_storage_volume_name=prometheus-alertbuffer
-#openshift_prometheus_alertbuffer_storage_volume_size=10Gi
-#openshift_prometheus_alertbuffer_storage_labels={'storage': 'prometheus-alertbuffer'}
-#openshift_prometheus_alertbuffer_storage_type='pvc'
-#openshift_prometheus_alertbuffer_storage_class=glusterfs-storage
-#
-# Option C - none -- Prometheus, alertmanager and alertbuffer will use emptydir volumes
-# which are destroyed when pods are deleted
+# By default prometheus uses emptydir storage, if you want to persist you should
+# configure it to use pvc storage type. Each volume must be ReadWriteOnce.
+#openshift_prometheus_storage_type=emptydir
+#openshift_prometheus_alertmanager_storage_type=emptydir
+#openshift_prometheus_alertbuffer_storage_type=emptydir
+# Use PVCs for persistence
+#openshift_prometheus_storage_type=pvc
+#openshift_prometheus_alertmanager_storage_type=pvc
+#openshift_prometheus_alertbuffer_storage_type=pvc
 
 # Configure the multi-tenant SDN plugin (default is 'redhat/openshift-ovs-subnet')
 # os_sdn_network_plugin_name='redhat/openshift-ovs-multitenant'

+ 1 - 4
roles/lib_utils/action_plugins/generate_pv_pvcs_list.py

@@ -148,10 +148,7 @@ class ActionModule(ActionBase):
                          'openshift_hosted_etcd_storage',
                          'openshift_logging_storage',
                          'openshift_loggingops_storage',
-                         'openshift_metrics_storage',
-                         'openshift_prometheus_storage',
-                         'openshift_prometheus_alertmanager_storage',
-                         'openshift_prometheus_alertbuffer_storage']
+                         'openshift_metrics_storage']
         persistent_volumes = []
         persistent_volume_claims = []
         for varname in vars_to_check:

+ 0 - 6
roles/openshift_facts/defaults/main.yml

@@ -70,8 +70,6 @@ openshift_metrics_storage_access_modes:
 
 openshift_prometheus_storage_volume_name: 'prometheus'
 openshift_prometheus_storage_volume_size: '10Gi'
-openshift_prometheus_storage_nfs_directory: '/exports'
-openshift_prometheus_storage_nfs_options: '*(rw,root_squash)'
 openshift_prometheus_storage_access_modes:
   - 'ReadWriteOnce'
 openshift_prometheus_storage_create_pv: True
@@ -79,8 +77,6 @@ openshift_prometheus_storage_create_pvc: False
 
 openshift_prometheus_alertmanager_storage_volume_name: 'prometheus-alertmanager'
 openshift_prometheus_alertmanager_storage_volume_size: '10Gi'
-openshift_prometheus_alertmanager_storage_nfs_directory: '/exports'
-openshift_prometheus_alertmanager_storage_nfs_options: '*(rw,root_squash)'
 openshift_prometheus_alertmanager_storage_access_modes:
   - 'ReadWriteOnce'
 openshift_prometheus_alertmanager_storage_create_pv: True
@@ -88,8 +84,6 @@ openshift_prometheus_alertmanager_storage_create_pvc: False
 
 openshift_prometheus_alertbuffer_storage_volume_name: 'prometheus-alertbuffer'
 openshift_prometheus_alertbuffer_storage_volume_size: '10Gi'
-openshift_prometheus_alertbuffer_storage_nfs_directory: '/exports'
-openshift_prometheus_alertbuffer_storage_nfs_options: '*(rw,root_squash)'
 openshift_prometheus_alertbuffer_storage_access_modes:
   - 'ReadWriteOnce'
 openshift_prometheus_alertbuffer_storage_create_pv: True

+ 0 - 20
roles/openshift_prometheus/README.md

@@ -52,26 +52,6 @@ openshift_prometheus_alertbuffer_pvc_size: 10G
 openshift_prometheus_pvc_access_modes: [ReadWriteOnce]
 ```
 
-## NFS PV Storage variables
-Each prometheus component (prometheus, alertmanager, alertbuffer) can set nfs pv by setting corresponding variable:
-```
-openshift_prometheus_<COMPONENT>_storage_kind=<VALUE>
-openshift_prometheus_<COMPONENT>_storage_(access_modes|host|labels)=<VALUE>
-openshift_prometheus_<COMPONENT>_storage_volume_(name|size)=<VALUE>
-openshift_prometheus_<COMPONENT>_storage_nfs_(directory|options)=<VALUE>
-```
-e.g
-```
-openshift_prometheus_storage_kind=nfs
-openshift_prometheus_storage_access_modes=['ReadWriteOnce']
-openshift_prometheus_storage_host=nfs.example.com #for external host
-openshift_prometheus_storage_nfs_directory=/exports
-openshift_prometheus_storage_alertmanager_nfs_options='*(rw,root_squash)'
-openshift_prometheus_storage_volume_name=prometheus
-openshift_prometheus_storage_alertbuffer_volume_size=10Gi
-openshift_prometheus_storage_labels={'storage': 'prometheus'}
-```
-
 NOTE: Setting `openshift_prometheus_<COMPONENT>_storage_labels` overrides `openshift_prometheus_<COMPONENT>_pvc_pv_selector`
 
 

+ 0 - 3
roles/openshift_storage_nfs/tasks/main.yml

@@ -36,9 +36,6 @@
     - "{{ openshift_logging_storage_nfs_directory }}/{{ openshift_logging_storage_volume_name }}"
     - "{{ openshift_loggingops_storage_nfs_directory }}/{{ openshift_loggingops_storage_volume_name }}"
     - "{{ openshift_hosted_etcd_storage_nfs_directory }}/{{ openshift_hosted_etcd_storage_volume_name }}"
-    - "{{ openshift_prometheus_storage_nfs_directory }}/{{ openshift_prometheus_storage_volume_name }}"
-    - "{{ openshift_prometheus_alertmanager_storage_nfs_directory }}/{{ openshift_prometheus_alertmanager_storage_volume_name }}"
-    - "{{ openshift_prometheus_alertbuffer_storage_nfs_directory }}/{{ openshift_prometheus_alertbuffer_storage_volume_name }}"
 
 - name: Configure exports
   template:

+ 0 - 3
roles/openshift_storage_nfs/templates/exports.j2

@@ -3,6 +3,3 @@
 "{{ openshift_logging_storage_nfs_directory }}/{{ openshift_logging_storage_volume_name }}" {{ openshift_logging_storage_nfs_options }}
 "{{ openshift_loggingops_storage_nfs_directory }}/{{ openshift_loggingops_storage_volume_name }}" {{ openshift_loggingops_storage_nfs_options }}
 "{{ openshift_hosted_etcd_storage_nfs_directory }}/{{ openshift_hosted_etcd_storage_volume_name }}" {{ openshift_hosted_etcd_storage_nfs_options }}
-"{{ openshift_prometheus_storage_nfs_directory }}/{{ openshift_prometheus_storage_volume_name }}" {{ openshift_prometheus_storage_nfs_options }}
-"{{ openshift_prometheus_alertmanager_storage_nfs_directory }}/{{ openshift_prometheus_alertmanager_storage_volume_name }}" {{ openshift_prometheus_alertmanager_storage_nfs_options }}
-"{{ openshift_prometheus_alertbuffer_storage_nfs_directory }}/{{ openshift_prometheus_alertbuffer_storage_volume_name }}" {{ openshift_prometheus_alertbuffer_storage_nfs_options }}