blob: f275bc1f7e65182fa4644f552c9ab24af5d7519a [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
Richard Jankowskid4454382018-02-08 16:21:43 -050012 namespace: voltha
Richard Jankowskic9d89202018-01-25 10:25:10 -050013spec:
14 clusterIP: None
15 selector:
16 app: fluentdactv
17 ports:
18 - protocol: TCP
19 port: 24224
20 targetPort: 24224
21---
22#
23# Ensure that the active aggregator is not deployed to the
24# same node as the standby
25#
26apiVersion: apps/v1beta1
27kind: Deployment
28metadata:
29 name: fluentdactv
Richard Jankowskid4454382018-02-08 16:21:43 -050030 namespace: voltha
Richard Jankowskic9d89202018-01-25 10:25:10 -050031spec:
32 replicas: 1
33 template:
34 metadata:
35 labels:
36 app: fluentdactv
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050037 annotations:
38 cni: "weave"
Richard Jankowskic9d89202018-01-25 10:25:10 -050039 spec:
40 terminationGracePeriodSeconds: 10
41 affinity:
42 podAntiAffinity:
43 requiredDuringSchedulingIgnoredDuringExecution:
44 - labelSelector:
45 matchExpressions:
46 - key: app
47 operator: In
48 values:
49 - fluentdstby
50 topologyKey: kubernetes.io/hostname
51 containers:
52 - name: fluentdactv
khenaidoo1ee03e42018-02-20 12:45:41 -050053 image: k8s.gcr.io/fluentd-gcp:1.30
Richard Jankowskic9d89202018-01-25 10:25:10 -050054 imagePullPolicy: Never
55 volumeMounts:
56 - name: fluentd-log
57 mountPath: /fluentd/log
khenaidoo1ee03e42018-02-20 12:45:41 -050058 - name: config-volume
59 mountPath: /etc/fluentd-config
Richard Jankowskic9d89202018-01-25 10:25:10 -050060 ports:
61 - containerPort: 24224
62 env:
khenaidoo1ee03e42018-02-20 12:45:41 -050063 - name: FLUENTD_ARGS
64 value: -c /etc/fluentd-config/fluentd-agg.conf
Richard Jankowskic9d89202018-01-25 10:25:10 -050065 volumes:
khenaidoo1ee03e42018-02-20 12:45:41 -050066 - name: config-volume
67 configMap:
68 name: fluentd-config
Richard Jankowskic9d89202018-01-25 10:25:10 -050069 - name: fluentd-log
70 hostPath:
71 path: /var/log/voltha/logging_volume
72 type: Directory
73---
74#
75# The standby fluentd aggregator
76#
77apiVersion: v1
78kind: Service
79metadata:
80 name: fluentdstby
Richard Jankowskid4454382018-02-08 16:21:43 -050081 namespace: voltha
Richard Jankowskic9d89202018-01-25 10:25:10 -050082spec:
83 clusterIP: None
84 selector:
85 app: fluentdstby
86 ports:
87 - protocol: TCP
88 port: 24224
89 targetPort: 24224
90---
91#
92# Ensure thet the standby aggregator is not deployed to the
93# same node as the active
94#
95apiVersion: apps/v1beta1
96kind: Deployment
97metadata:
98 name: fluentdstby
Richard Jankowskid4454382018-02-08 16:21:43 -050099 namespace: voltha
Richard Jankowskic9d89202018-01-25 10:25:10 -0500100spec:
101 replicas: 1
102 template:
103 metadata:
104 labels:
105 app: fluentdstby
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500106 annotations:
107 cni: "weave"
Richard Jankowskic9d89202018-01-25 10:25:10 -0500108 spec:
109 terminationGracePeriodSeconds: 10
110 affinity:
111 podAntiAffinity:
112 requiredDuringSchedulingIgnoredDuringExecution:
113 - labelSelector:
114 matchExpressions:
115 - key: app
116 operator: In
117 values:
118 - fluentdactv
119 topologyKey: kubernetes.io/hostname
120 containers:
121 - name: fluentdstby
khenaidoo1ee03e42018-02-20 12:45:41 -0500122 image: k8s.gcr.io/fluentd-gcp:1.30
Richard Jankowskic9d89202018-01-25 10:25:10 -0500123 imagePullPolicy: Never
124 volumeMounts:
125 - name: fluentd-log
126 mountPath: /fluentd/log
khenaidoo1ee03e42018-02-20 12:45:41 -0500127 - name: config-volume
128 mountPath: /etc/fluentd-config
Richard Jankowskic9d89202018-01-25 10:25:10 -0500129 ports:
130 - containerPort: 24224
131 env:
khenaidoo1ee03e42018-02-20 12:45:41 -0500132 - name: FLUENTD_ARGS
133 value: -c /etc/fluentd-config/fluentd-agg.conf
Richard Jankowskic9d89202018-01-25 10:25:10 -0500134 volumes:
khenaidoo1ee03e42018-02-20 12:45:41 -0500135 - name: config-volume
136 configMap:
137 name: fluentd-config
Richard Jankowskic9d89202018-01-25 10:25:10 -0500138 - name: fluentd-log
139 hostPath:
140 path: /var/log/voltha/logging_volume
141 type: Directory
142---
143#
khenaidoo1ee03e42018-02-20 12:45:41 -0500144# The cluster of fluentd forwarders. The service itself will be removed once all fluentd forwarding logic are removed
145# from the specific voltha services. Fluentd is defined as a DaemonSet which implies that only 1 instance will
146# run on each node. Each instance will also gets its configuration data from a config map (fluentd-config.yml).
Richard Jankowskic9d89202018-01-25 10:25:10 -0500147#
148apiVersion: v1
149kind: Service
150metadata:
151 name: fluentd
Richard Jankowskid4454382018-02-08 16:21:43 -0500152 namespace: voltha
Richard Jankowskic9d89202018-01-25 10:25:10 -0500153spec:
154 clusterIP: None
155 selector:
156 app: fluentd
157 ports:
158 - protocol: TCP
159 port: 24224
160 targetPort: 24224
161---
khenaidoo1ee03e42018-02-20 12:45:41 -0500162apiVersion: extensions/v1beta1
163kind: DaemonSet
Richard Jankowskic9d89202018-01-25 10:25:10 -0500164metadata:
165 name: fluentd
Richard Jankowskid4454382018-02-08 16:21:43 -0500166 namespace: voltha
Richard Jankowskic9d89202018-01-25 10:25:10 -0500167spec:
khenaidoo1ee03e42018-02-20 12:45:41 -0500168 template:
Richard Jankowskic9d89202018-01-25 10:25:10 -0500169 metadata:
170 labels:
171 app: fluentd
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500172 annotations:
173 cni: "weave"
Richard Jankowskic9d89202018-01-25 10:25:10 -0500174 spec:
khenaidoo1ee03e42018-02-20 12:45:41 -0500175 tolerations:
176 - key: node-role.kubernetes.io/master
177 effect: NoSchedule
Richard Jankowskic9d89202018-01-25 10:25:10 -0500178 containers:
179 - name: fluentd
khenaidoo1ee03e42018-02-20 12:45:41 -0500180 image: k8s.gcr.io/fluentd-gcp:1.30
Richard Jankowskic9d89202018-01-25 10:25:10 -0500181 env:
khenaidoo1ee03e42018-02-20 12:45:41 -0500182 - name: FLUENTD_ARGS
183 value: -c /etc/fluentd-config/fluentd.conf
184 volumeMounts:
185 - name: varlog
186 mountPath: /var/log/
187 - name: varlogcontainers
188 mountPath: /var/lib/docker/containers/
189 - name: config-volume
190 mountPath: /etc/fluentd-config
191 volumes:
192 - name: varlog
193 hostPath:
194 path: /var/log/
195 - name: varlogcontainers
196 hostPath:
197 path: /var/lib/docker/containers/
198 - name: config-volume
199 configMap:
200 name: fluentd-config