mirror of
https://github.com/amkartashov/gf-k8s.git
synced 2026-01-11 09:59:43 +00:00
added papertrail logging
This commit is contained in:
parent
66b942bfd3
commit
60d2470e70
2 changed files with 130 additions and 0 deletions
90
fluentd-daemonset-papertrail.yaml
Normal file
90
fluentd-daemonset-papertrail.yaml
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: fluentd
|
||||
name: fluentd
|
||||
namespace: kube-system
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
metadata:
|
||||
name: fluentd-clusterrole
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- "namespaces"
|
||||
- "pods"
|
||||
verbs:
|
||||
- "list"
|
||||
- "get"
|
||||
- "watch"
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
metadata:
|
||||
name: fluentd-clusterrole
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: fluentd-clusterrole
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: fluentd
|
||||
namespace: kube-system
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: fluentd
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: fluentd-logging
|
||||
version: v1
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: fluentd-logging
|
||||
version: v1
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
serviceAccount: fluentd
|
||||
serviceAccountName: fluentd
|
||||
containers:
|
||||
- name: fluentd
|
||||
image: fluent/fluentd-kubernetes-daemonset:v0.12-debian-papertrail
|
||||
env:
|
||||
- name: FLUENT_UID
|
||||
value: "0"
|
||||
- name: FLUENT_PAPERTRAIL_HOST
|
||||
value: "logs7.papertrailapp.com"
|
||||
- name: FLUENT_PAPERTRAIL_PORT
|
||||
value: "47843"
|
||||
- name: FLUENT_HOSTNAME
|
||||
value: "gfk8s"
|
||||
resources:
|
||||
limits:
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 200Mi
|
||||
volumeMounts:
|
||||
- name: varlog
|
||||
mountPath: /var/log
|
||||
- name: varlibdockercontainers
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- name: varlog
|
||||
hostPath:
|
||||
path: /var/log
|
||||
- name: varlibdockercontainers
|
||||
hostPath:
|
||||
path: /var/lib/docker/containers
|
||||
40
papertrail-logspout-daemonset.yml
Normal file
40
papertrail-logspout-daemonset.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: logspout-papertrail
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: logspout-papertrail
|
||||
spec:
|
||||
hostPID: true
|
||||
hostIPC: true
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- resources:
|
||||
requests:
|
||||
cpu: 0.15
|
||||
limits:
|
||||
memory: 500Mi
|
||||
env:
|
||||
- name: SYSLOG_TAG
|
||||
value: '{{ index .Container.Config.Labels "io.kubernetes.pod.namespace" }}[{{ index .Container.Config.Labels "io.kubernetes.pod.name" }}]'
|
||||
- name: SYSLOG_HOSTNAME
|
||||
value: '{{ index .Container.Config.Labels "io.kubernetes.container.name" }}'
|
||||
- name: ROUTE_URIS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: papertrail-destination
|
||||
key: papertrail-destination
|
||||
- name: ALLOW_TTY
|
||||
value: "true"
|
||||
image: gliderlabs/logspout:master
|
||||
name: logspout
|
||||
volumeMounts:
|
||||
- name: log
|
||||
mountPath: /var/run/docker.sock
|
||||
volumes:
|
||||
- name: log
|
||||
hostPath:
|
||||
path: /var/run/docker.sock
|
||||
Loading…
Reference in a new issue