Added new params for fluentd&telegraf under kubernetes

Change-Id: I0780126f5183bcd062c24375b4e9942f35d6f6b9
Related-Bug: PROD-21821
Related-Bug: PROD-21822
diff --git a/kubernetes/common.yml b/kubernetes/common.yml
index 639154e..717bbd4 100644
--- a/kubernetes/common.yml
+++ b/kubernetes/common.yml
@@ -48,6 +48,9 @@
     kubernetes_cniplugins_source: ${_param:kubernetes_cniplugins_repo}/cni-plugins_v0.7.1-48-g696b1f9.tar.gz
     kubernetes_cniplugins_source_hash: md5=5ec1cf5e989097c6127ea5365e277b02
     kubernetes_dashboard_image: ${_param:kubernetes_dashboard_repo}/kubernetes-dashboard-amd64:v1.8.3
+    kubernetes_fluentd_aggregator_image: fluent/fluentd-kubernetes-daemonset:v1.2-debian-elasticsearch
+    kubernetes_fluentd_logger_image: fluent/fluentd-kubernetes-daemonset:v1.2-debian-stackdriver
+    kubernetes_telegraf_image: docker.io/telegraf:1.5.3
 
     kubelet_fail_on_swap: true
     kubernetes_dashboard_enabled: true
@@ -64,12 +67,63 @@
     kubernetes_metallb_enabled: false
     kubernetes_sriov_enabled: false
     kubernetes_fluentd_enabled: false
+    kubernetes_telegraf_enabled: false
 
     # the rest of fluentd related params, the non bools
