Browse Source

Merge pull request #6906 from jcantrill/kibana_env_vars

Automatic merge from submit-queue.

allow setting of kibana env vars

This PR allows setting kibana env vars via ansible in support of being able to adjust kibana config via env vars
OpenShift Merge Robot 7 years ago
parent
commit
b684f992a6

+ 1 - 0
roles/openshift_logging/README.md

@@ -58,6 +58,7 @@ When `openshift_logging_install_logging` is set to `False` the `openshift_loggin
 - `openshift_logging_kibana_replica_count`: The number of replicas Kibana should be scaled up to. Defaults to 1.
 - `openshift_logging_kibana_nodeselector`: A map of labels (e.g. {"node":"infra","region":"west"} to select the nodes where the pod will land.
 - `openshift_logging_kibana_edge_term_policy`: Insecure Edge Termination Policy. Defaults to Redirect.
+- `openshift_logging_kibana_env_vars`: A map of environment variables to add to the kibana deployment config (e.g. {"ELASTICSEARCH_REQUESTTIMEOUT":"30000"})
 
 - `openshift_logging_fluentd_nodeselector`: The node selector that the Fluentd daemonset uses to determine where to deploy to. Defaults to '"logging-infra-fluentd": "true"'.
 - `openshift_logging_fluentd_cpu_request`: The minimum amount of CPU to allocate for Fluentd collector pods. Defaults to '100m'.

+ 3 - 0
roles/openshift_logging_kibana/defaults/main.yml

@@ -18,6 +18,9 @@ openshift_logging_kibana_es_port: 9200
 openshift_logging_kibana_replicas: 1
 openshift_logging_kibana_edge_term_policy: Redirect
 
+# map of env. var to add to the kibana deploymentconfig
+openshift_logging_kibana_env_vars: {}
+
 # this is used to determine if this is an operations deployment or a non-ops deployment
 # simply used for naming purposes
 openshift_logging_kibana_ops_deployment: false

+ 1 - 0
roles/openshift_logging_kibana/tasks/main.yaml

@@ -251,6 +251,7 @@
     kibana_proxy_memory_limit: "{{ openshift_logging_kibana_proxy_memory_limit }}"
     kibana_replicas: "{{ openshift_logging_kibana_replicas | default (1) }}"
     kibana_node_selector: "{{ openshift_logging_kibana_nodeselector | default({}) }}"
+    kibana_env_vars: "{{ openshift_logging_kibana_env_vars | default({}) }}"
 
 - name: Set Kibana DC
   oc_obj:

+ 4 - 0
roles/openshift_logging_kibana/templates/kibana.j2

@@ -70,6 +70,10 @@ spec:
                 resourceFieldRef:
                   containerName: kibana
                   resource: limits.memory
+{% for key, value in kibana_env_vars.items() %}
+            - name: "{{ key }}"
+              value: "{{ value }}"
+{% endfor %}
           volumeMounts:
             - name: kibana
               mountPath: /etc/kibana/keys