Manage Kubernetes logs

The patch brings service metadata in order to configure:
* rsyslog: dump hypercube logs to a dedicated log file,
* log_collector: log parsing of this file,
* logrotate: ensure logrotation.

Depends-On: I7de304aa11512bc83802fe097af9f4375075fd52
Depends-On: Id2168fa5194a1afc4048faeaf9301504cd5b5782

Change-Id: I791fcb6dfaed77ac15a95741215d7396e8faa1bf
diff --git a/metadata/service/logging.yml b/metadata/service/logging.yml
new file mode 100644
index 0000000..aebb0fc
--- /dev/null
+++ b/metadata/service/logging.yml
@@ -0,0 +1,38 @@
+parameters:
+  _param:
+    kubernetes_syslog_pattern: "%syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%\\n"
+  kubernetes:
+    common:
+      logrotate: /var/log/kubernetes.log
+  heka:
+    log_collector:
+      input:
+        kubernetes:
+          engine: logstreamer
+          log_directory: "/var/log"
+          file_match: 'kubernetes\.log\.?(?P<Seq>\d*)$'
+          differentiator: ['kubernetes']
+          priority: ["^Seq"]
+          decoder: "kubernetes_decoder"
+          splitter: "TokenSplitter"
+      decoder:
+        kubernetes:
+          engine: sandbox
+          adjust_timezone: true
+          config:
+            syslog_pattern: ${_param:kubernetes_syslog_pattern}
+  rsyslog:
+    client:
+      output:
+        file:
+          /var/log/kubernetes.log:
+            sync: false
+            filter: "if $programname startswith 'kube' then"
+            stop_processing: true
+            template: ${_param:kubernetes_syslog_pattern}
+            skip_log_collector: true
+            owner: syslog
+            group: adm
+            createmode: "0640"
+            enabled: true
+