Skip to content

Commit

Permalink
Merge pull request #216 from wonderflow/logkit-k8s
Browse files Browse the repository at this point in the history
Logkit k8s && v1.3.6
  • Loading branch information
wonderflow authored Nov 22, 2017
2 parents e335bc5 + 0ab390c commit 4b5ce94
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
110 changes: 110 additions & 0 deletions deploy/logkit_on_k8s.yml
Original file line number Diff line number Diff line change
@@ -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: {}
2 changes: 1 addition & 1 deletion logkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-*"
Expand Down

0 comments on commit 4b5ce94

Please sign in to comment.