-    kubernetes_fluentd_aggregator_bind_port: 24224
-    kubernetes_fluentd_aggregator_es_host: 127.0.0.1
-    kubernetes_fluentd_aggregator_es_port: 9200
-    kubernetes_fluentd_aggregator_es_scheme: http
+    kubernetes_fluentd_namespace: stacklight
+    kubernetes_fluentd_aggregator_resources_limits_memory: 500Mi
+    kubernetes_fluentd_aggregator_resources_requests_memory: 500Mi
+    kubernetes_fluentd_aggregator_config_forward_input_bind_port: 24224
+    kubernetes_fluentd_aggregator_config_general_time_format: '%Y-%m-%dT%H:%M:%S.%N%z'
+    kubernetes_fluentd_aggregator_config_systemd_filter_docker_parse_format: /^time="(?<time>[^)]*)" level=(?<severity>[^ ]*) msg="(?<message>[^"]*)"( err="(?<error>[^"]*)")?( statusCode=($<status_code>\d+))?/
+    kubernetes_fluentd_aggregator_config_output_log_level: 'info'
+    kubernetes_fluentd_aggregator_config_output_logstash_format: true
+    kubernetes_fluentd_aggregator_config_output_logstash_prefix: 'log'
+    kubernetes_fluentd_aggregator_config_output_logstash_dateformat: '%Y.%m.%d'
+    kubernetes_fluentd_aggregator_config_output_num_threads: 8
+    kubernetes_fluentd_aggregator_config_output_max_retry_wait: 30
+    kubernetes_fluentd_aggregator_config_output_flush_interval: '10s'
+    kubernetes_fluentd_aggregator_config_output_buffer_chunk_limit: '2m'
+    kubernetes_fluentd_aggregator_config_output_buffer_queue_limit: 32
+    kubernetes_fluentd_aggregator_config_output_request_timeout: '10s'
+    kubernetes_fluentd_aggregator_config_output_es_host: 127.0.0.1
+    kubernetes_fluentd_aggregator_config_output_es_port: 9200
+    kubernetes_fluentd_aggregator_config_output_es_scheme: http
+
+    kubernetes_fluentd_logger_resources_limits_memory: 500Mi
+    kubernetes_fluentd_logger_resources_requests_memory: 500Mi
+    kubernetes_fluentd_logger_config_kubernetes_input_time_format: '%Y-%m-%dT%H:%M:%S.%NZ'
+    kubernetes_fluentd_logger_config_forward_output_require_ack_response: true
+    kubernetes_fluentd_logger_config_forward_output_ack_response_timeout: 30
+    kubernetes_fluentd_logger_config_forward_output_recover_wait: '10s'
+    kubernetes_fluentd_logger_config_forward_output_heartbeat_interval: '1s'
+    kubernetes_fluentd_logger_config_forward_output_phi_threshold: 16
+    kubernetes_fluentd_logger_config_forward_output_send_timeout: '10s'
+    kubernetes_fluentd_logger_config_forward_output_hard_timeout: '10s'
+    kubernetes_fluentd_logger_config_forward_output_expire_dns_cache: 15
+    kubernetes_fluentd_logger_config_forward_output_heartbeat_type: 'tcp'
+    kubernetes_fluentd_logger_config_forward_output_buffer_chunk_limit: '2M'
+    kubernetes_fluentd_logger_config_forward_output_buffer_queue_limit: 32
+    kubernetes_fluentd_logger_config_forward_output_flush_interval: '5s'
+    kubernetes_fluentd_logger_config_forward_output_max_retry_wait: 15
+    kubernetes_fluentd_logger_config_forward_output_num_threads: 8
+
+    # telegraf stuff
+    kubernetes_telegraf_namespace: stacklight
+    kubernetes_telegraf_resources_limits_memory: 500Mi
+    kubernetes_telegraf_resources_requests_memory: 500Mi
+    kubernetes_telegraf_agent_interval: 15
+    kubernetes_telegraf_agent_round_interval: false
+    kubernetes_telegraf_agent_metric_batch_size: 1000
+    kubernetes_telegraf_agent_metric_buffer_limit: 10000
+    kubernetes_telegraf_agent_collection_jitter: 2
+    kubernetes_telegraf_agent_flush_interval: 10
+    kubernetes_telegraf_agent_flush_jitter: 2
+    kubernetes_telegraf_agent_precision: ms
+    kubernetes_telegraf_agent_logfile: etc/telegraf/log
+    kubernetes_telegraf_agent_debug: false
+    kubernetes_telegraf_agent_quiet: false
+    kubernetes_telegraf_agent_omit_hostname: false
 
   docker:
     host:
@@ -114,13 +168,83 @@
           image: ${_param:kubernetes_flannel_image}
         fluentd:
           enabled: ${_param:kubernetes_fluentd_enabled}
+          namespace: ${_param:kubernetes_fluentd_namespace}
           aggregator:
-            bind:
-              port: ${_param:kubernetes_fluentd_aggregator_bind_port}
-            es:
-              host: ${_param:kubernetes_fluentd_aggregator_es_host}
-              port: ${_param:kubernetes_fluentd_aggregator_es_port}
-              scheme: ${_param:kubernetes_fluentd_aggregator_es_scheme}
+            image: ${_param:kubernetes_fluentd_aggregator_image}
+            resources:
+              limits:
+                memory: ${_param:kubernetes_fluentd_aggregator_resources_limits_memory}
+              requests:
+                memory: ${_param:kubernetes_fluentd_aggregator_resources_requests_memory}
+            config:
+              forward_input:
+                bind:
+                  port: ${_param:kubernetes_fluentd_aggregator_config_forward_input_bind_port}
+              general:
+                time_format: ${_param:kubernetes_fluentd_aggregator_config_general_time_format}
+              systemd_filter:
+                docker_parse_format: ${_param:kubernetes_fluentd_aggregator_config_systemd_filter_docker_parse_format}
+              output:
+                log_level: ${_param:kubernetes_fluentd_aggregator_config_output_log_level}
+                logstash_format: ${_param:kubernetes_fluentd_aggregator_config_output_logstash_format}
+                logstash_prefix: ${_param:kubernetes_fluentd_aggregator_config_output_logstash_prefix}
+                logstash_dateformat: ${_param:kubernetes_fluentd_aggregator_config_output_logstash_dateformat}
+                request_timeout: ${_param:kubernetes_fluentd_aggregator_config_output_request_timeout}
+                buffer_chunk_limit: ${_param:kubernetes_fluentd_aggregator_config_output_buffer_chunk_limit}
+                buffer_queue_limit: ${_param:kubernetes_fluentd_aggregator_config_output_buffer_queue_limit}
+                flush_interval: ${_param:kubernetes_fluentd_aggregator_config_output_flush_interval}
+                num_threads: ${_param:kubernetes_fluentd_aggregator_config_output_num_threads}
+                max_retry_wait: ${_param:kubernetes_fluentd_aggregator_config_output_max_retry_wait}
+                es:
+                  host: ${_param:kubernetes_fluentd_aggregator_config_output_es_host}
+                  port: ${_param:kubernetes_fluentd_aggregator_config_output_es_port}
+                  scheme: ${_param:kubernetes_fluentd_aggregator_config_output_es_scheme}
+          logger:
+            image: ${_param:kubernetes_fluentd_logger_image}
+            resources:
+              limits:
+                memory: ${_param:kubernetes_fluentd_logger_resources_limits_memory}
+              requests:
+                memory: ${_param:kubernetes_fluentd_logger_resources_requests_memory}
+            config:
+              kubernetes_input:
+                time_format: ${_param:kubernetes_fluentd_logger_config_kubernetes_input_time_format}
+              forward_output:
+                require_ack_response: ${_param:kubernetes_fluentd_logger_config_forward_output_require_ack_response}
+                ack_response_timeout: ${_param:kubernetes_fluentd_logger_config_forward_output_ack_response_timeout}
+                recover_wait: ${_param:kubernetes_fluentd_logger_config_forward_output_recover_wait}
+                heartbeat_interval: ${_param:kubernetes_fluentd_logger_config_forward_output_heartbeat_interval}
+                phi_threshold: ${_param:kubernetes_fluentd_logger_config_forward_output_phi_threshold}
+                send_timeout: ${_param:kubernetes_fluentd_logger_config_forward_output_send_timeout}
+                hard_timeout: ${_param:kubernetes_fluentd_logger_config_forward_output_hard_timeout}
+                expire_dns_cache: ${_param:kubernetes_fluentd_logger_config_forward_output_expire_dns_cache}
+                heartbeat_type: ${_param:kubernetes_fluentd_logger_config_forward_output_heartbeat_type}
+                buffer_chunk_limit: ${_param:kubernetes_fluentd_logger_config_forward_output_buffer_chunk_limit}
+                buffer_queue_limit: ${_param:kubernetes_fluentd_logger_config_forward_output_buffer_queue_limit}
+                flush_interval: ${_param:kubernetes_fluentd_logger_config_forward_output_flush_interval}
+                max_retry_wait: ${_param:kubernetes_fluentd_logger_config_forward_output_max_retry_wait}
+                num_threads: ${_param:kubernetes_fluentd_logger_config_forward_output_num_threads}
+        telegraf:
+          enabled: ${_param:kubernetes_telegraf_enabled}
+          image: ${_param:kubernetes_telegraf_image}
+          resources:
+            limits:
+              memory: ${_param:kubernetes_telegraf_resources_limits_memory}
+            requests:
+              memory: ${_param:kubernetes_telegraf_resources_requests_memory}
+          agent:
+            interval: ${_param:kubernetes_telegraf_agent_interval}
+            round_interval: ${_param:kubernetes_telegraf_agent_round_interval}
+            metric_batch_size: ${_param:kubernetes_telegraf_agent_metric_batch_size}
+            metric_buffer_limit: ${_param:kubernetes_telegraf_agent_metric_buffer_limit}
+            collection_jitter: ${_param:kubernetes_telegraf_agent_collection_jitter}
+            flush_interval: ${_param:kubernetes_telegraf_agent_flush_interval}
+            flush_jitter: ${_param:kubernetes_telegraf_agent_flush_jitter}
+            precision: ${_param:kubernetes_telegraf_agent_precision}
+            logfile: ${_param:kubernetes_telegraf_agent_logfile}
+            debug: ${_param:kubernetes_telegraf_agent_debug}
+            quiet: ${_param:kubernetes_telegraf_agent_quiet}
+            omit_hostname: ${_param:kubernetes_telegraf_agent_omit_hostname}
         virtlet:
           enabled: ${_param:kubernetes_virtlet_enabled}
           namespace: kube-system