forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#2015 from satnam6502/fluentd-ek
Fluentd example with Elasticsearch and Kibana in separate pods
- Loading branch information
Showing
6 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Makefile for Fluentd to Elastiscsearch and Kibana configured | ||
# in separate pods. | ||
|
||
|
||
.PHONY: up dow es-up kibana-up es-down kibana-down update \ | ||
logger-up logger-down get net firewall rmfirewall | ||
|
||
KUBECTL=kubectl.sh | ||
|
||
up: logger-up es-up kibana-up | ||
|
||
down: logger-down es-down kibana-down | ||
|
||
|
||
es-up: | ||
-${KUBECTL} create -f es-pod.yml | ||
-${KUBECTL} create -f es-service.yml | ||
|
||
kibana-up: | ||
-${KUBECTL} create -f kibana-pod.yml | ||
-${KUBECTL} create -f kibana-service.yml | ||
|
||
es-down: | ||
-${KUBECTL} delete pods elasticsearch-pod | ||
-${KUBECTL} delete service elasticsearch | ||
|
||
kibana-down: | ||
-${KUBECTL} delete pods kibana-pod | ||
-${KUBECTL} delete service kibana | ||
|
||
|
||
update: | ||
-${KUBECTL} delete pods kibana-pod | ||
-${KUBECTL} create -f kibana-pod.yml | ||
|
||
logger-up: | ||
-${KUBECTL} create -f synthetic_0_25lps.yml | ||
|
||
logger-down: | ||
-${KUBECTL} delete pods synthetic-logger-0.25lps-pod | ||
|
||
get: | ||
${KUBECTL} get pods | ||
${KUBECTL} get services | ||
|
||
net: | ||
gcutil getforwardingrule elasticsearch | ||
gcutil getforwardingrule kibana | ||
|
||
firewall: | ||
gcutil addfirewall --allowed=tcp:5601,tcp:9200,tcp:9300 --target_tags=kubernetes-minion kubernetes-elk-example | ||
|
||
|
||
rmfirewall: | ||
gcutil deletefirewall -f kubernetes-elk-example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1beta1 | ||
kind: Pod | ||
id: elasticsearch-pod | ||
desiredState: | ||
manifest: | ||
version: v1beta1 | ||
id: es | ||
containers: | ||
- name: elasticsearch | ||
image: dockerfile/elasticsearch | ||
ports: | ||
- name: es-port | ||
containerPort: 9200 | ||
- name: es-transport-port | ||
containerPort: 9300 | ||
volumeMounts: | ||
- name: es-persistent-storage | ||
mountPath: /data | ||
volumes: | ||
- name: es-persistent-storage | ||
source: | ||
emptyDir: {} | ||
labels: | ||
app: elasticsearch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1beta1 | ||
kind: Service | ||
id: elasticsearch | ||
containerPort: es-port | ||
port: 9200 | ||
selector: | ||
app: elasticsearch | ||
createExternalLoadBalancer: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1beta1 | ||
kind: Pod | ||
id: kibana-pod | ||
desiredState: | ||
manifest: | ||
version: v1beta1 | ||
id: kibana-server | ||
containers: | ||
- name: kibana-image | ||
image: kubernetes/kibana:latest | ||
ports: | ||
- name: kibana-port | ||
containerPort: 80 | ||
labels: | ||
app: kibana-viewer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1beta1 | ||
kind: Service | ||
id: kibana | ||
containerPort: kibana-port | ||
port: 5601 | ||
selector: | ||
app: kibana-viewer | ||
createExternalLoadBalancer: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This pod specification creates an instance of a synthetic logger. The logger | ||
# is simply a program that writes out the hostname of the pod, a count which increments | ||
# by one on each iteration (to help notice missing log enteries) and the date using | ||
# a long format (RFC-3339) to nano-second precision. This program logs at a frequency | ||
# of 0.25 lines per second. The shellscript program is given directly to bash as -c argument | ||
# and could have been written out as: | ||
# i="0" | ||
# while true | ||
# do | ||
# echo -n "`hostname`: $i: " | ||
# date --rfc-3339 ns | ||
# sleep 4 | ||
# i=$[$i+1] | ||
# done | ||
|
||
apiVersion: v1beta1 | ||
kind: Pod | ||
id: synthetic-logger-0.25lps-pod | ||
desiredState: | ||
manifest: | ||
version: v1beta1 | ||
id: synth-logger-0.25lps | ||
containers: | ||
- name: synth-lgr | ||
image: ubuntu:14.04 | ||
command: ["bash", "-c", "i=\"0\"; while true; do echo -n \"`hostname`: $i: \"; date --rfc-3339 ns; sleep 4; i=$[$i+1]; done"] | ||
labels: | ||
name: synth-logging-source | ||
|