From 3c0a9e97aa8b2fac3d691662e57e838af6c81bd9 Mon Sep 17 00:00:00 2001 From: wonderflow Date: Wed, 22 Nov 2017 16:51:56 +0800 Subject: [PATCH 1/2] add k8s deploy manifest --- deploy/logkit_on_k8s.yml | 110 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 deploy/logkit_on_k8s.yml diff --git a/deploy/logkit_on_k8s.yml b/deploy/logkit_on_k8s.yml new file mode 100644 index 000000000..d133647e8 --- /dev/null +++ b/deploy/logkit_on_k8s.yml @@ -0,0 +1,110 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: logkit-config + namespace: kube-system + labels: + k8s-app: logkit +data: + k8s.conf: |- + { + "name": "k8s_runner", + "batch_interval": 60, + "reader": { + "mode": "tailx", + "log_path": "/var/log/containers/*.log", + "read_from": "oldest", + "datasource_tag": "source_file", + "expire": "240h", + "stat_interval": "3m" + }, + "parser": { + "type": "raw", + "timestamp": "true" + }, + "senders": [ + { + "sender_type": "pandora", + "pandora_repo_name": "k8s_log", + "pandora_ak": "${QINIU_ACCESS_KEY}", + "pandora_sk": "${QINIU_SECRET_KEY}", + "pandora_host": "https://pipeline.qiniu.com", + "pandora_region": "nb", + "pandora_schema_free": "true", + "pandora_enable_logdb": "true", + "pandora_logdb_host": "https://logdb.qiniu.com", + "pandora_gzip": "true", + "pandora_uuid": "false", + "pandora_withip": "true", + "ft_strategy": "backup_only", + "ignore_invalid_field": "true", + "pandora_auto_convert_date": "true" + } + ] + } +--- +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: logkit + namespace: kube-system + labels: + k8s-app: logkit +spec: + template: + metadata: + labels: + k8s-app: logkit + spec: + terminationGracePeriodSeconds: 30 + containers: + - name: logkit + image: wonderflow/logkit:v1.3.4 + env: + - name: QINIU_ACCESS_KEY + value: change_me_to_your_qiniu_access_key + - name: QINIU_SECRET_KEY + value: change_me_to_your_qiniu_secret_key + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + securityContext: + runAsUser: 0 + resources: + limits: + memory: 200Mi + requests: + cpu: 100m + memory: 100Mi + volumeMounts: + - name: config + mountPath: /app/confs/k8s.conf + readOnly: true + subPath: k8s.conf + - name: varlibdockercontainers + mountPath: /var/lib/docker/containers + readOnly: true + - name: varlogcontainers + mountPath: /var/log/containers + readOnly: true + - name: varlogpods + mountPath: /var/log/pods + readOnly: true + volumes: + - name: config + configMap: + defaultMode: 0600 + name: logkit-config + - name: varlibdockercontainers + hostPath: + path: /var/lib/docker/containers + - name: varlogcontainers + hostPath: + path: /var/log/containers + - name: varlogpods + hostPath: + path: /var/log/pods + - name: data + emptyDir: {} \ No newline at end of file From 0ab390c3bc64b6f76c47badece038c97391e8f6c Mon Sep 17 00:00:00 2001 From: wonderflow Date: Wed, 22 Nov 2017 16:52:09 +0800 Subject: [PATCH 2/2] version v1.3.6 --- deploy/logkit_on_k8s.yml | 2 +- logkit.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/logkit_on_k8s.yml b/deploy/logkit_on_k8s.yml index d133647e8..74e1eebbc 100644 --- a/deploy/logkit_on_k8s.yml +++ b/deploy/logkit_on_k8s.yml @@ -60,7 +60,7 @@ spec: terminationGracePeriodSeconds: 30 containers: - name: logkit - image: wonderflow/logkit:v1.3.4 + image: wonderflow/logkit:v1.3.6 env: - name: QINIU_ACCESS_KEY value: change_me_to_your_qiniu_access_key diff --git a/logkit.go b/logkit.go index 2143d3f78..2c55de875 100644 --- a/logkit.go +++ b/logkit.go @@ -39,7 +39,7 @@ type Config struct { var conf Config const ( - Version = "v1.3.5" + Version = "v1.3.6" defaultReserveCnt = 5 defaultLogDir = "./run" defaultLogPattern = "*.log-*"