Skip to content

Instantly share code, notes, and snippets.

@yifan-gu
Last active January 20, 2017 01:15
Show Gist options
  • Select an option

  • Save yifan-gu/07cad270df915cdeeb5de439bbc5602f to your computer and use it in GitHub Desktop.

Select an option

Save yifan-gu/07cad270df915cdeeb5de439bbc5602f to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Namespace
metadata:
name: fluentd
labels:
app: fluentd
---
apiVersion: v1
kind: Secret
metadata:
namespace: fluentd
name: fluentd-secrets
labels:
app: fluentd
deployment: kibana
type: Opaque
data:
aws-secret-key: {{FLUENTD_AWS_SECRET_KEY}}
aws-access-key: {{FLUENTD_AWS_ACCESS_KEY}}
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: fluentd
namespace: fluentd
labels:
app: fluentd
spec:
template:
metadata:
labels:
app: fluentd
spec:
containers:
- name: fluentd
image: quay.io/ecnahc515/docker-fluentd-kubernetes
imagePullPolicy: Always
env:
- name: CLUSTER_NAME
value: {{CLUSTER_NAME}}
- name: ELASTICSEARCH_RELOAD_CONNECTIONS
value: "false"
- name: ELASTICSEARCH_SCHEME
value: http
- name: ELASTICSEARCH_PORT
value: "8080"
- name: ELASTICSEARCH_HOST
value: "localhost"
- name: FLUENTD_LOGSTASH_PREFIX
value: "testclusterlogs"
- name: FLUENTD_BUFFER_TYPE
value: "memory"
- name: ELASTICSEARCH_REQUEST_TIMEOUT
value: "10s"
- name: FLUENTD_BUFFER_QUEUE_FULL_ACTION
value: "exception"
- name: FLUENTD_BUFFER_QUEUE_LIMIT
value: "64"
- name: FLUENTD_BUFFER_CHUNK_LIMIT
value: "8m"
- name: FLUENTD_DISABLE_RETRY_LIMIT
value: "true"
- name: FLUENTD_RETRY_LIMIT
value: "3"
- name: FLUENTD_RETRY_WAIT
value: "1s"
- name: FLUENTD_MAX_RETRY_WAIT
value: "10s"
- name: FLUENTD_FLUSH_INTERVAL
value: "10s"
- name: FLUENTD_FLUSH_THREADS
value: "4"
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
limits:
cpu: 750m
memory: 2048Mi
requests:
cpu: 250m
memory: 500Mi
volumeMounts:
- name: var-lib-docker-containers
mountPath: /var/lib/docker/containers
readOnly: true
- name: var-log
mountPath: /var/log
readOnly: false
- name: aws-signing-proxy
image: quay.io/ecnahc515/aws-signing-proxy:latest
env:
- name: AWS_REGION
value: us-west-1
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: fluentd-secrets
key: aws-access-key
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: fluentd-secrets
key: aws-secret-key
- name: AWS_SIGNING_PROXY_TARGET
value: {{FLUENTD_AWS_SIGNING_PROXY_TARGET}}
command:
- "/go/bin/app"
args:
- "-target"
- "$(AWS_SIGNING_PROXY_TARGET)"
resources:
limits:
cpu: 150m
memory: 512Mi
requests:
cpu: 50m
memory: 100Mi
ports:
- containerPort: 8080
name: proxy
volumeMounts:
- name: ssl
mountPath: "/etc/ssl/certs"
readOnly: true
volumes:
- name: ssl
hostPath:
path: "/usr/share/ca-certificates"
- name: var-lib-docker-containers
hostPath:
path: /var/lib/docker/containers
- name: var-log
hostPath:
path: /var/log
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment