diff --git a/deploy/logkit_on_k8s.yml b/deploy/logkit_on_k8s.yml new file mode 100644 index 000000000..74e1eebbc --- /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.6 + 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 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-*"