summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-03-07 19:45:36 -0500
committerGitHub <noreply@github.com>2017-03-07 19:45:36 -0500
commit766128bf66cbc45cb2c2539dec0472e7d378a3fb (patch)
tree9a86bc79677e0dddbaa285e912512e32efbbb945
parentd3da4d1817d54b9c3aef9fffa6ad166ec950e830 (diff)
parentab88af6414729556cabf4bde7cbb4ea83b183e3f (diff)
downloadopenshift-766128bf66cbc45cb2c2539dec0472e7d378a3fb.tar.gz
openshift-766128bf66cbc45cb2c2539dec0472e7d378a3fb.tar.bz2
openshift-766128bf66cbc45cb2c2539dec0472e7d378a3fb.tar.xz
openshift-766128bf66cbc45cb2c2539dec0472e7d378a3fb.zip
Merge pull request #3558 from ewolinetz/logging_metrics_defaults
Adding some more logging and metrics defaults
-rw-r--r--roles/openshift_logging/defaults/main.yml29
-rw-r--r--roles/openshift_logging/filter_plugins/openshift_logging.py8
-rw-r--r--roles/openshift_logging/tasks/generate_pvcs.yaml6
-rw-r--r--roles/openshift_logging/tasks/install_curator.yaml2
-rw-r--r--roles/openshift_logging/tasks/install_elasticsearch.yaml6
-rw-r--r--roles/openshift_logging/tasks/install_kibana.yaml4
-rw-r--r--roles/openshift_logging/tasks/install_logging.yaml4
-rw-r--r--roles/openshift_logging/templates/fluentd.j22
-rw-r--r--roles/openshift_metrics/defaults/main.yaml7
-rw-r--r--roles/openshift_metrics/tasks/install_cassandra.yaml8
10 files changed, 52 insertions, 24 deletions
diff --git a/roles/openshift_logging/defaults/main.yml b/roles/openshift_logging/defaults/main.yml
index 5440a3647..ad9c1ce42 100644
--- a/roles/openshift_logging/defaults/main.yml
+++ b/roles/openshift_logging/defaults/main.yml
@@ -1,11 +1,12 @@
---
openshift_logging_image_prefix: "{{ openshift_hosted_logging_deployer_prefix | default('docker.io/openshift/origin-') }}"
openshift_logging_image_version: "{{ openshift_hosted_logging_deployer_version | default('latest') }}"
-openshift_logging_use_ops: False
+openshift_logging_use_ops: "{{ openshift_hosted_logging_enable_ops_cluster | default('false') | bool }}"
openshift_logging_master_url: "https://kubernetes.default.svc.{{ openshift.common.dns_domain }}"
openshift_logging_master_public_url: "{{ openshift_hosted_logging_master_public_url | default('https://' + openshift.common.public_hostname + ':' + openshift.master.api_port) }}"
openshift_logging_namespace: logging
openshift_logging_install_logging: True
+openshift_logging_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
openshift_logging_curator_default_days: 30
openshift_logging_curator_run_hour: 0
@@ -15,9 +16,11 @@ openshift_logging_curator_script_log_level: INFO
openshift_logging_curator_log_level: ERROR
openshift_logging_curator_cpu_limit: 100m
openshift_logging_curator_memory_limit: null
+openshift_logging_curator_nodeselector: "{{ openshift_hosted_logging_curator_nodeselector | default('') | map_from_pairs }}"
openshift_logging_curator_ops_cpu_limit: 100m
openshift_logging_curator_ops_memory_limit: null
+openshift_logging_curator_ops_nodeselector: "{{ openshift_hosted_logging_curator_ops_nodeselector | default('') | map_from_pairs }}"
openshift_logging_kibana_hostname: "{{ openshift_hosted_logging_hostname | default('kibana.' + openshift.common.dns_domain) }}"
openshift_logging_kibana_cpu_limit: null
@@ -28,6 +31,9 @@ openshift_logging_kibana_proxy_memory_limit: null
openshift_logging_kibana_replica_count: 1
openshift_logging_kibana_edge_term_policy: Redirect
+openshift_logging_kibana_nodeselector: "{{ openshift_hosted_logging_kibana_nodeselector | default('') | map_from_pairs }}"
+openshift_logging_kibana_ops_nodeselector: "{{ openshift_hosted_logging_kibana_ops_nodeselector | default('') | map_from_pairs }}"
+
#The absolute path on the control node to the cert file to use
#for the public facing kibana certs
openshift_logging_kibana_cert: ""
@@ -48,12 +54,13 @@ openshift_logging_kibana_ops_proxy_cpu_limit: null
openshift_logging_kibana_ops_proxy_memory_limit: null
openshift_logging_kibana_ops_replica_count: 1
-openshift_logging_fluentd_nodeselector: {'logging-infra-fluentd': 'true'}
+openshift_logging_fluentd_nodeselector: "{{ openshift_hosted_logging_fluentd_nodeselector_label | default('logging-infra-fluentd=true') | map_from_pairs }}"
openshift_logging_fluentd_cpu_limit: 100m
openshift_logging_fluentd_memory_limit: 512Mi
openshift_logging_fluentd_es_copy: false
-openshift_logging_fluentd_use_journal: ''
-openshift_logging_fluentd_journal_read_from_head: ''
+openshift_logging_fluentd_use_journal: "{{ openshift_hosted_logging_use_journal | default('') }}"
+openshift_logging_fluentd_journal_source: "{{ openshift_hosted_logging_journal_source | default('') }}"
+openshift_logging_fluentd_journal_read_from_head: "{{ openshift_hosted_logging_journal_read_from_head | default('') }}"
openshift_logging_fluentd_hosts: ['--all']
openshift_logging_es_host: logging-es
@@ -63,13 +70,14 @@ openshift_logging_es_client_cert: /etc/fluent/keys/cert
openshift_logging_es_client_key: /etc/fluent/keys/key
openshift_logging_es_cluster_size: "{{ openshift_hosted_logging_elasticsearch_cluster_size | default(1) }}"
openshift_logging_es_cpu_limit: null
-openshift_logging_es_memory_limit: 8Gi
+openshift_logging_es_memory_limit: "{{ openshift_hosted_logging_elasticsearch_instance_ram | default('8Gi') }}"
openshift_logging_es_pv_selector: null
openshift_logging_es_pvc_dynamic: "{{ openshift_hosted_logging_elasticsearch_pvc_dynamic | default(False) }}"
openshift_logging_es_pvc_size: "{{ openshift_hosted_logging_elasticsearch_pvc_size | default('') }}"
openshift_logging_es_pvc_prefix: "{{ openshift_hosted_logging_elasticsearch_pvc_prefix | default('logging-es') }}"
openshift_logging_es_recover_after_time: 5m
-openshift_logging_es_storage_group: 65534
+openshift_logging_es_storage_group: "{{ openshift_hosted_logging_elasticsearch_storage_group | default('65534') }}"
+openshift_logging_es_nodeselector: "{{ openshift_hosted_logging_elasticsearch_nodeselector | default('') | map_from_pairs }}"
# allow cluster-admin or cluster-reader to view operations index
openshift_logging_es_ops_allow_cluster_reader: False
@@ -81,13 +89,18 @@ openshift_logging_es_ops_client_cert: /etc/fluent/keys/cert
openshift_logging_es_ops_client_key: /etc/fluent/keys/key
openshift_logging_es_ops_cluster_size: "{{ openshift_hosted_logging_elasticsearch_ops_cluster_size | default(1) }}"
openshift_logging_es_ops_cpu_limit: null
-openshift_logging_es_ops_memory_limit: 8Gi
+openshift_logging_es_ops_memory_limit: "{{ openshift_hosted_logging_elasticsearch_ops_instance_ram | default('8Gi') }}"
openshift_logging_es_ops_pv_selector: None
openshift_logging_es_ops_pvc_dynamic: "{{ openshift_hosted_logging_elasticsearch_ops_pvc_dynamic | default(False) }}"
openshift_logging_es_ops_pvc_size: "{{ openshift_hosted_logging_elasticsearch_ops_pvc_size | default('') }}"
openshift_logging_es_ops_pvc_prefix: "{{ openshift_hosted_logging_elasticsearch_ops_pvc_prefix | default('logging-es-ops') }}"
openshift_logging_es_ops_recover_after_time: 5m
-openshift_logging_es_ops_storage_group: 65534
+openshift_logging_es_ops_storage_group: "{{ openshift_hosted_logging_elasticsearch_storage_group | default('65534') }}"
+openshift_logging_es_ops_nodeselector: "{{ openshift_hosted_logging_elasticsearch_ops_nodeselector | default('') | map_from_pairs }}"
+
+# storage related defaults
+openshift_logging_storage_access_modes: "{{ openshift_hosted_logging_storage_access_modes | default('ReadWriteOnce') }}"
+
# following can be uncommented to provide values for configmaps -- take care when providing file contents as it may cause your cluster to not operate correctly
#es_logging_contents:
diff --git a/roles/openshift_logging/filter_plugins/openshift_logging.py b/roles/openshift_logging/filter_plugins/openshift_logging.py
index 007be3ac0..f0007dfc7 100644
--- a/roles/openshift_logging/filter_plugins/openshift_logging.py
+++ b/roles/openshift_logging/filter_plugins/openshift_logging.py
@@ -25,6 +25,13 @@ def entry_from_named_pair(register_pairs, key):
raise RuntimeError("There was no entry found in the dict that had an item with a name that matched {}".format(key))
+def map_from_pairs(source, delim="="):
+ ''' Returns a dict given the source and delim delimited '''
+ if source == '':
+ return dict()
+
+ return dict(source.split(delim) for item in source.split(","))
+
# pylint: disable=too-few-public-methods
class FilterModule(object):
''' OpenShift Logging Filters '''
@@ -35,4 +42,5 @@ class FilterModule(object):
return {
'random_word': random_word,
'entry_from_named_pair': entry_from_named_pair,
+ 'map_from_pairs': map_from_pairs,
}
diff --git a/roles/openshift_logging/tasks/generate_pvcs.yaml b/roles/openshift_logging/tasks/generate_pvcs.yaml
index d6d1abd06..e1629908f 100644
--- a/roles/openshift_logging/tasks/generate_pvcs.yaml
+++ b/roles/openshift_logging/tasks/generate_pvcs.yaml
@@ -6,8 +6,8 @@
start: "{{es_pvc_names | map('regex_search', es_pvc_prefix+'.*')|select('string')|list|length}}"
with_sequence: start={{start}} end={{ (start|int > es_cluster_size|int - 1) | ternary(start, es_cluster_size|int - 1)}}
when:
+ - "{{ es_dc_names|default([]) | length <= es_cluster_size|int }}"
- es_pvc_size | search('^\d.*')
- - "{{ es_dc_names|default([]) | length < es_cluster_size|int }}"
check_mode: no
- name: Generating PersistentVolumeClaims
@@ -16,7 +16,7 @@
obj_name: "{{claim_name}}"
size: "{{es_pvc_size}}"
access_modes:
- - ReadWriteOnce
+ - "{{ es_access_modes }}"
pv_selector: "{{es_pv_selector}}"
with_items:
- "{{es_pvc_pool | default([])}}"
@@ -36,7 +36,7 @@
volume.alpha.kubernetes.io/storage-class: "dynamic"
size: "{{es_pvc_size}}"
access_modes:
- - ReadWriteOnce
+ - "{{ es_access_modes }}"
pv_selector: "{{es_pv_selector}}"
with_items:
- "{{es_pvc_pool|default([])}}"
diff --git a/roles/openshift_logging/tasks/install_curator.yaml b/roles/openshift_logging/tasks/install_curator.yaml
index 5b474ff39..ab8e207f1 100644
--- a/roles/openshift_logging/tasks/install_curator.yaml
+++ b/roles/openshift_logging/tasks/install_curator.yaml
@@ -31,7 +31,7 @@
curator_cpu_limit: "{{openshift_logging_curator_cpu_limit }}"
curator_memory_limit: "{{openshift_logging_curator_memory_limit }}"
replicas: "{{curator_replica_count.stdout | default (0)}}"
- curator_node_selector: "{{openshift_logging_curator_nodeselector | default({}) }}"
+ curator_node_selector: "{{openshift_logging_curator_nodeselector | default({})}}"
check_mode: no
changed_when: no
diff --git a/roles/openshift_logging/tasks/install_elasticsearch.yaml b/roles/openshift_logging/tasks/install_elasticsearch.yaml
index 6b441c4aa..a0ad12d94 100644
--- a/roles/openshift_logging/tasks/install_elasticsearch.yaml
+++ b/roles/openshift_logging/tasks/install_elasticsearch.yaml
@@ -12,6 +12,7 @@
es_pvc_size: "{{openshift_logging_es_pvc_size}}"
es_dc_names: "{{openshift_logging_facts.elasticsearch.deploymentconfigs.keys()}}"
es_cluster_size: "{{openshift_logging_es_cluster_size}}"
+ es_access_modes: "{{ openshift_logging_storage_access_modes }}"
# we should initialize the es_dc_pool with the current keys
- name: Init pool of DeploymentConfig names for Elasticsearch
@@ -44,7 +45,7 @@
volume_names: "{{es_pvc_pool | default([])}}"
pvc_claim: "{{(volume_names | length > item.0) | ternary(volume_names[item.0], None)}}"
deploy_name: "{{item.1}}"
- es_node_selector: "{{openshift_logging_es_nodeselector | default({})}}"
+ es_node_selector: "{{openshift_logging_es_nodeselector | default({}) }}"
with_indexed_items:
- "{{ es_dc_pool }}"
check_mode: no
@@ -77,6 +78,7 @@
es_cluster_size: "{{openshift_logging_es_ops_cluster_size|int}}"
es_pvc_dynamic: "{{openshift_logging_es_ops_pvc_dynamic | bool}}"
es_pv_selector: "{{openshift_logging_es_ops_pv_selector}}"
+ es_access_modes: "{{ openshift_logging_storage_access_modes }}"
when:
- openshift_logging_use_ops | bool
check_mode: no
@@ -119,7 +121,7 @@
es_recover_after_nodes: "{{es_ops_recover_after_nodes}}"
es_recover_expected_nodes: "{{es_ops_recover_expected_nodes}}"
openshift_logging_es_recover_after_time: "{{openshift_logging_es_ops_recover_after_time}}"
- es_node_selector: "{{openshift_logging_es_ops_nodeselector | default({})}}"
+ es_node_selector: "{{openshift_logging_es_ops_nodeselector | default({}) | map_from_pairs }}"
with_indexed_items:
- "{{ es_ops_dc_pool | default([]) }}"
when:
diff --git a/roles/openshift_logging/tasks/install_kibana.yaml b/roles/openshift_logging/tasks/install_kibana.yaml
index 3aeff2cac..52bdeb50d 100644
--- a/roles/openshift_logging/tasks/install_kibana.yaml
+++ b/roles/openshift_logging/tasks/install_kibana.yaml
@@ -35,7 +35,7 @@
kibana_proxy_cpu_limit: "{{openshift_logging_kibana_proxy_cpu_limit }}"
kibana_proxy_memory_limit: "{{openshift_logging_kibana_proxy_memory_limit }}"
replicas: "{{kibana_replica_count.stdout | default (0)}}"
- kibana_node_selector: "{{openshift_logging_kibana_nodeselector | default({}) }}"
+ kibana_node_selector: "{{openshift_logging_kibana_nodeselector | default({})}}"
check_mode: no
changed_when: no
@@ -54,7 +54,7 @@
kibana_proxy_cpu_limit: "{{openshift_logging_kibana_ops_proxy_cpu_limit }}"
kibana_proxy_memory_limit: "{{openshift_logging_kibana_ops_proxy_memory_limit }}"
replicas: "{{kibana_ops_replica_count.stdout | default (0)}}"
- kibana_node_selector: "{{openshift_logging_kibana_ops_nodeselector | default({}) }}"
+ kibana_node_selector: "{{openshift_logging_kibana_ops_nodeselector | default({})}}"
when: openshift_logging_use_ops | bool
check_mode: no
changed_when: no
diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml
index e23c3f9f1..1beff3bfc 100644
--- a/roles/openshift_logging/tasks/install_logging.yaml
+++ b/roles/openshift_logging/tasks/install_logging.yaml
@@ -76,7 +76,9 @@
register: link_pull_secret
loop_control:
loop_var: sa_account
- when: openshift_logging_image_pull_secret is defined
+ when:
+ - openshift_logging_image_pull_secret is defined
+ - openshift_logging_image_pull_secret != ''
failed_when: link_pull_secret.rc != 0
- name: Scaling up cluster
diff --git a/roles/openshift_logging/templates/fluentd.j2 b/roles/openshift_logging/templates/fluentd.j2
index 223d342b9..0bf1686ad 100644
--- a/roles/openshift_logging/templates/fluentd.j2
+++ b/roles/openshift_logging/templates/fluentd.j2
@@ -119,7 +119,7 @@ spec:
- name: "USE_JOURNAL"
value: "{{openshift_logging_fluentd_use_journal|lower}}"
- name: "JOURNAL_SOURCE"
- value: "{{fluentd_journal_source | default('')}}"
+ value: "{{openshift_logging_fluentd_journal_source | default('')}}"
- name: "JOURNAL_READ_FROM_HEAD"
value: "{{openshift_logging_fluentd_journal_read_from_head|lower}}"
volumes:
diff --git a/roles/openshift_metrics/defaults/main.yaml b/roles/openshift_metrics/defaults/main.yaml
index edaa7d0df..db4a0e1fc 100644
--- a/roles/openshift_metrics/defaults/main.yaml
+++ b/roles/openshift_metrics/defaults/main.yaml
@@ -16,8 +16,8 @@ openshift_metrics_hawkular_ca: ""
openshift_metrics_hawkular_nodeselector: ""
openshift_metrics_cassandra_replicas: 1
-openshift_metrics_cassandra_storage_type: emptydir
-openshift_metrics_cassandra_pvc_size: 10Gi
+openshift_metrics_cassandra_storage_type: "{{ openshift_hosted_metrics_storage_kind | default('emptydir') }}"
+openshift_metrics_cassandra_pvc_size: "{{ openshift_hosted_metrics_storage_volume_size | default('10Gi') }}"
openshift_metrics_cassandra_limits_memory: 2G
openshift_metrics_cassandra_limits_cpu: null
openshift_metrics_cassandra_requests_memory: 1G
@@ -46,7 +46,8 @@ openshift_metrics_master_url: https://kubernetes.default.svc.cluster.local
openshift_metrics_node_id: nodename
openshift_metrics_project: openshift-infra
-openshift_metrics_cassandra_pvc_prefix: metrics-cassandra
+openshift_metrics_cassandra_pvc_prefix: "{{ openshift_hosted_metrics_storage_volume_name | default('metrics-cassandra') }}"
+openshift_metrics_cassandra_pvc_access: "{{ openshift_hosted_metrics_storage_access_modes | default('ReadWriteOnce') }}"
openshift_metrics_hawkular_user_write_access: False
diff --git a/roles/openshift_metrics/tasks/install_cassandra.yaml b/roles/openshift_metrics/tasks/install_cassandra.yaml
index df39c1e1f..66c81562b 100644
--- a/roles/openshift_metrics/tasks/install_cassandra.yaml
+++ b/roles/openshift_metrics/tasks/install_cassandra.yaml
@@ -31,10 +31,12 @@
labels:
metrics-infra: hawkular-cassandra
access_modes:
- - ReadWriteOnce
+ - "{{ openshift_metrics_cassandra_pvc_access }}"
size: "{{ openshift_metrics_cassandra_pvc_size }}"
with_sequence: count={{ openshift_metrics_cassandra_replicas }}
- when: openshift_metrics_cassandra_storage_type == 'pv'
+ when:
+ - openshift_metrics_cassandra_storage_type != 'emptydir'
+ - openshift_metrics_cassandra_storage_type != 'dynamic'
changed_when: false
- name: generate hawkular-cassandra persistent volume claims (dynamic)
@@ -48,7 +50,7 @@
annotations:
volume.alpha.kubernetes.io/storage-class: dynamic
access_modes:
- - ReadWriteOnce
+ - "{{ openshift_metrics_cassandra_pvc_access }}"
size: "{{ openshift_metrics_cassandra_pvc_size }}"
with_sequence: count={{ openshift_metrics_cassandra_replicas }}
when: openshift_metrics_cassandra_storage_type == 'dynamic'