Skip to content

Instantly share code, notes, and snippets.

@gravis
Created February 10, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gravis/97747657561b230abc6c to your computer and use it in GitHub Desktop.
Save gravis/97747657561b230abc6c to your computer and use it in GitHub Desktop.
kind: Template
apiVersion: v1
metadata:
name: graylog
parameters:
- name: GRAYLOG_PASSWORD
description: "Set admin password"
generate: expression
from: "[a-zA-Z0-9]{20}"
- name: GRAYLOG_USERNAME
description: "Set username for admin user (default: admin)"
value:
- name: GRAYLOG_TIMEZONE
description: "Set timezone (TZ) you are in"
value: "Europe/Paris"
- name: GRAYLOG_SMTP_SERVER
description: "Hostname/IP address of your SMTP server for sending alert mails"
value: "example.com --port=465 --user=username@mailserver.com --password=SecretPassword --from-email=graylog@example.com --web-url=http://my.graylog.host"
- name: GRAYLOG_RETENTION
description: "Configure how long or how many logs should be stored"
value:
- name: GRAYLOG_NODE_ID
description: "Set server node ID (default: random)"
generate: expression
from: "[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}"
- name: GRAYLOG_SERVER_SECRET
description: "Set salt for encryption"
generate: expression
from: "[a-zA-Z0-9]{64}"
- name: ES_MEMORY
description: "Set memory used by Elasticsearch (syntax: 1024m). Defaults to 60% of host memory"
value:
- name: VOLUME_CAPACITY
description: "Volume space available for data, e.g. 512Mi, 2Gi"
value: "40Gi"
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: graylog
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 40Gi
- apiVersion: v1
kind: ImageStream
metadata:
name: graylog2
spec:
dockerImageRepository: "graylog2/allinone"
- apiVersion: v1
kind: Service
metadata:
name: graylog
spec:
ports:
- name: web
port: 9000
protocol: TCP
targetPort: 9000
- name: gelf-tcp
port: 12201
protocol: TCP
targetPort: 12201
selector:
type: gelf-input
- apiVersion: v1
kind: Service
metadata:
name: graylog
spec:
ports:
- name: gelf-udp
port: 12201
protocol: UDP
targetPort: 12201
- name: syslog
port: 12302
protocol: UDP
targetPort: 12302
selector:
type: gelf-input
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: graylog-master
spec:
replicas: 1
selector:
name: graylog-master
strategy:
type: Recreate
template:
metadata:
labels:
name: graylog-master
type: gelf-input
spec:
containers:
- image: graylog2/allinone
name: graylog
env:
- name: GRAYLOG_PASSWORD
value: ${GRAYLOG_PASSWORD}
- name: GRAYLOG_USERNAME
value: ${GRAYLOG_USERNAME}
- name: GRAYLOG_TIMEZONE
value: ${GRAYLOG_TIMEZONE}
- name: GRAYLOG_SMTP_SERVER
value: ${GRAYLOG_SMTP_SERVER}
- name: GRAYLOG_RETENTION
value: ${GRAYLOG_RETENTION}
- name: GRAYLOG_NODE_ID
value: ${GRAYLOG_NODE_ID}
- name: GRAYLOG_SERVER_SECRET
value: ${GRAYLOG_SERVER_SECRET}
- name: ES_MEMORY
value: ${ES_MEMORY}
ports:
- containerPort: 9000
name: web
protocol: TCP
- containerPort: 12201
name: gelf-udp
protocol: UDP
- containerPort: 12302
name: syslog
protocol: UDP
volumeMounts:
- mountPath: /var/opt/graylog/data
name: data
- mountPath: /var/log/graylog
name: logs
- mountPath: /opt/graylog/plugin
name: plugins
volumes:
- name: data
persistentVolumeClaim:
claimName: graylog
- emptyDir: {}
name: logs
- emptyDir: {}
name: plugins
triggers:
- imageChangeParams:
automatic: true
containerNames:
- graylog
from:
kind: ImageStreamTag
name: graylog2:latest
type: ImageChange
- type: ConfigChange
- kind: Route
apiVersion: v1
metadata:
name: graylog-web
spec:
to:
kind: Service
name: graylog
port: 9000
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment