summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging_elasticsearch
diff options
context:
space:
mode:
authorJeff Cantrill <jcantril@redhat.com>2017-10-01 14:54:22 -0400
committerJan Wozniak <jwozniak@redhat.com>2017-10-03 17:06:23 +0200
commitf4c7d5e064fad263f618fb633d5c0d37c0a2a553 (patch)
treec51f44bc24280b0ae27ba05b344885f9603cec08 /roles/openshift_logging_elasticsearch
parentec7d1b04ef91a3d10675efe1c53a88ef100437b8 (diff)
downloadopenshift-f4c7d5e064fad263f618fb633d5c0d37c0a2a553.tar.gz
openshift-f4c7d5e064fad263f618fb633d5c0d37c0a2a553.tar.bz2
openshift-f4c7d5e064fad263f618fb633d5c0d37c0a2a553.tar.xz
openshift-f4c7d5e064fad263f618fb633d5c0d37c0a2a553.zip
Bug 1496271 - Perserve SCC for ES local persistent storage
ES can be modified to use node local persistent storage. This requires changing SCC and is described in docs: https://docs.openshift.com/container-platform/3.6/install_config/aggregate_logging.html During an upgrade, SCC defined by the user is ignored. This fix fetches SCC user defined as a fact and adds it to the ES DC which is later used.
Diffstat (limited to 'roles/openshift_logging_elasticsearch')
-rw-r--r--roles/openshift_logging_elasticsearch/tasks/main.yaml1
-rw-r--r--roles/openshift_logging_elasticsearch/templates/es.j23
2 files changed, 4 insertions, 0 deletions
diff --git a/roles/openshift_logging_elasticsearch/tasks/main.yaml b/roles/openshift_logging_elasticsearch/tasks/main.yaml
index 8d5927df6..244290953 100644
--- a/roles/openshift_logging_elasticsearch/tasks/main.yaml
+++ b/roles/openshift_logging_elasticsearch/tasks/main.yaml
@@ -282,6 +282,7 @@
es_memory_limit: "{{ openshift_logging_elasticsearch_memory_limit }}"
es_node_selector: "{{ openshift_logging_elasticsearch_nodeselector | default({}) }}"
es_storage_groups: "{{ openshift_logging_elasticsearch_storage_group | default([]) }}"
+ es_container_security_context: "{{ _es_containers.elasticsearch.securityContext if _es_containers is defined and 'elasticsearch' in _es_containers and 'securityContext' in _es_containers.elasticsearch else None }}"
deploy_type: "{{ openshift_logging_elasticsearch_deployment_type }}"
es_replicas: 1
diff --git a/roles/openshift_logging_elasticsearch/templates/es.j2 b/roles/openshift_logging_elasticsearch/templates/es.j2
index d1edb2d76..20152e576 100644
--- a/roles/openshift_logging_elasticsearch/templates/es.j2
+++ b/roles/openshift_logging_elasticsearch/templates/es.j2
@@ -51,6 +51,9 @@ spec:
{% endif %}
requests:
memory: "{{es_memory_limit}}"
+{% if es_container_security_context %}
+ securityContext: {{ es_container_security_context | to_yaml }}
+{% endif %}
ports:
-
containerPort: 9200