blob: 1a7ec0fdad0e0f5f6136ab48dbbb3eb64f6447cd [file] [log] [blame]
Richard Jankowskic9d89202018-01-25 10:25:10 -05001#
2# This file describes a cluster of 3 fluentd forwarders that
3# send logs to a cluster of 2 fluentd aggregators: one active
4# and one standby.
5#
6# The active fluentd aggregator
7#
8apiVersion: v1
9kind: Service
10metadata:
11 name: fluentdactv
12spec:
13 clusterIP: None
14 selector:
15 app: fluentdactv
16 ports:
17 - protocol: TCP
18 port: 24224
19 targetPort: 24224
20---
21#
22# Ensure that the active aggregator is not deployed to the
23# same node as the standby
24#
25apiVersion: apps/v1beta1
26kind: Deployment
27metadata:
28 name: fluentdactv
29spec:
30 replicas: 1
31 template:
32 metadata:
33 labels:
34 app: fluentdactv
35 spec:
36 terminationGracePeriodSeconds: 10
37 affinity:
38 podAntiAffinity:
39 requiredDuringSchedulingIgnoredDuringExecution:
40 - labelSelector:
41 matchExpressions:
42 - key: app
43 operator: In
44 values:
45 - fluentdstby
46 topologyKey: kubernetes.io/hostname
47 containers:
48 - name: fluentdactv
Richard Jankowskic3c291c2018-02-02 13:57:33 -050049 image: voltha-fluentd
Richard Jankowskic9d89202018-01-25 10:25:10 -050050 imagePullPolicy: Never
51 volumeMounts:
52 - name: fluentd-log
53 mountPath: /fluentd/log
54 ports:
55 - containerPort: 24224
56 env:
57 - name: FLUENTD_CONF
58 value: fluent-agg.conf
59 volumes:
60 - name: fluentd-log
61 hostPath:
62 path: /var/log/voltha/logging_volume
63 type: Directory
64---
65#
66# The standby fluentd aggregator
67#
68apiVersion: v1
69kind: Service
70metadata:
71 name: fluentdstby
72spec:
73 clusterIP: None
74 selector:
75 app: fluentdstby
76 ports:
77 - protocol: TCP
78 port: 24224
79 targetPort: 24224
80---
81#
82# Ensure thet the standby aggregator is not deployed to the
83# same node as the active
84#
85apiVersion: apps/v1beta1
86kind: Deployment
87metadata:
88 name: fluentdstby
89spec:
90 replicas: 1
91 template:
92 metadata:
93 labels:
94 app: fluentdstby
95 spec:
96 terminationGracePeriodSeconds: 10
97 affinity:
98 podAntiAffinity:
99 requiredDuringSchedulingIgnoredDuringExecution:
100 - labelSelector:
101 matchExpressions:
102 - key: app
103 operator: In
104 values:
105 - fluentdactv
106 topologyKey: kubernetes.io/hostname
107 containers:
108 - name: fluentdstby
Richard Jankowskic3c291c2018-02-02 13:57:33 -0500109 image: voltha-fluentd
Richard Jankowskic9d89202018-01-25 10:25:10 -0500110 imagePullPolicy: Never
111 volumeMounts:
112 - name: fluentd-log
113 mountPath: /fluentd/log
114 ports:
115 - containerPort: 24224
116 env:
117 - name: FLUENTD_CONF
118 value: fluent-agg.conf
119 volumes:
120 - name: fluentd-log
121 hostPath:
122 path: /var/log/voltha/logging_volume
123 type: Directory
124---
125#
126# The cluster of fluentd forwarders
127#
128apiVersion: v1
129kind: Service
130metadata:
131 name: fluentd
132spec:
133 clusterIP: None
134 selector:
135 app: fluentd
136 ports:
137 - protocol: TCP
138 port: 24224
139 targetPort: 24224
140---
141apiVersion: apps/v1beta1
142kind: Deployment
143metadata:
144 name: fluentd
145spec:
146 replicas: 3
147 template:
148 metadata:
149 labels:
150 app: fluentd
151 spec:
152 terminationGracePeriodSeconds: 10
153 affinity:
154 podAntiAffinity:
155 requiredDuringSchedulingIgnoredDuringExecution:
156 - labelSelector:
157 matchExpressions:
158 - key: app
159 operator: In
160 values:
161 - fluentd
162 topologyKey: kubernetes.io/hostname
163 containers:
164 - name: fluentd
Richard Jankowskic3c291c2018-02-02 13:57:33 -0500165 image: voltha-fluentd
Richard Jankowskic9d89202018-01-25 10:25:10 -0500166 imagePullPolicy: Never
167 ports:
168 - containerPort: 24224
169 env:
170 - name: FLUENTD_CONF
171 value: fluent.conf